kriszyp / msgpackr

Ultra-fast MessagePack implementation with extension for record and structural cloning / msgpack.org[JavaScript/NodeJS]
MIT License
479 stars 51 forks source link

Expose Packr flags + TypeScript fixes #137

Closed endel closed 3 months ago

endel commented 3 months ago

Hi there,

This PR exposes the following flags:

It also exposes these to TypeScript:

export class Packr extends Unpackr {
    // ...
    offset: number;
    useBuffer(buffer: Buffer): void;
    clearSharedData(): void;
}

Let me know if something's missing so I can improve this PR.

Thank you for the great work on this lib @kriszyp, cheers! 💙

endel commented 3 months ago

Update: added the missing TypeScript types for the options argument of both .pack() and .unpack() methods: https://github.com/endel/msgpackr/commit/7f7749546115e0ef638c8459c53486e0624a4e40

endel commented 3 months ago

Update: exposed Packr.offset to TypeScript 🙌

kriszyp commented 3 months ago

Thank you for the PR!