This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: sanitise package.json files field (#800)
* fix: sanitise package.json files field * Apply suggestions from code review Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com> Co-authored-by: Netlify Team Account 1 <netlify-team-account-1@users.noreply.github.com> Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>
- Loading branch information
1 parent
87de250
commit 6c82ada
Showing
2 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const test = require('ava') | ||
|
||
const { sanitisePackageJson } = require('../dist/runtimes/node/utils/package_json') | ||
|
||
test('sanitisePackageJson', (t) => { | ||
t.deepEqual( | ||
sanitisePackageJson({ | ||
files: ['a.js', null, 'b.js'], | ||
}), | ||
{ | ||
files: ['a.js', 'b.js'], | ||
}, | ||
) | ||
|
||
t.deepEqual( | ||
sanitisePackageJson({ | ||
files: { 'a.js': true, 'b.js': false }, | ||
}), | ||
{ | ||
files: undefined, | ||
}, | ||
) | ||
}) |
6c82ada
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⏱ Benchmark results
largeDepsEsbuild: 7.5s
largeDepsNft: 46.9s
largeDepsZisi: 56.1s