diff options
author | isaacs <i@izs.me> | 2020-08-21 01:47:51 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2020-08-21 01:47:51 +0300 |
commit | f8603c8affefc342d81c109e4676d498a8359b78 (patch) | |
tree | ddca742a2f91ab134681dc4b070231198476b0b3 /node_modules/libnpmversion | |
parent | a1405455843db1b14938596303b29fb3ad4f90f0 (diff) |
libnpmversion@1.0.4
Adds better indentation/newline preservation
Diffstat (limited to 'node_modules/libnpmversion')
-rw-r--r-- | node_modules/libnpmversion/lib/index.js | 2 | ||||
-rw-r--r-- | node_modules/libnpmversion/lib/read-json.js | 19 | ||||
-rw-r--r-- | node_modules/libnpmversion/lib/version.js | 2 | ||||
-rw-r--r-- | node_modules/libnpmversion/package.json | 5 |
4 files changed, 4 insertions, 24 deletions
diff --git a/node_modules/libnpmversion/lib/index.js b/node_modules/libnpmversion/lib/index.js index c3f554834..525d8264e 100644 --- a/node_modules/libnpmversion/lib/index.js +++ b/node_modules/libnpmversion/lib/index.js @@ -1,4 +1,4 @@ -const readJson = require('./read-json.js') +const readJson = require('read-package-json-fast') const version = require('./version.js') const proclog = require('./proc-log.js') diff --git a/node_modules/libnpmversion/lib/read-json.js b/node_modules/libnpmversion/lib/read-json.js deleted file mode 100644 index 8c160a7b4..000000000 --- a/node_modules/libnpmversion/lib/read-json.js +++ /dev/null @@ -1,19 +0,0 @@ -// the same as read-package-json-fast, but stash the -// indent and newline on known symbols for later retrieval. -const {normalize} = require('read-package-json-fast') -const jsonParse = require('json-parse-even-better-errors') -const {promisify} = require('util') -const readFile = promisify(require('fs').readFile) -const kIndent = Symbol.for('indent') -const kNewline = Symbol.for('newline') - -module.exports = async path => readFile(path, 'utf8').then(data => { - // just take the first line-break and indent, if any are present - const m = data.match(/(\r?\n)(\s*)"/) - const newline = m ? m[1] : '\n' - const indent = m ? m[2] : '' - const pkg = normalize(jsonParse(data)) - pkg[kIndent] = indent - pkg[kNewline] = newline - return pkg -}) diff --git a/node_modules/libnpmversion/lib/version.js b/node_modules/libnpmversion/lib/version.js index a7ed80780..b3590c3f0 100644 --- a/node_modules/libnpmversion/lib/version.js +++ b/node_modules/libnpmversion/lib/version.js @@ -4,7 +4,7 @@ const retrieveTag = require('./retrieve-tag.js') const semver = require('semver') const enforceClean = require('./enforce-clean.js') const writeJson = require('./write-json.js') -const readJson = require('./read-json.js') +const readJson = require('read-package-json-fast') const git = require('@npmcli/git') const commit = require('./commit.js') const tag = require('./tag.js') diff --git a/node_modules/libnpmversion/package.json b/node_modules/libnpmversion/package.json index 9941b810e..a5020146d 100644 --- a/node_modules/libnpmversion/package.json +++ b/node_modules/libnpmversion/package.json @@ -1,6 +1,6 @@ { "name": "libnpmversion", - "version": "1.0.3", + "version": "1.0.4", "main": "lib/index.js", "files": [ "lib/*.js" @@ -30,8 +30,7 @@ "dependencies": { "@npmcli/git": "^2.0.1", "@npmcli/run-script": "^1.2.1", - "json-parse-even-better-errors": "^2.2.0", - "read-package-json-fast": "^1.1.3", + "read-package-json-fast": "^1.2.1", "semver": "^7.1.3", "stringify-package": "^1.0.1" } |