diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/write-pkg | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/write-pkg')
-rw-r--r-- | node_modules/write-pkg/index.js | 8 | ||||
-rw-r--r-- | node_modules/write-pkg/license | 20 | ||||
-rw-r--r-- | node_modules/write-pkg/package.json | 8 | ||||
-rw-r--r-- | node_modules/write-pkg/readme.md | 4 |
4 files changed, 16 insertions, 24 deletions
diff --git a/node_modules/write-pkg/index.js b/node_modules/write-pkg/index.js index 262fa925a..981cc0b54 100644 --- a/node_modules/write-pkg/index.js +++ b/node_modules/write-pkg/index.js @@ -3,7 +3,7 @@ const path = require('path'); const writeJsonFile = require('write-json-file'); const sortKeys = require('sort-keys'); -const opts = {indent: 2}; +const opts = {detectIndent: true}; const dependencyKeys = new Set([ 'dependencies', @@ -16,7 +16,11 @@ function normalize(pkg) { const ret = {}; for (const key of Object.keys(pkg)) { - ret[key] = dependencyKeys.has(key) ? sortKeys(pkg[key]) : pkg[key]; + if (!dependencyKeys.has(key)) { + ret[key] = pkg[key]; + } else if (Object.keys(pkg[key]).length !== 0) { + ret[key] = sortKeys(pkg[key]); + } } return ret; diff --git a/node_modules/write-pkg/license b/node_modules/write-pkg/license index 654d0bfe9..e7af2f771 100644 --- a/node_modules/write-pkg/license +++ b/node_modules/write-pkg/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/write-pkg/package.json b/node_modules/write-pkg/package.json index c3773513c..c0ca39a2c 100644 --- a/node_modules/write-pkg/package.json +++ b/node_modules/write-pkg/package.json @@ -1,6 +1,6 @@ { "name": "write-pkg", - "version": "2.1.0", + "version": "3.1.0", "description": "Write a package.json file", "license": "MIT", "repository": "sindresorhus/write-pkg", @@ -29,13 +29,13 @@ "package" ], "dependencies": { - "sort-keys": "^1.1.2", - "write-json-file": "^2.0.0" + "sort-keys": "^2.0.0", + "write-json-file": "^2.2.0" }, "devDependencies": { "ava": "*", "read-pkg": "^2.0.0", - "tempfile": "^1.1.1", + "tempfile": "^2.0.0", "xo": "*" } } diff --git a/node_modules/write-pkg/readme.md b/node_modules/write-pkg/readme.md index fa51dad26..a10a8b6d9 100644 --- a/node_modules/write-pkg/readme.md +++ b/node_modules/write-pkg/readme.md @@ -2,13 +2,13 @@ > Write a `package.json` file -Writes atomically and creates directories for you as needed. Sorts dependencies when writing. +Writes atomically and creates directories for you as needed. Sorts dependencies when writing. Preserves the indentation if the file already exists. ## Install ``` -$ npm install --save write-pkg +$ npm install write-pkg ``` |