Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deal with changes to node's Buffer #547

Closed
humphd opened this issue Oct 9, 2018 · 4 comments
Closed

Deal with changes to node's Buffer #547

humphd opened this issue Oct 9, 2018 · 4 comments

Comments

@humphd
Copy link
Contributor

humphd commented Oct 9, 2018

In node, new Buffer(8) gives [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. We should prepare for this, and alter how we expect to use Buffers in Filer.

@ilDon
Copy link

ilDon commented Nov 9, 2018

Great to see this being addressed. I am currently using Filer.Buffer in a isomorphic app and on Node I'm getting this issue.

@humphd
Copy link
Contributor Author

humphd commented Nov 10, 2018

@ilDon, would you be willing to toss a snippet of code similar to what you're doing in your APP, and then I can add a regression test for the case you need to make sure we support. Thanks.

@ilDon
Copy link

ilDon commented Nov 11, 2018

I'm using Filer.Buffer to generate the Buffer like so (TypeScript):

import * as Filer from 'filer';

export class FileBuffer {

  public static generateFileBuffer(fileArrayBuffer: ArrayBuffer | Uint8Array | Array<number>): Buffer {
    return Filer.Buffer(fileArrayBuffer);
  }

}

Thanks!

@humphd
Copy link
Contributor Author

humphd commented Dec 2, 2018

OK, this is done. We'll do what node does and support both ways (ctor + .alloc()/.from()).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants