mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-17 04:26:00 +00:00
Modules
This commit is contained in:
26
node_modules/@protobufjs/base64/LICENSE
generated
vendored
Normal file
26
node_modules/@protobufjs/base64/LICENSE
generated
vendored
Normal file
@ -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.
|
19
node_modules/@protobufjs/base64/README.md
generated
vendored
Normal file
19
node_modules/@protobufjs/base64/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
@protobufjs/base64
|
||||
==================
|
||||
[](https://www.npmjs.com/package/@protobufjs/base64)
|
||||
|
||||
A minimal base64 implementation for number arrays.
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
* **base64.length(string: `string`): `number`**<br />
|
||||
Calculates the byte length of a base64 encoded string.
|
||||
|
||||
* **base64.encode(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**<br />
|
||||
Encodes a buffer to a base64 encoded string.
|
||||
|
||||
* **base64.decode(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**<br />
|
||||
Decodes a base64 encoded string to a buffer.
|
||||
|
||||
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
32
node_modules/@protobufjs/base64/index.d.ts
generated
vendored
Normal file
32
node_modules/@protobufjs/base64/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Calculates the byte length of a base64 encoded string.
|
||||
* @param {string} string Base64 encoded string
|
||||
* @returns {number} Byte length
|
||||
*/
|
||||
export function length(string: string): number;
|
||||
|
||||
/**
|
||||
* Encodes a buffer to a base64 encoded string.
|
||||
* @param {Uint8Array} buffer Source buffer
|
||||
* @param {number} start Source start
|
||||
* @param {number} end Source end
|
||||
* @returns {string} Base64 encoded string
|
||||
*/
|
||||
export function encode(buffer: Uint8Array, start: number, end: number): string;
|
||||
|
||||
/**
|
||||
* Decodes a base64 encoded string to a buffer.
|
||||
* @param {string} string Source string
|
||||
* @param {Uint8Array} buffer Destination buffer
|
||||
* @param {number} offset Destination offset
|
||||
* @returns {number} Number of bytes written
|
||||
* @throws {Error} If encoding is invalid
|
||||
*/
|
||||
export function decode(string: string, buffer: Uint8Array, offset: number): number;
|
||||
|
||||
/**
|
||||
* Tests if the specified string appears to be base64 encoded.
|
||||
* @param {string} string String to test
|
||||
* @returns {boolean} `true` if it appears to be base64 encoded, otherwise false
|
||||
*/
|
||||
export function test(string: string): boolean;
|
139
node_modules/@protobufjs/base64/index.js
generated
vendored
Normal file
139
node_modules/@protobufjs/base64/index.js
generated
vendored
Normal file
@ -0,0 +1,139 @@
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* A minimal base64 implementation for number arrays.
|
||||
* @memberof util
|
||||
* @namespace
|
||||
*/
|
||||
var base64 = exports;
|
||||
|
||||
/**
|
||||
* Calculates the byte length of a base64 encoded string.
|
||||
* @param {string} string Base64 encoded string
|
||||
* @returns {number} Byte length
|
||||
*/
|
||||
base64.length = function length(string) {
|
||||
var p = string.length;
|
||||
if (!p)
|
||||
return 0;
|
||||
var n = 0;
|
||||
while (--p % 4 > 1 && string.charAt(p) === "=")
|
||||
++n;
|
||||
return Math.ceil(string.length * 3) / 4 - n;
|
||||
};
|
||||
|
||||
// Base64 encoding table
|
||||
var b64 = new Array(64);
|
||||
|
||||
// Base64 decoding table
|
||||
var s64 = new Array(123);
|
||||
|
||||
// 65..90, 97..122, 48..57, 43, 47
|
||||
for (var i = 0; i < 64;)
|
||||
s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;
|
||||
|
||||
/**
|
||||
* Encodes a buffer to a base64 encoded string.
|
||||
* @param {Uint8Array} buffer Source buffer
|
||||
* @param {number} start Source start
|
||||
* @param {number} end Source end
|
||||
* @returns {string} Base64 encoded string
|
||||
*/
|
||||
base64.encode = function encode(buffer, start, end) {
|
||||
var parts = null,
|
||||
chunk = [];
|
||||
var i = 0, // output index
|
||||
j = 0, // goto index
|
||||
t; // temporary
|
||||
while (start < end) {
|
||||
var b = buffer[start++];
|
||||
switch (j) {
|
||||
case 0:
|
||||
chunk[i++] = b64[b >> 2];
|
||||
t = (b & 3) << 4;
|
||||
j = 1;
|
||||
break;
|
||||
case 1:
|
||||
chunk[i++] = b64[t | b >> 4];
|
||||
t = (b & 15) << 2;
|
||||
j = 2;
|
||||
break;
|
||||
case 2:
|
||||
chunk[i++] = b64[t | b >> 6];
|
||||
chunk[i++] = b64[b & 63];
|
||||
j = 0;
|
||||
break;
|
||||
}
|
||||
if (i > 8191) {
|
||||
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
if (j) {
|
||||
chunk[i++] = b64[t];
|
||||
chunk[i++] = 61;
|
||||
if (j === 1)
|
||||
chunk[i++] = 61;
|
||||
}
|
||||
if (parts) {
|
||||
if (i)
|
||||
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
||||
return parts.join("");
|
||||
}
|
||||
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
||||
};
|
||||
|
||||
var invalidEncoding = "invalid encoding";
|
||||
|
||||
/**
|
||||
* Decodes a base64 encoded string to a buffer.
|
||||
* @param {string} string Source string
|
||||
* @param {Uint8Array} buffer Destination buffer
|
||||
* @param {number} offset Destination offset
|
||||
* @returns {number} Number of bytes written
|
||||
* @throws {Error} If encoding is invalid
|
||||
*/
|
||||
base64.decode = function decode(string, buffer, offset) {
|
||||
var start = offset;
|
||||
var j = 0, // goto index
|
||||
t; // temporary
|
||||
for (var i = 0; i < string.length;) {
|
||||
var c = string.charCodeAt(i++);
|
||||
if (c === 61 && j > 1)
|
||||
break;
|
||||
if ((c = s64[c]) === undefined)
|
||||
throw Error(invalidEncoding);
|
||||
switch (j) {
|
||||
case 0:
|
||||
t = c;
|
||||
j = 1;
|
||||
break;
|
||||
case 1:
|
||||
buffer[offset++] = t << 2 | (c & 48) >> 4;
|
||||
t = c;
|
||||
j = 2;
|
||||
break;
|
||||
case 2:
|
||||
buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;
|
||||
t = c;
|
||||
j = 3;
|
||||
break;
|
||||
case 3:
|
||||
buffer[offset++] = (t & 3) << 6 | c;
|
||||
j = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j === 1)
|
||||
throw Error(invalidEncoding);
|
||||
return offset - start;
|
||||
};
|
||||
|
||||
/**
|
||||
* Tests if the specified string appears to be base64 encoded.
|
||||
* @param {string} string String to test
|
||||
* @returns {boolean} `true` if probably base64 encoded, otherwise false
|
||||
*/
|
||||
base64.test = function test(string) {
|
||||
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);
|
||||
};
|
57
node_modules/@protobufjs/base64/package.json
generated
vendored
Normal file
57
node_modules/@protobufjs/base64/package.json
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@protobufjs/base64@1.1.2",
|
||||
"C:\\Users\\matia\\Musix"
|
||||
]
|
||||
],
|
||||
"_from": "@protobufjs/base64@1.1.2",
|
||||
"_id": "@protobufjs/base64@1.1.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",
|
||||
"_location": "/@protobufjs/base64",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@protobufjs/base64@1.1.2",
|
||||
"name": "@protobufjs/base64",
|
||||
"escapedName": "@protobufjs%2fbase64",
|
||||
"scope": "@protobufjs",
|
||||
"rawSpec": "1.1.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/protobufjs"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
|
||||
"_spec": "1.1.2",
|
||||
"_where": "C:\\Users\\matia\\Musix",
|
||||
"author": {
|
||||
"name": "Daniel Wirtz",
|
||||
"email": "dcode+protobufjs@dcode.io"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/dcodeIO/protobuf.js/issues"
|
||||
},
|
||||
"description": "A minimal base64 implementation for number arrays.",
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.4.5",
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"homepage": "https://github.com/dcodeIO/protobuf.js#readme",
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "index.js",
|
||||
"name": "@protobufjs/base64",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/dcodeIO/protobuf.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js",
|
||||
"test": "tape tests/*.js"
|
||||
},
|
||||
"types": "index.d.ts",
|
||||
"version": "1.1.2"
|
||||
}
|
46
node_modules/@protobufjs/base64/tests/index.js
generated
vendored
Normal file
46
node_modules/@protobufjs/base64/tests/index.js
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
var tape = require("tape");
|
||||
|
||||
var base64 = require("..");
|
||||
|
||||
var strings = {
|
||||
"": "",
|
||||
"a": "YQ==",
|
||||
"ab": "YWI=",
|
||||
"abcdefg": "YWJjZGVmZw==",
|
||||
"abcdefgh": "YWJjZGVmZ2g=",
|
||||
"abcdefghi": "YWJjZGVmZ2hp"
|
||||
};
|
||||
|
||||
tape.test("base64", function(test) {
|
||||
|
||||
Object.keys(strings).forEach(function(str) {
|
||||
var enc = strings[str];
|
||||
|
||||
test.equal(base64.test(enc), true, "should detect '" + enc + "' to be base64 encoded");
|
||||
|
||||
var len = base64.length(enc);
|
||||
test.equal(len, str.length, "should calculate '" + enc + "' as " + str.length + " bytes");
|
||||
|
||||
var buf = new Array(len);
|
||||
var len2 = base64.decode(enc, buf, 0);
|
||||
test.equal(len2, len, "should decode '" + enc + "' to " + len + " bytes");
|
||||
|
||||
test.equal(String.fromCharCode.apply(String, buf), str, "should decode '" + enc + "' to '" + str + "'");
|
||||
|
||||
var enc2 = base64.encode(buf, 0, buf.length);
|
||||
test.equal(enc2, enc, "should encode '" + str + "' to '" + enc + "'");
|
||||
|
||||
});
|
||||
|
||||
test.throws(function() {
|
||||
var buf = new Array(10);
|
||||
base64.decode("YQ!", buf, 0);
|
||||
}, Error, "should throw if encoding is invalid");
|
||||
|
||||
test.throws(function() {
|
||||
var buf = new Array(10);
|
||||
base64.decode("Y", buf, 0);
|
||||
}, Error, "should throw if string is truncated");
|
||||
|
||||
test.end();
|
||||
});
|
Reference in New Issue
Block a user