415gotit
This commit is contained in:
34
node_modules/@msgpack/msgpack/dist.cjs/utils/int.cjs
generated
vendored
Normal file
34
node_modules/@msgpack/msgpack/dist.cjs/utils/int.cjs
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
// Integer Utility
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.UINT32_MAX = void 0;
|
||||
exports.setUint64 = setUint64;
|
||||
exports.setInt64 = setInt64;
|
||||
exports.getInt64 = getInt64;
|
||||
exports.getUint64 = getUint64;
|
||||
exports.UINT32_MAX = 4294967295;
|
||||
// DataView extension to handle int64 / uint64,
|
||||
// where the actual range is 53-bits integer (a.k.a. safe integer)
|
||||
function setUint64(view, offset, value) {
|
||||
const high = value / 4294967296;
|
||||
const low = value; // high bits are truncated by DataView
|
||||
view.setUint32(offset, high);
|
||||
view.setUint32(offset + 4, low);
|
||||
}
|
||||
function setInt64(view, offset, value) {
|
||||
const high = Math.floor(value / 4294967296);
|
||||
const low = value; // high bits are truncated by DataView
|
||||
view.setUint32(offset, high);
|
||||
view.setUint32(offset + 4, low);
|
||||
}
|
||||
function getInt64(view, offset) {
|
||||
const high = view.getInt32(offset);
|
||||
const low = view.getUint32(offset + 4);
|
||||
return high * 4294967296 + low;
|
||||
}
|
||||
function getUint64(view, offset) {
|
||||
const high = view.getUint32(offset);
|
||||
const low = view.getUint32(offset + 4);
|
||||
return high * 4294967296 + low;
|
||||
}
|
||||
//# sourceMappingURL=int.cjs.map
|
||||
1
node_modules/@msgpack/msgpack/dist.cjs/utils/int.cjs.map
generated
vendored
Normal file
1
node_modules/@msgpack/msgpack/dist.cjs/utils/int.cjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"intcjs","sourceRoot":"","sources":["../../src/utils/int.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;;;;;AAEL,QAAA,UAAU,GAAG,UAAW,CAAC;AAEtC,+CAA+C;AAC/C,kEAAkE;AAElE,mBAA0B,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0 +1,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.prettyByte = prettyByte;
|
||||
function prettyByte(byte) {
|
||||
return `${byte < 0 ? "-" : ""}0x${Math.abs(byte).toString(16).padStart(2, "0")}`;
|
||||
}
|
||||
//# sourceMappingURL=prettyByte.cjs.map
|
||||
1
node_modules/@msgpack/msgpack/dist.cjs/utils/prettyByte.cjs.map
generated
vendored
Normal file
1
node_modules/@msgpack/msgpack/dist.cjs/utils/prettyByte.cjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"prettyBytecjs","sourceRoot":"","sources":["../../src/utils/prettyByte.ts"],"names":[],"mappings":";;;AAAA,oBAA2B,IAAY,EAAU;IAC/C,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AAAA,CAClF"}
|
||||
33
node_modules/@msgpack/msgpack/dist.cjs/utils/stream.cjs
generated
vendored
Normal file
33
node_modules/@msgpack/msgpack/dist.cjs/utils/stream.cjs
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
// utility for whatwg streams
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isAsyncIterable = isAsyncIterable;
|
||||
exports.asyncIterableFromStream = asyncIterableFromStream;
|
||||
exports.ensureAsyncIterable = ensureAsyncIterable;
|
||||
function isAsyncIterable(object) {
|
||||
return object[Symbol.asyncIterator] != null;
|
||||
}
|
||||
async function* asyncIterableFromStream(stream) {
|
||||
const reader = stream.getReader();
|
||||
try {
|
||||
while (true) {
|
||||
const { done, value } = await reader.read();
|
||||
if (done) {
|
||||
return;
|
||||
}
|
||||
yield value;
|
||||
}
|
||||
}
|
||||
finally {
|
||||
reader.releaseLock();
|
||||
}
|
||||
}
|
||||
function ensureAsyncIterable(streamLike) {
|
||||
if (isAsyncIterable(streamLike)) {
|
||||
return streamLike;
|
||||
}
|
||||
else {
|
||||
return asyncIterableFromStream(streamLike);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=stream.cjs.map
|
||||
1
node_modules/@msgpack/msgpack/dist.cjs/utils/stream.cjs.map
generated
vendored
Normal file
1
node_modules/@msgpack/msgpack/dist.cjs/utils/stream.cjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"streamcjs","sourceRoot":"","sources":["../../src/utils/stream.ts"],"names":[],"mappings":";AAAA,6BAA6B;;;;;AAQ7B,yBAAmC,MAA6B,EAA8B;IAC5F,OAAQ,MAAc,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC;AAAA,CACtD;AAEM,KAAK,SAAS,CAAC,yBAA4B,MAAyB,EAAoB;IAC7F,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;IAElC,IAAI,CAAC;QACH,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YAC5C,IAAI,IAAI,EAAE,CAAC;gBACT,OAAO;YACT,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;AAAA,CACF;AAED,6BAAuC,UAAiC,EAAoB;IAC1F,IAAI,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC;QAChC,OAAO,UAAU,CAAC;IACpB,CAAC;SAAM,CAAC;QACN,OAAO,uBAAuB,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;AAAA,CACF"}
|
||||
22
node_modules/@msgpack/msgpack/dist.cjs/utils/typedArrays.cjs
generated
vendored
Normal file
22
node_modules/@msgpack/msgpack/dist.cjs/utils/typedArrays.cjs
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ensureUint8Array = ensureUint8Array;
|
||||
function isArrayBufferLike(buffer) {
|
||||
return (buffer instanceof ArrayBuffer || (typeof SharedArrayBuffer !== "undefined" && buffer instanceof SharedArrayBuffer));
|
||||
}
|
||||
function ensureUint8Array(buffer) {
|
||||
if (buffer instanceof Uint8Array) {
|
||||
return buffer;
|
||||
}
|
||||
else if (ArrayBuffer.isView(buffer)) {
|
||||
return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
||||
}
|
||||
else if (isArrayBufferLike(buffer)) {
|
||||
return new Uint8Array(buffer);
|
||||
}
|
||||
else {
|
||||
// ArrayLike<number>
|
||||
return Uint8Array.from(buffer);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=typedArrays.cjs.map
|
||||
1
node_modules/@msgpack/msgpack/dist.cjs/utils/typedArrays.cjs.map
generated
vendored
Normal file
1
node_modules/@msgpack/msgpack/dist.cjs/utils/typedArrays.cjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"typedArrayscjs","sourceRoot":"","sources":["../../src/utils/typedArrays.ts"],"names":[],"mappings":";;;AAAA,SAAS,iBAAiB,CAAC,MAAe,EAA6B;IACrE,OAAO,CACL,MAAM,YAAY,WAAW,IAAI,CAAC,OAAO,iBAAiB,KAAK,WAAW,IAAI,MAAM,YAAY,iBAAiB,CAAC,CACnH,CAAC;AAAA,CACH;AAED,0BACE,MAA2F,EAC9D;IAC7B,IAAI,MAAM,YAAY,UAAU,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC;IAChB,CAAC;SAAM,IAAI,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC7E,CAAC;SAAM,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QACrC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;SAAM,CAAC;QACN,oBAAoB;QACpB,OAAO,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;AAAA,CACF"}
|
||||
177
node_modules/@msgpack/msgpack/dist.cjs/utils/utf8.cjs
generated
vendored
Normal file
177
node_modules/@msgpack/msgpack/dist.cjs/utils/utf8.cjs
generated
vendored
Normal file
@@ -0,0 +1,177 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.utf8Count = utf8Count;
|
||||
exports.utf8EncodeJs = utf8EncodeJs;
|
||||
exports.utf8EncodeTE = utf8EncodeTE;
|
||||
exports.utf8Encode = utf8Encode;
|
||||
exports.utf8DecodeJs = utf8DecodeJs;
|
||||
exports.utf8DecodeTD = utf8DecodeTD;
|
||||
exports.utf8Decode = utf8Decode;
|
||||
function utf8Count(str) {
|
||||
const strLength = str.length;
|
||||
let byteLength = 0;
|
||||
let pos = 0;
|
||||
while (pos < strLength) {
|
||||
let value = str.charCodeAt(pos++);
|
||||
if ((value & 0xffffff80) === 0) {
|
||||
// 1-byte
|
||||
byteLength++;
|
||||
continue;
|
||||
}
|
||||
else if ((value & 0xfffff800) === 0) {
|
||||
// 2-bytes
|
||||
byteLength += 2;
|
||||
}
|
||||
else {
|
||||
// handle surrogate pair
|
||||
if (value >= 0xd800 && value <= 0xdbff) {
|
||||
// high surrogate
|
||||
if (pos < strLength) {
|
||||
const extra = str.charCodeAt(pos);
|
||||
if ((extra & 0xfc00) === 0xdc00) {
|
||||
++pos;
|
||||
value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((value & 0xffff0000) === 0) {
|
||||
// 3-byte
|
||||
byteLength += 3;
|
||||
}
|
||||
else {
|
||||
// 4-byte
|
||||
byteLength += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
return byteLength;
|
||||
}
|
||||
function utf8EncodeJs(str, output, outputOffset) {
|
||||
const strLength = str.length;
|
||||
let offset = outputOffset;
|
||||
let pos = 0;
|
||||
while (pos < strLength) {
|
||||
let value = str.charCodeAt(pos++);
|
||||
if ((value & 0xffffff80) === 0) {
|
||||
// 1-byte
|
||||
output[offset++] = value;
|
||||
continue;
|
||||
}
|
||||
else if ((value & 0xfffff800) === 0) {
|
||||
// 2-bytes
|
||||
output[offset++] = ((value >> 6) & 0x1f) | 0xc0;
|
||||
}
|
||||
else {
|
||||
// handle surrogate pair
|
||||
if (value >= 0xd800 && value <= 0xdbff) {
|
||||
// high surrogate
|
||||
if (pos < strLength) {
|
||||
const extra = str.charCodeAt(pos);
|
||||
if ((extra & 0xfc00) === 0xdc00) {
|
||||
++pos;
|
||||
value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((value & 0xffff0000) === 0) {
|
||||
// 3-byte
|
||||
output[offset++] = ((value >> 12) & 0x0f) | 0xe0;
|
||||
output[offset++] = ((value >> 6) & 0x3f) | 0x80;
|
||||
}
|
||||
else {
|
||||
// 4-byte
|
||||
output[offset++] = ((value >> 18) & 0x07) | 0xf0;
|
||||
output[offset++] = ((value >> 12) & 0x3f) | 0x80;
|
||||
output[offset++] = ((value >> 6) & 0x3f) | 0x80;
|
||||
}
|
||||
}
|
||||
output[offset++] = (value & 0x3f) | 0x80;
|
||||
}
|
||||
}
|
||||
// TextEncoder and TextDecoder are standardized in whatwg encoding:
|
||||
// https://encoding.spec.whatwg.org/
|
||||
// and available in all the modern browsers:
|
||||
// https://caniuse.com/textencoder
|
||||
// They are available in Node.js since v12 LTS as well:
|
||||
// https://nodejs.org/api/globals.html#textencoder
|
||||
const sharedTextEncoder = new TextEncoder();
|
||||
// This threshold should be determined by benchmarking, which might vary in engines and input data.
|
||||
// Run `npx ts-node benchmark/encode-string.ts` for details.
|
||||
const TEXT_ENCODER_THRESHOLD = 50;
|
||||
function utf8EncodeTE(str, output, outputOffset) {
|
||||
sharedTextEncoder.encodeInto(str, output.subarray(outputOffset));
|
||||
}
|
||||
function utf8Encode(str, output, outputOffset) {
|
||||
if (str.length > TEXT_ENCODER_THRESHOLD) {
|
||||
utf8EncodeTE(str, output, outputOffset);
|
||||
}
|
||||
else {
|
||||
utf8EncodeJs(str, output, outputOffset);
|
||||
}
|
||||
}
|
||||
const CHUNK_SIZE = 4096;
|
||||
function utf8DecodeJs(bytes, inputOffset, byteLength) {
|
||||
let offset = inputOffset;
|
||||
const end = offset + byteLength;
|
||||
const units = [];
|
||||
let result = "";
|
||||
while (offset < end) {
|
||||
const byte1 = bytes[offset++];
|
||||
if ((byte1 & 0x80) === 0) {
|
||||
// 1 byte
|
||||
units.push(byte1);
|
||||
}
|
||||
else if ((byte1 & 0xe0) === 0xc0) {
|
||||
// 2 bytes
|
||||
const byte2 = bytes[offset++] & 0x3f;
|
||||
units.push(((byte1 & 0x1f) << 6) | byte2);
|
||||
}
|
||||
else if ((byte1 & 0xf0) === 0xe0) {
|
||||
// 3 bytes
|
||||
const byte2 = bytes[offset++] & 0x3f;
|
||||
const byte3 = bytes[offset++] & 0x3f;
|
||||
units.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3);
|
||||
}
|
||||
else if ((byte1 & 0xf8) === 0xf0) {
|
||||
// 4 bytes
|
||||
const byte2 = bytes[offset++] & 0x3f;
|
||||
const byte3 = bytes[offset++] & 0x3f;
|
||||
const byte4 = bytes[offset++] & 0x3f;
|
||||
let unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4;
|
||||
if (unit > 0xffff) {
|
||||
unit -= 0x10000;
|
||||
units.push(((unit >>> 10) & 0x3ff) | 0xd800);
|
||||
unit = 0xdc00 | (unit & 0x3ff);
|
||||
}
|
||||
units.push(unit);
|
||||
}
|
||||
else {
|
||||
units.push(byte1);
|
||||
}
|
||||
if (units.length >= CHUNK_SIZE) {
|
||||
result += String.fromCharCode(...units);
|
||||
units.length = 0;
|
||||
}
|
||||
}
|
||||
if (units.length > 0) {
|
||||
result += String.fromCharCode(...units);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
const sharedTextDecoder = new TextDecoder();
|
||||
// This threshold should be determined by benchmarking, which might vary in engines and input data.
|
||||
// Run `npx ts-node benchmark/decode-string.ts` for details.
|
||||
const TEXT_DECODER_THRESHOLD = 200;
|
||||
function utf8DecodeTD(bytes, inputOffset, byteLength) {
|
||||
const stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength);
|
||||
return sharedTextDecoder.decode(stringBytes);
|
||||
}
|
||||
function utf8Decode(bytes, inputOffset, byteLength) {
|
||||
if (byteLength > TEXT_DECODER_THRESHOLD) {
|
||||
return utf8DecodeTD(bytes, inputOffset, byteLength);
|
||||
}
|
||||
else {
|
||||
return utf8DecodeJs(bytes, inputOffset, byteLength);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=utf8.cjs.map
|
||||
1
node_modules/@msgpack/msgpack/dist.cjs/utils/utf8.cjs.map
generated
vendored
Normal file
1
node_modules/@msgpack/msgpack/dist.cjs/utils/utf8.cjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user