Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Consolidate code for stringifying package data and add tests #19907

Merged
merged 1 commit into from
Feb 25, 2018

Conversation

nwoltman
Copy link
Contributor

This reduces code duplication for detecting indentation and new lines in package[-lock].json and stringifying the data. This also improves performance on Unix systems since it avoids replacing newlines when it's not necessary.

Tests have been added to test that package[-lock].json files are written to disk with their original line endings.

Mostly based on #18943 rebased after #19904.

This reduces code duplication for detecting indentation and new lines in
`package[-lock].json` and stringifying the data. This also improves
performance on Unix systems since it avoids replacing newlines when
it's not necessary.

Tests have been added to test that `package[-lock].json` files are
written to disk with their original line endings.
@nwoltman nwoltman requested a review from a team as a code owner February 24, 2018 22:56
Copy link
Contributor

@zkat zkat left a comment

Choose a reason for hiding this comment

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

This is awesome! Thanks so much for the refactor and the well-written tests! 👍

Sorry again for clobbering your old PR like that! 🙊

@zkat zkat merged commit fe41a80 into npm:release-next Feb 25, 2018
@nwoltman
Copy link
Contributor Author

@zkat That's okay! Thanks for all the work you do :)

@nwoltman nwoltman deleted the consolidate-stringify-package branch February 25, 2018 03:05
zkat pushed a commit that referenced this pull request Mar 1, 2018
…ta and add tests (#19907)

This reduces code duplication for detecting indentation and new lines in
`package[-lock].json` and stringifying the data. This also improves
performance on Unix systems since it avoids replacing newlines when
it's not necessary.

Tests have been added to test that `package[-lock].json` files are
written to disk with their original line endings.

PR-URL: #19907
Credit: @nwoltman
Reviewed-By: @zkat
zkat pushed a commit that referenced this pull request Mar 8, 2018
…ta and add tests (#19907)

This reduces code duplication for detecting indentation and new lines in
`package[-lock].json` and stringifying the data. This also improves
performance on Unix systems since it avoids replacing newlines when
it's not necessary.

Tests have been added to test that `package[-lock].json` files are
written to disk with their original line endings.

PR-URL: #19907
Credit: @nwoltman
Reviewed-By: @zkat
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants