Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2020-06-04 01:07:00 +0300
committerisaacs <i@izs.me>2020-06-04 01:08:48 +0300
commit1f9cfdac2eda3bd4a3b1427fc450a05811f353fe (patch)
treef4ceaaad2afb9bd35d8096356421015605002ce3 /node_modules/common-ancestor-path
parentf1724f457a9e84c7f5c89b6439ef0ab6f482c3c6 (diff)
update @npmcli/arborist, pacote, cacache
Also some hand-crafted deduping of various deps that got nested as a result. Really excited to start self-installing again soon. @npmcli/arborist is a whole lot smarter about pruning unnecessary duplicate modules in the normal course of installation.
Diffstat (limited to 'node_modules/common-ancestor-path')
-rw-r--r--node_modules/common-ancestor-path/LICENSE15
-rw-r--r--node_modules/common-ancestor-path/README.md28
-rw-r--r--node_modules/common-ancestor-path/index.js17
-rw-r--r--node_modules/common-ancestor-path/package.json61
4 files changed, 121 insertions, 0 deletions
diff --git a/node_modules/common-ancestor-path/LICENSE b/node_modules/common-ancestor-path/LICENSE
new file mode 100644
index 000000000..05eeeb88c
--- /dev/null
+++ b/node_modules/common-ancestor-path/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/common-ancestor-path/README.md b/node_modules/common-ancestor-path/README.md
new file mode 100644
index 000000000..2e8764373
--- /dev/null
+++ b/node_modules/common-ancestor-path/README.md
@@ -0,0 +1,28 @@
+# common-ancestor-path
+
+Find the common ancestor of 2 or more paths on Windows or Unix
+
+## USAGE
+
+Give it two or more path strings, and it'll do the thing.
+
+```js
+const ancestor = require('common-ancestor-path')
+
+// output /a/b
+console.log(ancestor('/a/b/c/d', '/a/b/x/y/z', '/a/b/c/i/j/k'))
+
+// normalizes separators, but NOT cases, since it matters sometimes
+console.log(ancestor('C:\\a\\b\\c', 'C:\\a\\b\\x'))
+
+// no common ancestor on different windows drive letters
+// so, this returns null
+console.log(ancestor('c:\\a\\b\\c', 'd:\\d\\e\\f'))
+```
+
+## API
+
+`commonAncestorPath(...paths)`
+
+Returns the nearest (deepest) common ancestor path, or `null` if on
+different roots on Windows.
diff --git a/node_modules/common-ancestor-path/index.js b/node_modules/common-ancestor-path/index.js
new file mode 100644
index 000000000..09ae31782
--- /dev/null
+++ b/node_modules/common-ancestor-path/index.js
@@ -0,0 +1,17 @@
+const {parse, sep, normalize: norm} = require('path')
+
+function* commonArrayMembers (a, b) {
+ const [l, s] = a.length > b.length ? [a, b] : [b, a]
+ for (const x of s) {
+ if (x === l.shift())
+ yield x
+ else
+ break
+ }
+}
+
+const commonAncestorPath = (a, b) => a === b ? a
+ : parse(a).root !== parse(b).root ? null
+ : [...commonArrayMembers(norm(a).split(sep), norm(b).split(sep))].join(sep)
+
+module.exports = (...paths) => paths.reduce(commonAncestorPath)
diff --git a/node_modules/common-ancestor-path/package.json b/node_modules/common-ancestor-path/package.json
new file mode 100644
index 000000000..d455f3bc1
--- /dev/null
+++ b/node_modules/common-ancestor-path/package.json
@@ -0,0 +1,61 @@
+{
+ "_from": "common-ancestor-path@^1.0.1",
+ "_id": "common-ancestor-path@1.0.1",
+ "_inBundle": false,
+ "_integrity": "sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==",
+ "_location": "/common-ancestor-path",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "common-ancestor-path@^1.0.1",
+ "name": "common-ancestor-path",
+ "escapedName": "common-ancestor-path",
+ "rawSpec": "^1.0.1",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.1"
+ },
+ "_requiredBy": [
+ "/@npmcli/arborist"
+ ],
+ "_resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz",
+ "_shasum": "4f7d2d1394d91b7abdf51871c62f71eadb0182a7",
+ "_spec": "common-ancestor-path@^1.0.1",
+ "_where": "/Users/isaacs/dev/npm/cli/node_modules/@npmcli/arborist",
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "https://izs.me"
+ },
+ "bugs": {
+ "url": "https://github.com/isaacs/common-ancestor-path/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Find the common ancestor of 2 or more paths on Windows or Unix",
+ "devDependencies": {
+ "require-inject": "^1.4.4",
+ "tap": "^14.10.7"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/isaacs/common-ancestor-path#readme",
+ "license": "ISC",
+ "name": "common-ancestor-path",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/isaacs/common-ancestor-path.git"
+ },
+ "scripts": {
+ "postversion": "npm publish",
+ "prepublishOnly": "git push origin --follow-tags",
+ "preversion": "npm test",
+ "snap": "tap",
+ "test": "tap"
+ },
+ "tap": {
+ "check-coverage": true
+ },
+ "version": "1.0.1"
+}