diff options
author | Rebecca Turner <me@re-becca.org> | 2017-08-18 23:58:39 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2017-08-19 00:00:40 +0300 |
commit | 459fa9d51600904ee75ed6267b159367a1209793 (patch) | |
tree | 3af62ddd1c3b319655a11bed6844fdf9a9db53b6 /node_modules/read-package-json | |
parent | 6e012924f99c475bc3637c86ab6a113875405fc7 (diff) |
read-package-json@2.0.12
Credit: @iarna
Reviewed-By: @zkat
PR-URL: https://github.com/npm/read-package-json/pull/74
Fixes: #17802
Diffstat (limited to 'node_modules/read-package-json')
5 files changed, 136 insertions, 14 deletions
diff --git a/node_modules/read-package-json/node_modules/slash/index.js b/node_modules/read-package-json/node_modules/slash/index.js new file mode 100644 index 000000000..b946a0841 --- /dev/null +++ b/node_modules/read-package-json/node_modules/slash/index.js @@ -0,0 +1,11 @@ +'use strict'; +module.exports = function (str) { + var isExtendedLengthPath = /^\\\\\?\\/.test(str); + var hasNonAscii = /[^\x00-\x80]+/.test(str); + + if (isExtendedLengthPath || hasNonAscii) { + return str; + } + + return str.replace(/\\/g, '/'); +}; diff --git a/node_modules/read-package-json/node_modules/slash/package.json b/node_modules/read-package-json/node_modules/slash/package.json new file mode 100644 index 000000000..847f1844d --- /dev/null +++ b/node_modules/read-package-json/node_modules/slash/package.json @@ -0,0 +1,65 @@ +{ + "_from": "slash@^1.0.0", + "_id": "slash@1.0.0", + "_inBundle": false, + "_integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "_location": "/read-package-json/slash", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "slash@^1.0.0", + "name": "slash", + "escapedName": "slash", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/read-package-json" + ], + "_resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "_shasum": "c41f2f6c39fc16d1cd17ad4b5d896114ae470d55", + "_spec": "slash@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/read-package-json", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/slash/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Convert Windows backslash paths to slash paths", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/slash#readme", + "keywords": [ + "path", + "seperator", + "sep", + "slash", + "backslash", + "windows", + "win" + ], + "license": "MIT", + "name": "slash", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/slash.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.0.0" +} diff --git a/node_modules/read-package-json/node_modules/slash/readme.md b/node_modules/read-package-json/node_modules/slash/readme.md new file mode 100644 index 000000000..15672f010 --- /dev/null +++ b/node_modules/read-package-json/node_modules/slash/readme.md @@ -0,0 +1,44 @@ +# slash [![Build Status](https://travis-ci.org/sindresorhus/slash.svg?branch=master)](https://travis-ci.org/sindresorhus/slash) + +> Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar` + +[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths and don't contain any non-ascii characters. + +This was created since the `path` methods in Node outputs `\\` paths on Windows. + + +## Install + +```sh +$ npm install --save slash +``` + + +## Usage + +```js +var path = require('path'); +var slash = require('slash'); + +var str = path.join('foo', 'bar'); +// Unix => foo/bar +// Windows => foo\\bar + +slash(str); +// Unix => foo/bar +// Windows => foo/bar +``` + + +## API + +### slash(path) + +Type: `string` + +Accepts a Windows backslash path and returns a slash path. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/read-package-json/package.json b/node_modules/read-package-json/package.json index d9f9d3358..0df406db6 100644 --- a/node_modules/read-package-json/package.json +++ b/node_modules/read-package-json/package.json @@ -1,19 +1,19 @@ { - "_from": "read-package-json@~2.0.11", - "_id": "read-package-json@2.0.11", + "_from": "read-package-json@2.0.12", + "_id": "read-package-json@2.0.12", "_inBundle": false, - "_integrity": "sha512-nh/pSmP/Sm9f6z5NVigF9xTJmRZnzBeztvGVAZIkbWDBs6yKNPSDfaQXt8RzqjZ01hXndWfew4f90MGpH3FyfA==", + "_integrity": "sha512-m7/I0+tP6D34EVvSlzCtuVA4D/dHL6OpLcn2e4XVP5X57pCKGUy1JjRSBVKHWpB+vUU91sL85h84qX0MdXzBSw==", "_location": "/read-package-json", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "read-package-json@~2.0.11", + "raw": "read-package-json@2.0.12", "name": "read-package-json", "escapedName": "read-package-json", - "rawSpec": "~2.0.11", + "rawSpec": "2.0.12", "saveSpec": null, - "fetchSpec": "~2.0.11" + "fetchSpec": "2.0.12" }, "_requiredBy": [ "#USER", @@ -22,10 +22,10 @@ "/read-installed", "/read-package-tree" ], - "_resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.11.tgz", - "_shasum": "5e3e1ef31e7146d91fbb79bf9fb1e7611b67006c", - "_spec": "read-package-json@~2.0.11", - "_where": "/Users/zkat/Documents/code/npm", + "_resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.12.tgz", + "_shasum": "68ea45f98b3741cb6e10ae3bbd42a605026a6951", + "_spec": "read-package-json@2.0.12", + "_where": "/Users/rebecca/code/npm", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -39,7 +39,8 @@ "glob": "^7.1.1", "graceful-fs": "^4.1.2", "json-parse-better-errors": "^1.0.0", - "normalize-package-data": "^2.0.0" + "normalize-package-data": "^2.0.0", + "slash": "^1.0.0" }, "deprecated": false, "description": "The thing npm uses to read package.json files with semantics and defaults and validation", @@ -64,5 +65,5 @@ "scripts": { "test": "standard && tap -J test/*.js" }, - "version": "2.0.11" + "version": "2.0.12" } diff --git a/node_modules/read-package-json/read-json.js b/node_modules/read-package-json/read-json.js index b7635e18e..969bcc030 100644 --- a/node_modules/read-package-json/read-json.js +++ b/node_modules/read-package-json/read-json.js @@ -11,6 +11,7 @@ var glob = require('glob') var normalizeData = require('normalize-package-data') var safeJSON = require('json-parse-better-errors') var util = require('util') +var slash = require('slash') module.exports = readJson @@ -316,7 +317,7 @@ function bins_ (file, data, bins, cb) { data.bin = bins.reduce(function (acc, mf) { if (mf && mf.charAt(0) !== '.') { var f = path.basename(mf) - acc[f] = path.join(m, mf) + acc[f] = slash(path.join(m, mf)) } return acc }, {}) |