frame-stream icon indicating copy to clipboard operation
frame-stream copied to clipboard

Use "Object.assign" instead of node's deprecated "util._extend"

Open bxt opened this issue 1 year ago • 0 comments

As described in https://github.com/davedoesdev/frame-stream/issues/23 this project uses the deprecated util._extend of node's utils package in the code here in the constructor of Decoder to merge the options with the default ones:

https://github.com/davedoesdev/frame-stream/blob/f688aee92d2fb10f5f7959740296887c2a98aecb/lib/index.js#L12

This PR replaces it with Object.assign() which has been there since node 4.0.0 and this project lists >=18 in the node engines field.

I also ran npm audit fix as npm prompted me to do it immediately, and it just touches dev dependencies of eslint.

I ran npm run test and npm run lint to make sure everything still works as intended.

I also ran npm run test with this.opts = opts and this.opts = { lengthSize: 4, maxSize: 0, unbuffered: false } to see if the tests would cover those cases, and indeed some turned red for both cases. So I think that should suffice.

Let me know what you think or if you want me to do some changes or run some other tests.

bxt avatar Mar 04 '25 16:03 bxt