diff options
Diffstat (limited to 'frontend-old/node_modules/@protobufjs/path')
6 files changed, 213 insertions, 0 deletions
diff --git a/frontend-old/node_modules/@protobufjs/path/LICENSE b/frontend-old/node_modules/@protobufjs/path/LICENSE new file mode 100644 index 0000000..2a2d560 --- /dev/null +++ b/frontend-old/node_modules/@protobufjs/path/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2016, Daniel Wirtz All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of its author, nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/frontend-old/node_modules/@protobufjs/path/README.md b/frontend-old/node_modules/@protobufjs/path/README.md new file mode 100644 index 0000000..0e8e6bc --- /dev/null +++ b/frontend-old/node_modules/@protobufjs/path/README.md @@ -0,0 +1,19 @@ +@protobufjs/path
+================
+[](https://www.npmjs.com/package/@protobufjs/path)
+
+A minimal path module to resolve Unix, Windows and URL paths alike.
+
+API
+---
+
+* **path.isAbsolute(path: `string`): `boolean`**<br />
+ Tests if the specified path is absolute.
+
+* **path.normalize(path: `string`): `string`**<br />
+ Normalizes the specified path.
+
+* **path.resolve(originPath: `string`, includePath: `string`, [alreadyNormalized=false: `boolean`]): `string`**<br />
+ Resolves the specified include path against the specified origin path.
+
+**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
diff --git a/frontend-old/node_modules/@protobufjs/path/index.d.ts b/frontend-old/node_modules/@protobufjs/path/index.d.ts new file mode 100644 index 0000000..567c3dc --- /dev/null +++ b/frontend-old/node_modules/@protobufjs/path/index.d.ts @@ -0,0 +1,22 @@ +/**
+ * Tests if the specified path is absolute.
+ * @param {string} path Path to test
+ * @returns {boolean} `true` if path is absolute
+ */
+export function isAbsolute(path: string): boolean;
+
+/**
+ * Normalizes the specified path.
+ * @param {string} path Path to normalize
+ * @returns {string} Normalized path
+ */
+export function normalize(path: string): string;
+
+/**
+ * Resolves the specified include path against the specified origin path.
+ * @param {string} originPath Path to the origin file
+ * @param {string} includePath Include path relative to origin path
+ * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized
+ * @returns {string} Path to the include file
+ */
+export function resolve(originPath: string, includePath: string, alreadyNormalized?: boolean): string;
diff --git a/frontend-old/node_modules/@protobufjs/path/index.js b/frontend-old/node_modules/@protobufjs/path/index.js new file mode 100644 index 0000000..1ea7b17 --- /dev/null +++ b/frontend-old/node_modules/@protobufjs/path/index.js @@ -0,0 +1,65 @@ +"use strict";
+
+/**
+ * A minimal path module to resolve Unix, Windows and URL paths alike.
+ * @memberof util
+ * @namespace
+ */
+var path = exports;
+
+var isAbsolute =
+/**
+ * Tests if the specified path is absolute.
+ * @param {string} path Path to test
+ * @returns {boolean} `true` if path is absolute
+ */
+path.isAbsolute = function isAbsolute(path) {
+ return /^(?:\/|\w+:)/.test(path);
+};
+
+var normalize =
+/**
+ * Normalizes the specified path.
+ * @param {string} path Path to normalize
+ * @returns {string} Normalized path
+ */
+path.normalize = function normalize(path) {
+ path = path.replace(/\\/g, "/")
+ .replace(/\/{2,}/g, "/");
+ var parts = path.split("/"),
+ absolute = isAbsolute(path),
+ prefix = "";
+ if (absolute)
+ prefix = parts.shift() + "/";
+ for (var i = 0; i < parts.length;) {
+ if (parts[i] === "..") {
+ if (i > 0 && parts[i - 1] !== "..")
+ parts.splice(--i, 2);
+ else if (absolute)
+ parts.splice(i, 1);
+ else
+ ++i;
+ } else if (parts[i] === ".")
+ parts.splice(i, 1);
+ else
+ ++i;
+ }
+ return prefix + parts.join("/");
+};
+
+/**
+ * Resolves the specified include path against the specified origin path.
+ * @param {string} originPath Path to the origin file
+ * @param {string} includePath Include path relative to origin path
+ * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized
+ * @returns {string} Path to the include file
+ */
+path.resolve = function resolve(originPath, includePath, alreadyNormalized) {
+ if (!alreadyNormalized)
+ includePath = normalize(includePath);
+ if (isAbsolute(includePath))
+ return includePath;
+ if (!alreadyNormalized)
+ originPath = normalize(originPath);
+ return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath;
+};
diff --git a/frontend-old/node_modules/@protobufjs/path/package.json b/frontend-old/node_modules/@protobufjs/path/package.json new file mode 100644 index 0000000..ae0808a --- /dev/null +++ b/frontend-old/node_modules/@protobufjs/path/package.json @@ -0,0 +1,21 @@ +{
+ "name": "@protobufjs/path",
+ "description": "A minimal path module to resolve Unix, Windows and URL paths alike.",
+ "version": "1.1.2",
+ "author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/dcodeIO/protobuf.js.git"
+ },
+ "license": "BSD-3-Clause",
+ "main": "index.js",
+ "types": "index.d.ts",
+ "devDependencies": {
+ "istanbul": "^0.4.5",
+ "tape": "^4.6.3"
+ },
+ "scripts": {
+ "test": "tape tests/*.js",
+ "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js"
+ }
+}
\ No newline at end of file diff --git a/frontend-old/node_modules/@protobufjs/path/tests/index.js b/frontend-old/node_modules/@protobufjs/path/tests/index.js new file mode 100644 index 0000000..927736e --- /dev/null +++ b/frontend-old/node_modules/@protobufjs/path/tests/index.js @@ -0,0 +1,60 @@ +var tape = require("tape");
+
+var path = require("..");
+
+tape.test("path", function(test) {
+
+ test.ok(path.isAbsolute("X:\\some\\path\\file.js"), "should identify absolute windows paths");
+ test.ok(path.isAbsolute("/some/path/file.js"), "should identify absolute unix paths");
+
+ test.notOk(path.isAbsolute("some\\path\\file.js"), "should identify relative windows paths");
+ test.notOk(path.isAbsolute("some/path/file.js"), "should identify relative unix paths");
+
+ var paths = [
+ {
+ actual: "X:\\some\\..\\.\\path\\\\file.js",
+ normal: "X:/path/file.js",
+ resolve: {
+ origin: "X:/path/origin.js",
+ expected: "X:/path/file.js"
+ }
+ }, {
+ actual: "some\\..\\.\\path\\\\file.js",
+ normal: "path/file.js",
+ resolve: {
+ origin: "X:/path/origin.js",
+ expected: "X:/path/path/file.js"
+ }
+ }, {
+ actual: "/some/.././path//file.js",
+ normal: "/path/file.js",
+ resolve: {
+ origin: "/path/origin.js",
+ expected: "/path/file.js"
+ }
+ }, {
+ actual: "some/.././path//file.js",
+ normal: "path/file.js",
+ resolve: {
+ origin: "",
+ expected: "path/file.js"
+ }
+ }, {
+ actual: ".././path//file.js",
+ normal: "../path/file.js"
+ }, {
+ actual: "/.././path//file.js",
+ normal: "/path/file.js"
+ }
+ ];
+
+ paths.forEach(function(p) {
+ test.equal(path.normalize(p.actual), p.normal, "should normalize " + p.actual);
+ if (p.resolve) {
+ test.equal(path.resolve(p.resolve.origin, p.actual), p.resolve.expected, "should resolve " + p.actual);
+ test.equal(path.resolve(p.resolve.origin, p.normal, true), p.resolve.expected, "should resolve " + p.normal + " (already normalized)");
+ }
+ });
+
+ test.end();
+});
|
