Skip to content

NODE-2253: Support for v1 Extended JSON#339

Merged
mbroadst merged 8 commits intomasterfrom
legacy-extended-json
Jan 7, 2020
Merged

NODE-2253: Support for v1 Extended JSON#339
mbroadst merged 8 commits intomasterfrom
legacy-extended-json

Conversation

@durran
Copy link
Copy Markdown
Contributor

@durran durran commented Dec 3, 2019

  • Adds a legacy: true option to serialize, deserialize, parse, and stringify.
  • Adds tests for cases where v1 and v2 extjson differ.

- Adds a legacy: true option to serialize and stringify
- Adds tests for cases where v1 and v2 extjson differ.
@durran durran force-pushed the legacy-extended-json branch from 474eb4d to 4843287 Compare December 3, 2019 20:18
@durran durran changed the title NODE-2253: Support for v1 Extended JSON [WIP] NODE-2253: Support for v1 Extended JSON Dec 16, 2019
@durran durran requested a review from mbroadst December 16, 2019 10:16
Copy link
Copy Markdown
Contributor

@imlucas imlucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with update to docs in README

Copy link
Copy Markdown
Contributor

@imlucas imlucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Comment thread lib/binary.js
: Buffer.from(this.buffer).toString('base64');

const subType = Number(this.sub_type).toString(16);
if (options.legacy) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to ensure options exists, otherwise you'll have an error on trying to access legacy on it. Recommend:

  • typeof options !== 'undefined' && options.legacy
  • adding a options = options || {} above
  • make some helper function to check this, since its likely you are doing it many places

I realize this may be an existing issue prior to the changes introduced here, but this PR would necessarily introduce such a bug into every method now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbroadst I can take care of this tmrw if @durran doesn't beat me to it and you give me push access to this repo.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imlucas added you as a collaborator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Pushed

@mbroadst mbroadst merged commit 35ae72f into master Jan 7, 2020
@mbroadst mbroadst deleted the legacy-extended-json branch January 7, 2020 17:08
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

Successfully merging this pull request may close these issues.

4 participants