Initial commit: notification-elements-demo app

Interactive Angular 19 demo for @sda/notification-elements-ui with
6 sections: Bell & Feed, Notification Center, Inbox, Comments &
Threads, Mention Input, and Full-Featured layout. Includes mock
data, dark mode toggle, and real-time event log.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Giuliano Silvestro
2026-02-13 21:49:19 +10:00
commit 5d0c9ec7eb
36473 changed files with 3778146 additions and 0 deletions

201
node_modules/@jsonjoy.com/base64/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2024 jsonjoy.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

93
node_modules/@jsonjoy.com/base64/README.md generated vendored Normal file
View File

@@ -0,0 +1,93 @@
# Base64
Fast Base64 encoder and decoder for browser and Node.js.
## Encoder
- Implements Base64 encoding algorithm compatible with Node's Buffer.
- Isomorphic&mdash;it can be used in, both, Node and the browser.
- Faster than the Node's implementation for short blobs, smaller than 40 bytes.
- Uses Node's implementation for long blobs, if available. Hence, it also works
in browser, but in Node environment will perform faster for short strings.
- Can encode into Base64 text or Base64 `Uint8Array`.
### Usage
Use encoder compatible with Node's Buffer:
```ts
import {toBase64} from '@jsonjoy.com/base64';
toBase64(new Uint8Array([1, 2, 3]));
```
Create your custom encoder:
```ts
import {createToBase64} from '@jsonjoy.com/base64';
const encode = createToBase64('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+_');
encode(new Uint8Array([1, 2, 3]));
```
### Benchmark
Below benchmark encodes random binary blobs of sizes 8, 16, 32, 64, 128, 256, 512, and 1024 byes.
`@jsonjoy.com/base64` is faster, because for short strings (less than 40 chars) it uses a
native JavaScript implementation, which is faster and also works in browsers. For blobs larger
than 40 chars, it falls back to Node `Buffer` implementation, if available.
Encoding:
```
node src/__bench__/encode.js
util/base64 toBase64(uint8) x 1,531,283 ops/sec ±0.30% (92 runs sampled), 653 ns/op
util/base64 createToBase64()(uint8) x 946,364 ops/sec ±0.76% (100 runs sampled), 1057 ns/op
js-base64 x 1,103,190 ops/sec ±1.27% (96 runs sampled), 906 ns/op
fast-base64-encode x 500,225 ops/sec ±0.64% (96 runs sampled), 1999 ns/op
base64-js x 328,368 ops/sec ±0.25% (95 runs sampled), 3045 ns/op
Buffer.from(uint8).toString('base64'); x 1,099,420 ops/sec ±0.20% (100 runs sampled), 910 ns/op
Fastest is util/base64 toBase64(uint8)
```
Decoding:
```
node src/__bench__/decode.js
@jsonjoy.com/base64 fromBase64(str) x 756,989 ops/sec ±0.46% (97 runs sampled), 1321 ns/op
@jsonjoy.com/base64 createFromBase64()(str) x 475,591 ops/sec ±0.37% (96 runs sampled), 2103 ns/op
Buffer.from(str, 'base64') x 545,012 ops/sec ±0.33% (101 runs sampled), 1835 ns/op
base64-js x 487,015 ops/sec ±1.19% (94 runs sampled), 2053 ns/op
js-base64 x 173,049 ops/sec ±0.20% (99 runs sampled), 5779 ns/op
Fastest is @jsonjoy.com/base64 fromBase64(str)
```
## Decoder
- Uses Node.js built-in `Buffer`, if available.
- When `Buffer` is not available, uses JavaScript implementation.
### Usage
Use decoder compatible with Node's Buffer:
```ts
import {toBase64, fromBase64} from '@jsonjoy.com/base64';
fromBase64(toBase64(new Uint8Array([1, 2, 3])));
```
Create your custom encoder:
```ts
import {createFromBase64} from '@jsonjoy.com/base64';
const decoder = createFromBase64('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+_');
decoder(toBase64(new Uint8Array([1, 2, 3])));
```

2
node_modules/@jsonjoy.com/base64/lib/constants.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
export declare const hasBuffer: boolean;

6
node_modules/@jsonjoy.com/base64/lib/constants.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasBuffer = exports.alphabet = void 0;
exports.alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
exports.hasBuffer = typeof Buffer === 'function' && typeof Buffer.from === 'function';
//# sourceMappingURL=constants.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,kEAAkE,CAAC;AAC9E,QAAA,SAAS,GAAG,OAAO,MAAM,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC"}

View File

@@ -0,0 +1 @@
export declare const createFromBase64: (chars?: string, noPadding?: boolean) => (encoded: string) => Uint8Array;

View File

@@ -0,0 +1,80 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createFromBase64 = void 0;
const constants_1 = require("./constants");
const E = '=';
const createFromBase64 = (chars = constants_1.alphabet, noPadding = false) => {
if (chars.length !== 64)
throw new Error('chars must be 64 characters long');
let max = 0;
for (let i = 0; i < chars.length; i++)
max = Math.max(max, chars.charCodeAt(i));
const table = [];
for (let i = 0; i <= max; i += 1)
table[i] = -1;
for (let i = 0; i < chars.length; i++)
table[chars.charCodeAt(i)] = i;
return (encoded) => {
if (!encoded)
return new Uint8Array(0);
let length = encoded.length;
if (noPadding) {
const mod = length % 4;
if (mod === 2) {
encoded += '==';
length += 2;
}
else if (mod === 3) {
encoded += '=';
length += 1;
}
}
if (length % 4 !== 0)
throw new Error('Base64 string length must be a multiple of 4');
const mainLength = encoded[length - 1] !== E ? length : length - 4;
let bufferLength = (length >> 2) * 3;
let padding = 0;
if (encoded[length - 2] === E) {
padding = 2;
bufferLength -= 2;
}
else if (encoded[length - 1] === E) {
padding = 1;
bufferLength -= 1;
}
const buf = new Uint8Array(bufferLength);
let j = 0;
let i = 0;
for (; i < mainLength; i += 4) {
const sextet0 = table[encoded.charCodeAt(i)];
const sextet1 = table[encoded.charCodeAt(i + 1)];
const sextet2 = table[encoded.charCodeAt(i + 2)];
const sextet3 = table[encoded.charCodeAt(i + 3)];
if (sextet0 < 0 || sextet1 < 0 || sextet2 < 0 || sextet3 < 0)
throw new Error('INVALID_BASE64_STRING');
buf[j] = (sextet0 << 2) | (sextet1 >> 4);
buf[j + 1] = (sextet1 << 4) | (sextet2 >> 2);
buf[j + 2] = (sextet2 << 6) | sextet3;
j += 3;
}
if (padding === 2) {
const sextet0 = table[encoded.charCodeAt(mainLength)];
const sextet1 = table[encoded.charCodeAt(mainLength + 1)];
if (sextet0 < 0 || sextet1 < 0)
throw new Error('INVALID_BASE64_STRING');
buf[j] = (sextet0 << 2) | (sextet1 >> 4);
}
else if (padding === 1) {
const sextet0 = table[encoded.charCodeAt(mainLength)];
const sextet1 = table[encoded.charCodeAt(mainLength + 1)];
const sextet2 = table[encoded.charCodeAt(mainLength + 2)];
if (sextet0 < 0 || sextet1 < 0 || sextet2 < 0)
throw new Error('INVALID_BASE64_STRING');
buf[j] = (sextet0 << 2) | (sextet1 >> 4);
buf[j + 1] = (sextet1 << 4) | (sextet2 >> 2);
}
return buf;
};
};
exports.createFromBase64 = createFromBase64;
//# sourceMappingURL=createFromBase64.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createFromBase64.js","sourceRoot":"","sources":["../src/createFromBase64.ts"],"names":[],"mappings":";;;AAAA,2CAAqC;AAErC,MAAM,CAAC,GAAG,GAAG,CAAC;AAEP,MAAM,gBAAgB,GAAG,CAAC,QAAgB,oBAAQ,EAAE,YAAqB,KAAK,EAAE,EAAE;IACvF,IAAI,KAAK,CAAC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MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;YACxF,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;YACzC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,CAAC;AACJ,CAAC,CAAC;AA7DW,QAAA,gBAAgB,oBA6D3B"}

View File

@@ -0,0 +1 @@
export declare const createFromBase64Bin: (chars?: string, pad?: string) => (view: DataView, offset: number, length: number) => Uint8Array;

View File

@@ -0,0 +1,87 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createFromBase64Bin = void 0;
const constants_1 = require("./constants");
const createFromBase64Bin = (chars = constants_1.alphabet, pad = '=') => {
if (chars.length !== 64)
throw new Error('chars must be 64 characters long');
let max = 0;
for (let i = 0; i < chars.length; i++)
max = Math.max(max, chars.charCodeAt(i));
const table = [];
for (let i = 0; i <= max; i += 1)
table[i] = -1;
for (let i = 0; i < chars.length; i++)
table[chars.charCodeAt(i)] = i;
const doExpectPadding = pad.length === 1;
const PAD = doExpectPadding ? pad.charCodeAt(0) : 0;
return (view, offset, length) => {
if (!length)
return new Uint8Array(0);
let padding = 0;
if (length % 4 !== 0) {
padding = 4 - (length % 4);
length += padding;
}
else {
const end = offset + length;
const last = end - 1;
if (view.getUint8(last) === PAD) {
padding = 1;
if (length > 1 && view.getUint8(last - 1) === PAD)
padding = 2;
}
}
if (length % 4 !== 0)
throw new Error('Base64 string length must be a multiple of 4');
const mainEnd = offset + length - (padding ? 4 : 0);
const bufferLength = (length >> 2) * 3 - padding;
const buf = new Uint8Array(bufferLength);
let j = 0;
let i = offset;
for (; i < mainEnd; i += 4) {
const word = view.getUint32(i);
const octet0 = word >>> 24;
const octet1 = (word >>> 16) & 0xff;
const octet2 = (word >>> 8) & 0xff;
const octet3 = word & 0xff;
const sextet0 = table[octet0];
const sextet1 = table[octet1];
const sextet2 = table[octet2];
const sextet3 = table[octet3];
if (sextet0 < 0 || sextet1 < 0 || sextet2 < 0 || sextet3 < 0)
throw new Error('INVALID_BASE64_SEQ');
buf[j] = (sextet0 << 2) | (sextet1 >> 4);
buf[j + 1] = (sextet1 << 4) | (sextet2 >> 2);
buf[j + 2] = (sextet2 << 6) | sextet3;
j += 3;
}
if (!padding)
return buf;
if (padding === 1) {
const word = view.getUint16(mainEnd);
const octet0 = word >> 8;
const octet1 = word & 0xff;
const octet2 = view.getUint8(mainEnd + 2);
const sextet0 = table[octet0];
const sextet1 = table[octet1];
const sextet2 = table[octet2];
if (sextet0 < 0 || sextet1 < 0 || sextet2 < 0)
throw new Error('INVALID_BASE64_SEQ');
buf[j] = (sextet0 << 2) | (sextet1 >> 4);
buf[j + 1] = (sextet1 << 4) | (sextet2 >> 2);
return buf;
}
const word = view.getUint16(mainEnd);
const octet0 = word >> 8;
const octet1 = word & 0xff;
const sextet0 = table[octet0];
const sextet1 = table[octet1];
if (sextet0 < 0 || sextet1 < 0)
throw new Error('INVALID_BASE64_SEQ');
buf[j] = (sextet0 << 2) | (sextet1 >> 4);
return buf;
};
};
exports.createFromBase64Bin = createFromBase64Bin;
//# sourceMappingURL=createFromBase64Bin.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createFromBase64Bin.js","sourceRoot":"","sources":["../src/createFromBase64Bin.ts"],"names":[],"mappings":";;;AAAA,2CAAqC;AAE9B,MAAM,mBAAmB,GAAG,CAAC,QAAgB,oBAAQ,EAAE,MAAc,GAAG,EAAE,EAAE;IACjF,IAAI,KAAK,CAAC,MAAM,KAAK,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC7E,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,C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AG,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;YAC7C,OAAO,GAAG,CAAC;QACb,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACrC,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,CAAC;QACzB,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;QAC3B,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9B,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACtE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;QACzC,OAAO,GAAG,CAAC;IACb,CAAC,CAAC;AACJ,CAAC,CAAC;AAtEW,QAAA,mBAAmB,uBAsE9B"}

View File

@@ -0,0 +1 @@
export declare const createToBase64: (chars?: string, pad?: string) => (uint8: Uint8Array, length: number) => string;

48
node_modules/@jsonjoy.com/base64/lib/createToBase64.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createToBase64 = void 0;
const flatstr_1 = require("./util/strings/flatstr");
const constants_1 = require("./constants");
const createToBase64 = (chars = constants_1.alphabet, pad = '=') => {
if (chars.length !== 64)
throw new Error('chars must be 64 characters long');
const table = chars.split('');
const table2 = [];
for (const c1 of table) {
for (const c2 of table) {
const two = (0, flatstr_1.flatstr)(c1 + c2);
table2.push(two);
}
}
const E = pad;
const EE = (0, flatstr_1.flatstr)(pad + pad);
return (uint8, length) => {
let out = '';
const extraLength = length % 3;
const baseLength = length - extraLength;
for (let i = 0; i < baseLength; i += 3) {
const o1 = uint8[i];
const o2 = uint8[i + 1];
const o3 = uint8[i + 2];
const v1 = (o1 << 4) | (o2 >> 4);
const v2 = ((o2 & 0b1111) << 8) | o3;
out += table2[v1] + table2[v2];
}
if (!extraLength)
return out;
if (extraLength === 1) {
const o1 = uint8[baseLength];
out += table2[o1 << 4] + EE;
}
else {
const o1 = uint8[baseLength];
const o2 = uint8[baseLength + 1];
const v1 = (o1 << 4) | (o2 >> 4);
const v2 = (o2 & 0b1111) << 2;
out += table2[v1] + table[v2] + E;
}
return out;
};
};
exports.createToBase64 = createToBase64;
//# sourceMappingURL=createToBase64.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createToBase64.js","sourceRoot":"","sources":["../src/createToBase64.ts"],"names":[],"mappings":";;;AAAA,oDAA+C;AAC/C,2CAAqC;AAE9B,MAAM,cAAc,GAAG,CAAC,QAAgB,oBAAQ,EAAE,MAAc,GAAG,EAAE,EAAE;IAC5E,IAAI,KAAK,CAAC,MAAM,KAAK,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAE7E,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,KAAK,MAAM,EAAE,IAAI,KAAK,EAAE,CAAC;QACvB,KAAK,MAAM,EAAE,IAAI,KAAK,EAAE,CAAC;YACvB,MAAM,GAAG,GAAG,IAAA,iBAAO,EAAC,EAAE,GAAG,EAAE,CAAC,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAED,MAAM,CAAC,GAAW,GAAG,CAAC;IACtB,MAAM,EAAE,GAAW,IAAA,iBAAO,EAAC,GAAG,GAAG,GAAG,CAAC,CAAC;IAEtC,OAAO,CAAC,KAAiB,EAAE,MAAc,EAAU,EAAE;QACnD,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,MAAM,WAAW,GAAG,MAAM,G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AAC,GAAG,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,CAAC;AACJ,CAAC,CAAC;AAzCW,QAAA,cAAc,kBAyCzB"}

View File

@@ -0,0 +1 @@
export declare const createToBase64Bin: (chars?: string, pad?: string) => (uint8: Uint8Array, start: number, length: number, dest: DataView, offset: number) => number;

View File

@@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createToBase64Bin = void 0;
const constants_1 = require("./constants");
const createToBase64Bin = (chars = constants_1.alphabet, pad = '=') => {
if (chars.length !== 64)
throw new Error('chars must be 64 characters long');
const table = chars.split('').map((c) => c.charCodeAt(0));
const table2 = [];
for (const c1 of table) {
for (const c2 of table) {
const two = (c1 << 8) + c2;
table2.push(two);
}
}
const doAddPadding = pad.length === 1;
const E = doAddPadding ? pad.charCodeAt(0) : 0;
const EE = doAddPadding ? (E << 8) | E : 0;
return (uint8, start, length, dest, offset) => {
const extraLength = length % 3;
const baseLength = length - extraLength;
for (; start < baseLength; start += 3) {
const o1 = uint8[start];
const o2 = uint8[start + 1];
const o3 = uint8[start + 2];
const v1 = (o1 << 4) | (o2 >> 4);
const v2 = ((o2 & 0b1111) << 8) | o3;
dest.setInt32(offset, (table2[v1] << 16) + table2[v2]);
offset += 4;
}
if (extraLength === 1) {
const o1 = uint8[baseLength];
if (doAddPadding) {
dest.setInt32(offset, (table2[o1 << 4] << 16) + EE);
offset += 4;
}
else {
dest.setInt16(offset, table2[o1 << 4]);
offset += 2;
}
}
else if (extraLength) {
const o1 = uint8[baseLength];
const o2 = uint8[baseLength + 1];
const v1 = (o1 << 4) | (o2 >> 4);
const v2 = (o2 & 0b1111) << 2;
if (doAddPadding) {
dest.setInt32(offset, (table2[v1] << 16) + (table[v2] << 8) + E);
offset += 4;
}
else {
dest.setInt16(offset, table2[v1]);
offset += 2;
dest.setInt8(offset, table[v2]);
offset += 1;
}
}
return offset;
};
};
exports.createToBase64Bin = createToBase64Bin;
//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M,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;YACjC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;YAC9B,IAAI,YAAY,EAAE,CAAC;gBACjB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBACjE,MAAM,IAAI,CAAC,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;gBAClC,MAAM,IAAI,CAAC,CAAC;gBACZ,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;gBAChC,MAAM,IAAI,CAAC,CAAC;YACd,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC;AAvDW,QAAA,iBAAiB,qBAuD5B"}

View File

@@ -0,0 +1 @@
export declare const createToBase64BinUint8: (chars?: string, pad?: string) => (uint8: Uint8Array, start: number, length: number, dest: Uint8Array, offset: number) => number;

View File

@@ -0,0 +1,59 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createToBase64BinUint8 = void 0;
const constants_1 = require("./constants");
const createToBase64BinUint8 = (chars = constants_1.alphabet, pad = '=') => {
if (chars.length !== 64)
throw new Error('chars must be 64 characters long');
const table = chars.split('').map((c) => c.charCodeAt(0));
const table2 = [];
for (const c1 of table) {
for (const c2 of table) {
const two = (c1 << 8) + c2;
table2.push(two);
}
}
const PAD = pad.length === 1 ? pad.charCodeAt(0) : 0;
return (uint8, start, length, dest, offset) => {
const extraLength = length % 3;
const baseLength = length - extraLength;
for (; start < baseLength; start += 3) {
const o1 = uint8[start];
const o2 = uint8[start + 1];
const o3 = uint8[start + 2];
const v1 = (o1 << 4) | (o2 >> 4);
const v2 = ((o2 & 0b1111) << 8) | o3;
let u16 = table2[v1];
dest[offset++] = u16 >> 8;
dest[offset++] = u16;
u16 = table2[v2];
dest[offset++] = u16 >> 8;
dest[offset++] = u16;
}
if (extraLength === 1) {
const o1 = uint8[baseLength];
const u16 = table2[o1 << 4];
dest[offset++] = u16 >> 8;
dest[offset++] = u16;
if (PAD) {
dest[offset++] = PAD;
dest[offset++] = PAD;
}
}
else if (extraLength) {
const o1 = uint8[baseLength];
const o2 = uint8[baseLength + 1];
const v1 = (o1 << 4) | (o2 >> 4);
const v2 = (o2 & 0b1111) << 2;
const u16 = table2[v1];
dest[offset++] = u16 >> 8;
dest[offset++] = u16;
dest[offset++] = table[v2];
if (PAD)
dest[offset++] = PAD;
}
return offset;
};
};
exports.createToBase64BinUint8 = createToBase64BinUint8;
//# sourceMappingURL=createToBase64BinUint8.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createToBase64BinUint8.js","sourceRoot":"","sources":["../src/createToBase64BinUint8.ts"],"names":[],"mappings":";;;AAAA,2CAAqC;AAE9B,MAAM,sBAAsB,GAAG,CAAC,QAAgB,oBAAQ,EAAE,MAAc,GAAG,EAAE,EAAE;IACpF,IAAI,KAAK,CAAC,MAAM,KAAK,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAE7E,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,KAAK,MAAM,EAAE,IAAI,KAAK,EAAE,CAAC;QACvB,KAAK,MAAM,EAAE,IAAI,KAAK,EAAE,CAAC;YACvB,MAAM,GAAG,GA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com/base64/lib/fromBase64.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare const fromBase64: (encoded: string) => Uint8Array;

12
node_modules/@jsonjoy.com/base64/lib/fromBase64.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromBase64 = void 0;
const bufferToUint8Array_1 = require("./util/buffers/bufferToUint8Array");
const constants_1 = require("./constants");
const createFromBase64_1 = require("./createFromBase64");
const fromBase64Cpp = constants_1.hasBuffer ? (encoded) => (0, bufferToUint8Array_1.bufferToUint8Array)(Buffer.from(encoded, 'base64')) : null;
const fromBase64Native = (0, createFromBase64_1.createFromBase64)();
exports.fromBase64 = !fromBase64Cpp
? fromBase64Native
: (encoded) => (encoded.length > 48 ? fromBase64Cpp(encoded) : fromBase64Native(encoded));
//# sourceMappingURL=fromBase64.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"fromBase64.js","sourceRoot":"","sources":["../src/fromBase64.ts"],"names":[],"mappings":";;;AAAA,0EAAqE;AACrE,2CAAsC;AACtC,yDAAoD;AAEpD,MAAM,aAAa,GAAG,qBAAS,CAAC,CAAC,CAAC,CAAC,OAAe,EAAE,EAAE,CAAC,IAAA,uCAAkB,EAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjH,MAAM,gBAAgB,GAAG,IAAA,mCAAgB,GAAE,CAAC;AAE/B,QAAA,UAAU,GAAG,CAAC,aAAa;IACtC,CAAC,CAAC,gBAAgB;IAClB,CAAC,CAAC,CAAC,OAAe,EAAc,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC"}

View File

@@ -0,0 +1 @@
export declare const fromBase64Bin: (view: DataView, offset: number, length: number) => Uint8Array;

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromBase64Bin = void 0;
const createFromBase64Bin_1 = require("./createFromBase64Bin");
exports.fromBase64Bin = (0, createFromBase64Bin_1.createFromBase64Bin)();
//# sourceMappingURL=fromBase64Bin.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"fromBase64Bin.js","sourceRoot":"","sources":["../src/fromBase64Bin.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAE7C,QAAA,aAAa,GAAG,IAAA,yCAAmB,GAAE,CAAC"}

View File

@@ -0,0 +1 @@
export declare const fromBase64Url: (encoded: string) => Uint8Array;

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromBase64Url = void 0;
const createFromBase64_1 = require("./createFromBase64");
exports.fromBase64Url = (0, createFromBase64_1.createFromBase64)('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', true);
//# sourceMappingURL=fromBase64Url.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"fromBase64Url.js","sourceRoot":"","sources":["../src/fromBase64Url.ts"],"names":[],"mappings":";;;AAAA,yDAAoD;AAEvC,QAAA,aAAa,GAAG,IAAA,mCAAgB,EAAC,kEAAkE,EAAE,IAAI,CAAC,CAAC"}

7
node_modules/@jsonjoy.com/base64/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export * from './createToBase64';
export * from './createToBase64Bin';
export * from './createFromBase64';
export * from './toBase64';
export * from './toBase64Bin';
export * from './fromBase64';
export * from './fromBase64Bin';

11
node_modules/@jsonjoy.com/base64/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./createToBase64"), exports);
tslib_1.__exportStar(require("./createToBase64Bin"), exports);
tslib_1.__exportStar(require("./createFromBase64"), exports);
tslib_1.__exportStar(require("./toBase64"), exports);
tslib_1.__exportStar(require("./toBase64Bin"), exports);
tslib_1.__exportStar(require("./fromBase64"), exports);
tslib_1.__exportStar(require("./fromBase64Bin"), exports);
//# sourceMappingURL=index.js.map

1
node_modules/@jsonjoy.com/base64/lib/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,8DAAoC;AACpC,6DAAmC;AACnC,qDAA2B;AAC3B,wDAA8B;AAC9B,uDAA6B;AAC7B,0DAAgC"}

1
node_modules/@jsonjoy.com/base64/lib/toBase64.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare const toBase64: (uint8: Uint8Array) => string;

15
node_modules/@jsonjoy.com/base64/lib/toBase64.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toBase64 = void 0;
const constants_1 = require("./constants");
const createToBase64_1 = require("./createToBase64");
const encodeSmall = (0, createToBase64_1.createToBase64)();
exports.toBase64 = !constants_1.hasBuffer
? (uint8) => encodeSmall(uint8, uint8.length)
: (uint8) => {
const length = uint8.length;
if (length <= 48)
return encodeSmall(uint8, length);
return Buffer.from(uint8).toString('base64');
};
//# sourceMappingURL=toBase64.js.map

1
node_modules/@jsonjoy.com/base64/lib/toBase64.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"toBase64.js","sourceRoot":"","sources":["../src/toBase64.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AACtC,qDAAgD;AAEhD,MAAM,WAAW,GAAG,IAAA,+BAAc,GAAE,CAAC;AAExB,QAAA,QAAQ,GAAG,CAAC,qBAAS;IAChC,CAAC,CAAC,CAAC,KAAiB,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;IACzD,CAAC,CAAC,CAAC,KAAiB,EAAU,EAAE;QAC5B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,IAAI,MAAM,IAAI,EAAE;YAAE,OAAO,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACpD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC,CAAC"}

View File

@@ -0,0 +1 @@
export declare const toBase64Bin: (uint8: Uint8Array, start: number, length: number, dest: DataView, offset: number) => number;

6
node_modules/@jsonjoy.com/base64/lib/toBase64Bin.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toBase64Bin = void 0;
const createToBase64Bin_1 = require("./createToBase64Bin");
exports.toBase64Bin = (0, createToBase64Bin_1.createToBase64Bin)();
//# sourceMappingURL=toBase64Bin.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"toBase64Bin.js","sourceRoot":"","sources":["../src/toBase64Bin.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AAEzC,QAAA,WAAW,GAAG,IAAA,qCAAiB,GAAE,CAAC"}

View File

@@ -0,0 +1 @@
export declare const toBase64Url: (uint8: Uint8Array, length: number) => string;

6
node_modules/@jsonjoy.com/base64/lib/toBase64Url.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toBase64Url = void 0;
const createToBase64_1 = require("./createToBase64");
exports.toBase64Url = (0, createToBase64_1.createToBase64)('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', '');
//# sourceMappingURL=toBase64Url.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"toBase64Url.js","sourceRoot":"","sources":["../src/toBase64Url.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAEnC,QAAA,WAAW,GAAG,IAAA,+BAAc,EAAC,kEAAkE,EAAE,EAAE,CAAC,CAAC"}

View File

@@ -0,0 +1 @@
export declare const b: (...args: number[]) => Uint8Array;

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.b = void 0;
const b = (...args) => new Uint8Array(args);
exports.b = b;
//# sourceMappingURL=b.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"b.js","sourceRoot":"","sources":["../../../src/util/buffers/b.ts"],"names":[],"mappings":";;;AAAO,MAAM,CAAC,GAAG,CAAC,GAAG,IAAc,EAAE,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;AAAhD,QAAA,CAAC,KAA+C"}

View File

@@ -0,0 +1,2 @@
/// <reference types="node" />
export declare const bufferToUint8Array: (buf: Buffer) => Uint8Array;

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bufferToUint8Array = void 0;
const bufferToUint8Array = (buf) => new Uint8Array(buf.buffer, buf.byteOffset, buf.length);
exports.bufferToUint8Array = bufferToUint8Array;
//# sourceMappingURL=bufferToUint8Array.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"bufferToUint8Array.js","sourceRoot":"","sources":["../../../src/util/buffers/bufferToUint8Array.ts"],"names":[],"mappings":";;;AAAO,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAc,EAAE,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;AAAzG,QAAA,kBAAkB,sBAAuF"}

View File

@@ -0,0 +1 @@
export declare const copy: <T extends Uint8Array>(arr: T) => T;

View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.copy = void 0;
const copy = (arr) => {
const dupe = new Uint8Array(arr.length);
dupe.set(arr);
return dupe;
};
exports.copy = copy;
//# sourceMappingURL=copy.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../../src/util/buffers/copy.ts"],"names":[],"mappings":";;;AAAO,MAAM,IAAI,GAAG,CAAuB,GAAM,EAAK,EAAE;IACtD,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,CAAM,CAAC;IAC7C,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACd,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAJW,QAAA,IAAI,QAIf"}

View File

@@ -0,0 +1 @@
export declare const flatstr: (s: string) => string;

View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.flatstr = void 0;
const flatstr = (s) => {
s | 0;
Number(s);
return s;
};
exports.flatstr = flatstr;
//# sourceMappingURL=flatstr.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"flatstr.js","sourceRoot":"","sources":["../../../src/util/strings/flatstr.ts"],"names":[],"mappings":";;;AAAO,MAAM,OAAO,GAAG,CAAC,CAAS,EAAU,EAAE;IACrC,CAAE,GAAG,CAAC,CAAC;IACb,MAAM,CAAC,CAAC,CAAC,CAAC;IACV,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAJW,QAAA,OAAO,WAIlB"}

109
node_modules/@jsonjoy.com/base64/package.json generated vendored Normal file
View File

@@ -0,0 +1,109 @@
{
"name": "@jsonjoy.com/base64",
"private": false,
"publishConfig": {
"access": "public"
},
"version": "1.1.2",
"description": "High-performance Base64 encoder and decoder",
"author": {
"name": "streamich",
"url": "https://github.com/streamich"
},
"homepage": "https://github.com/jsonjoy-com/base64",
"repository": "jsonjoy-com/base64",
"license": "Apache-2.0",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/streamich"
},
"keywords": [
"base64",
"base64url",
"base64-url",
"base64urlsafe",
"base64url-safe"
],
"engines": {
"node": ">=10.0"
},
"main": "lib/index.js",
"types": "lib/index.d.ts",
"typings": "lib/index.d.ts",
"files": [
"LICENSE",
"lib/"
],
"scripts": {
"prettier": "prettier --ignore-path .gitignore --write \"src/**/*.{ts,tsx,js,jsx}\"",
"prettier:check": "prettier --ignore-path .gitignore --list-different 'src/**/*.{ts,tsx,js,jsx}'",
"lint": "yarn tslint",
"tslint": "tslint 'src/**/*.{js,jsx,ts,tsx}' -t verbose --project .",
"clean": "rimraf lib typedocs coverage gh-pages yarn-error.log",
"build": "tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib",
"jest": "node -r ts-node/register ./node_modules/.bin/jest",
"test": "jest --maxWorkers 7",
"test:ci": "yarn jest --maxWorkers 3 --no-cache",
"coverage": "yarn test --collectCoverage",
"typedoc": "typedoc",
"build:pages": "rimraf gh-pages && mkdir -p gh-pages && cp -r typedocs/* gh-pages && cp -r coverage gh-pages/coverage",
"deploy:pages": "gh-pages -d gh-pages",
"publish-coverage-and-typedocs": "yarn typedoc && yarn coverage && yarn build:pages && yarn deploy:pages"
},
"peerDependencies": {
"tslib": "2"
},
"dependencies": {},
"devDependencies": {
"@types/benchmark": "^2.1.2",
"@types/jest": "^29.5.12",
"base64-js": "^1.5.1",
"benchmark": "^2.1.4",
"jest": "^29.7.0",
"js-base64": "^3.7.2",
"prettier": "^3.2.5",
"pretty-quick": "^3.1.3",
"rimraf": "^5.0.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"tslint": "^6.1.3",
"tslint-config-common": "^1.6.2",
"typedoc": "^0.25.12",
"typescript": "^5.4.4"
},
"jest": {
"verbose": true,
"testEnvironmentOptions": {
"url": "http://localhost/"
},
"setupFiles": [
"<rootDir>/src/__tests__/setup.js"
],
"moduleFileExtensions": [
"ts",
"js"
],
"transform": {
"^.+\\.ts$": "ts-jest"
},
"transformIgnorePatterns": [],
"testRegex": ".*/(__tests__|__jest__|demo)/.*\\.(test|spec)\\.ts$"
},
"prettier": {
"arrowParens": "always",
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": false
},
"release": {
"branches": [
"master",
"next"
]
}
}

201
node_modules/@jsonjoy.com/buffers/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2024 jsonjoy.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

234
node_modules/@jsonjoy.com/buffers/README.md generated vendored Normal file
View File

@@ -0,0 +1,234 @@
# buffers
Various helper utilities for working with buffers and binary data in TypeScript.
## Installation
```bash
npm install @jsonjoy.com/buffers
```
## Features
This package provides high-performance utilities for working with binary data, buffers, and UTF-8 text encoding/decoding. It includes optimized implementations for both Node.js and browser environments.
## Core Classes
### Writer
A growable binary data writer with automatic buffer expansion.
```typescript
import {Writer} from '@jsonjoy.com/buffers/lib/Writer';
const writer = new Writer();
writer.u8(0x42); // Write unsigned 8-bit integer
writer.u16(0x1234); // Write unsigned 16-bit integer
writer.u32(0x12345678); // Write unsigned 32-bit integer
writer.u64(0x123456789abcdefn); // Write unsigned 64-bit integer
writer.f32(3.14); // Write 32-bit float
writer.f64(3.141592653589793); // Write 64-bit float
writer.utf8('Hello 🌍'); // Write UTF-8 string
writer.ascii('Hello'); // Write ASCII string
const data = writer.flush(); // Get written data as Uint8Array
```
### Reader
A binary data reader for parsing binary buffers.
```typescript
import {Reader} from '@jsonjoy.com/buffers/lib/Reader';
const reader = new Reader();
reader.reset(someUint8Array);
const byte = reader.u8(); // Read unsigned 8-bit integer
const word = reader.u16(); // Read unsigned 16-bit integer
const dword = reader.u32(); // Read unsigned 32-bit integer
const qword = reader.u64(); // Read unsigned 64-bit integer
const float = reader.f32(); // Read 32-bit float
const double = reader.f64(); // Read 64-bit float
const text = reader.utf8(5); // Read UTF-8 string of 5 bytes
const ascii = reader.ascii(5); // Read ASCII string of 5 characters
```
### StreamingReader
A streaming binary reader that can handle data arriving in chunks.
```typescript
import {StreamingReader} from '@jsonjoy.com/buffers/lib/StreamingReader';
const reader = new StreamingReader();
reader.push(chunk1);
reader.push(chunk2);
// Read data as it becomes available
const value = reader.u32();
reader.consume(); // Mark consumed data for cleanup
```
### StreamingOctetReader
A specialized streaming reader for byte-oriented protocols with optional XOR masking.
```typescript
import {StreamingOctetReader} from '@jsonjoy.com/buffers/lib/StreamingOctetReader';
const reader = new StreamingOctetReader();
reader.push(dataChunk);
const byte = reader.u8();
const masked = reader.bufXor(length, [0x12, 0x34, 0x56, 0x78], 0);
```
## Utility Functions
### Buffer Operations
```typescript
// Array creation and manipulation
import {b} from '@jsonjoy.com/buffers/lib/b';
import {concat, concatList} from '@jsonjoy.com/buffers/lib/concat';
import {copy} from '@jsonjoy.com/buffers/lib/copy';
const buffer = b(0x48, 0x65, 0x6c, 0x6c, 0x6f); // Create from bytes
const combined = concat(buffer1, buffer2); // Concatenate two buffers
const list = concatList([buf1, buf2, buf3]); // Concatenate array of buffers
const duplicate = copy(originalBuffer); // Copy buffer
```
### Comparison Functions
```typescript
import {cmpUint8Array} from '@jsonjoy.com/buffers/lib/cmpUint8Array';
import {cmpUint8Array2} from '@jsonjoy.com/buffers/lib/cmpUint8Array2';
import {cmpUint8Array3} from '@jsonjoy.com/buffers/lib/cmpUint8Array3';
const isEqual = cmpUint8Array(buf1, buf2); // Returns boolean
const comparison = cmpUint8Array2(buf1, buf2); // Returns -1, 0, or 1 (byte-first)
const comparison2 = cmpUint8Array3(buf1, buf2); // Returns -1, 0, or 1 (length-first)
```
### Type Checking
```typescript
import {isUint8Array} from '@jsonjoy.com/buffers/lib/isUint8Array';
import {isArrayBuffer} from '@jsonjoy.com/buffers/lib/isArrayBuffer';
import {isFloat32} from '@jsonjoy.com/buffers/lib/isFloat32';
if (isUint8Array(data)) { /* data is Uint8Array or Buffer */ }
if (isArrayBuffer(data)) { /* data is ArrayBuffer */ }
if (isFloat32(3.14)) { /* number can fit in float32 */ }
```
### Conversion Functions
```typescript
import {toUint8Array} from '@jsonjoy.com/buffers/lib/toUint8Array';
import {bufferToUint8Array} from '@jsonjoy.com/buffers/lib/bufferToUint8Array';
import {toBuf} from '@jsonjoy.com/buffers/lib/toBuf';
const uint8 = toUint8Array(data); // Convert various types to Uint8Array
const converted = bufferToUint8Array(buf); // Convert Buffer to Uint8Array
const encoded = toBuf('Hello 🌍'); // Convert string to UTF-8 bytes
```
### String Utilities
```typescript
import {ascii, utf8} from '@jsonjoy.com/buffers/lib/strings';
const asciiBytes = ascii`Hello World`; // ASCII string to bytes
const utf8Bytes = utf8`Hello 🌍`; // UTF-8 string to bytes
```
## UTF-8 Encoding/Decoding
### High-Performance UTF-8 Decoding
```typescript
import {decodeUtf8} from '@jsonjoy.com/buffers/lib/utf8/decodeUtf8';
const text = decodeUtf8(uint8Array, offset, length);
```
The package includes multiple optimized UTF-8 decoding implementations that automatically choose the best strategy based on:
- Environment (Node.js vs Browser)
- String length
- Available APIs
### UTF-8 Encoding
```typescript
import {encode} from '@jsonjoy.com/buffers/lib/utf8/encode';
const bytesWritten = encode(targetArray, 'Hello 🌍', offset, maxLength);
```
### Advanced UTF-8 Features
```typescript
import {CachedUtf8Decoder} from '@jsonjoy.com/buffers/lib/utf8/CachedUtf8Decoder';
import {isUtf8} from '@jsonjoy.com/buffers/lib/utf8/isUtf8';
import {decodeAscii} from '@jsonjoy.com/buffers/lib/utf8/decodeAscii';
const decoder = new CachedUtf8Decoder();
const text = decoder.decode(uint8Array, start, length);
const isValidUtf8 = isUtf8(uint8Array);
const asciiText = decodeAscii(uint8Array, start, length);
```
## Special Data Types
### Slice
A lightweight view into a buffer without copying data.
```typescript
import {Slice} from '@jsonjoy.com/buffers/lib/Slice';
const slice = new Slice(uint8Array, dataView, start, end);
const subarray = slice.subarray(); // Get the actual data
```
### Float16 Support
```typescript
import {decodeF16} from '@jsonjoy.com/buffers/lib/f16';
const float32Value = decodeF16(binaryF16Value);
```
## Debugging Utilities
```typescript
import {printOctets} from '@jsonjoy.com/buffers/lib/printOctets';
console.log(printOctets(uint8Array, 16)); // Print hex dump of first 16 bytes
```
## Performance
This library is designed for high performance with:
- **Optimized UTF-8 handling**: Multiple implementations that choose the fastest method for each environment
- **Minimal allocations**: Reusable readers and writers with buffer pooling
- **Zero-copy operations**: Slices and views avoid unnecessary data copying
- **Environment-specific optimizations**: Leverages Node.js Buffer APIs when available
## Browser Support
Works in all modern browsers and Node.js environments. The library automatically detects available APIs and chooses the most appropriate implementation.
## TypeScript Support
Full TypeScript support with comprehensive type definitions included.
## License
Apache-2.0

54
node_modules/@jsonjoy.com/buffers/lib/Reader.d.ts generated vendored Normal file
View File

@@ -0,0 +1,54 @@
import type { IReader, IReaderResettable } from './types';
export declare class Reader implements IReader, IReaderResettable {
uint8: Uint8Array;
view: DataView;
x: number;
end: number;
constructor(uint8?: Uint8Array, view?: DataView, x?: number, end?: number);
reset(uint8: Uint8Array): void;
size(): number;
/**
* Get current byte value without advancing the cursor.
*/
peek(): number;
/**
* @deprecated Use peek() instead.
*/
peak(): number;
skip(length: number): void;
buf(size?: number): Uint8Array;
subarray(start?: number, end?: number): Uint8Array;
/**
* Creates a new {@link Reader} that references the same underlying memory
* buffer. But with independent cursor and end.
*
* Preferred over {@link buf} since it also provides a DataView and is much
* faster to allocate a new {@link Slice} than a new {@link Uint8Array}.
*
* @param start Start offset relative to the current cursor position.
* @param end End offset relative to the current cursor position.
* @returns A new {@link Reader} instance.
*/
slice(start?: number, end?: number): Reader;
/**
* Similar to {@link slice} but also advances the cursor. Returns a new
* {@link Reader} that references the same underlying memory buffer, starting
* from the current cursor position.
*
* @param size Number of bytes to cut from the current position.
* @returns A new {@link Reader} instance.
*/
cut(size?: number): Reader;
u8(): number;
i8(): number;
u16(): number;
i16(): number;
u32(): number;
i32(): number;
u64(): bigint;
i64(): bigint;
f32(): number;
f64(): number;
utf8(size: number): string;
ascii(length: number): string;
}

145
node_modules/@jsonjoy.com/buffers/lib/Reader.js generated vendored Normal file
View File

@@ -0,0 +1,145 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Reader = void 0;
const decodeUtf8_1 = require("./utf8/decodeUtf8");
class Reader {
constructor(uint8 = new Uint8Array([]), view = new DataView(uint8.buffer, uint8.byteOffset, uint8.length), x = 0, end = uint8.length) {
this.uint8 = uint8;
this.view = view;
this.x = x;
this.end = end;
}
reset(uint8) {
this.x = 0;
this.uint8 = uint8;
this.view = new DataView(uint8.buffer, uint8.byteOffset, uint8.length);
}
size() {
return this.end - this.x;
}
/**
* Get current byte value without advancing the cursor.
*/
peek() {
return this.view.getUint8(this.x);
}
/**
* @deprecated Use peek() instead.
*/
peak() {
return this.peek();
}
skip(length) {
this.x += length;
}
buf(size = this.size()) {
const x = this.x;
const end = x + size;
const bin = this.uint8.subarray(x, end);
this.x = end;
return bin;
}
subarray(start = 0, end) {
const x = this.x;
const actualStart = x + start;
const actualEnd = typeof end === 'number' ? x + end : this.end;
return this.uint8.subarray(actualStart, actualEnd);
}
/**
* Creates a new {@link Reader} that references the same underlying memory
* buffer. But with independent cursor and end.
*
* Preferred over {@link buf} since it also provides a DataView and is much
* faster to allocate a new {@link Slice} than a new {@link Uint8Array}.
*
* @param start Start offset relative to the current cursor position.
* @param end End offset relative to the current cursor position.
* @returns A new {@link Reader} instance.
*/
slice(start = 0, end) {
const x = this.x;
const actualStart = x + start;
const actualEnd = typeof end === 'number' ? x + end : this.end;
return new Reader(this.uint8, this.view, actualStart, actualEnd);
}
/**
* Similar to {@link slice} but also advances the cursor. Returns a new
* {@link Reader} that references the same underlying memory buffer, starting
* from the current cursor position.
*
* @param size Number of bytes to cut from the current position.
* @returns A new {@link Reader} instance.
*/
cut(size = this.size()) {
const slice = this.slice(0, size);
this.skip(size);
return slice;
}
u8() {
return this.uint8[this.x++];
// return this.view.getUint8(this.x++);
}
i8() {
return this.view.getInt8(this.x++);
}
u16() {
// const num = this.view.getUint16(this.x);
// this.x += 2;
// return num;
let x = this.x;
const num = (this.uint8[x++] << 8) + this.uint8[x++];
this.x = x;
return num;
}
i16() {
const num = this.view.getInt16(this.x);
this.x += 2;
return num;
}
u32() {
const num = this.view.getUint32(this.x);
this.x += 4;
return num;
}
i32() {
const num = this.view.getInt32(this.x);
this.x += 4;
return num;
}
u64() {
const num = this.view.getBigUint64(this.x);
this.x += 8;
return num;
}
i64() {
const num = this.view.getBigInt64(this.x);
this.x += 8;
return num;
}
f32() {
const pos = this.x;
this.x += 4;
return this.view.getFloat32(pos);
}
f64() {
const pos = this.x;
this.x += 8;
return this.view.getFloat64(pos);
}
utf8(size) {
const start = this.x;
this.x += size;
return (0, decodeUtf8_1.decodeUtf8)(this.uint8, start, size);
}
ascii(length) {
const uint8 = this.uint8;
let str = '';
const end = this.x + length;
for (let i = this.x; i < end; i++)
str += String.fromCharCode(uint8[i]);
this.x = end;
return str;
}
}
exports.Reader = Reader;
//# sourceMappingURL=Reader.js.map

1
node_modules/@jsonjoy.com/buffers/lib/Reader.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Reader.js","sourceRoot":"","sources":["../src/Reader.ts"],"names":[],"mappings":";;;AAAA,kDAA6C;AAG7C,MAAa,MAAM;IACjB,YACS,QAAoB,IAAI,UAAU,CAAC,EAAE,CAAC,EACtC,OAAiB,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAqB,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,EAC1F,IAAY,CAAC,EACb,MAAc,KAAK,CAAC,MAAM;QAH1B,UAAK,GAAL,KAAK,CAAiC;QACtC,SAAI,GAAJ,IAAI,CAAsF;QAC1F,MAAC,GAAD,CAAC,CAAY;QACb,QAAG,GAAH,GAAG,CAAuB;IAChC,CAAC;IAEG,KAAK,CAAC,KAAiB;QAC5B,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC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AAI,CAAC,CAAC,IAAI,IAAI,CAAC;QACf,OAAO,IAAA,uBAAU,EAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,MAAc;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC;QAC5B,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE;YAAE,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACxE,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;QACb,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AA9JD,wBA8JC"}

11
node_modules/@jsonjoy.com/buffers/lib/Slice.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* @deprecated Use {@link Reader} instead.
*/
export declare class Slice {
readonly uint8: Uint8Array;
readonly view: DataView;
readonly start: number;
readonly end: number;
constructor(uint8: Uint8Array, view: DataView, start: number, end: number);
subarray(): Uint8Array;
}

19
node_modules/@jsonjoy.com/buffers/lib/Slice.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Slice = void 0;
/**
* @deprecated Use {@link Reader} instead.
*/
class Slice {
constructor(uint8, view, start, end) {
this.uint8 = uint8;
this.view = view;
this.start = start;
this.end = end;
}
subarray() {
return this.uint8.subarray(this.start, this.end);
}
}
exports.Slice = Slice;
//# sourceMappingURL=Slice.js.map

1
node_modules/@jsonjoy.com/buffers/lib/Slice.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Slice.js","sourceRoot":"","sources":["../src/Slice.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,KAAK;IAChB,YACkB,KAAiB,EACjB,IAAc,EACd,KAAa,EACb,GAAW;QAHX,UAAK,GAAL,KAAK,CAAY;QACjB,SAAI,GAAJ,IAAI,CAAU;QACd,UAAK,GAAL,KAAK,CAAQ;QACb,QAAG,GAAH,GAAG,CAAQ;IAC1B,CAAC;IAEG,QAAQ;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACnD,CAAC;CACF;AAXD,sBAWC"}

View File

@@ -0,0 +1,30 @@
/**
* A streaming reader which internally manages multiple chunks of
* Uint8Array instances. For performance it does not merge the chunks into
* a single Uint8Array instance. Instead it keeps track of the chunks and
* reads across chunk boundaries as needed.
*/
export declare class StreamingOctetReader {
protected readonly chunks: Uint8Array[];
/** Total size of all chunks. */
protected chunkSize: number;
protected x: number;
size(): number;
push(chunk: Uint8Array): void;
protected assertSize(size: number): void;
u8(): number;
u32(): number;
copy(size: number, dst: Uint8Array, pos: number): void;
copyXor(size: number, dst: Uint8Array, pos: number, mask: [number, number, number, number], maskIndex: number): void;
buf(size: number): Uint8Array;
bufXor(size: number, mask: [number, number, number, number], maskIndex: number): Uint8Array;
skipUnsafe(n: number): void;
skip(n: number): void;
peek(): number;
/**
* Get current byte value without advancing the cursor.
* @deprecated Use peek() instead.
*/
peak(): number;
utf8(length: number, mask: [number, number, number, number], maskIndex: number): string;
}

View File

@@ -0,0 +1,182 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StreamingOctetReader = void 0;
const fromCharCode = String.fromCharCode;
/**
* A streaming reader which internally manages multiple chunks of
* Uint8Array instances. For performance it does not merge the chunks into
* a single Uint8Array instance. Instead it keeps track of the chunks and
* reads across chunk boundaries as needed.
*/
class StreamingOctetReader {
constructor() {
this.chunks = [];
/** Total size of all chunks. */
this.chunkSize = 0;
this.x = 0;
}
size() {
return this.chunkSize - this.x;
}
push(chunk) {
this.chunks.push(chunk);
this.chunkSize += chunk.length;
}
assertSize(size) {
if (size > this.size())
throw new RangeError('OUT_OF_BOUNDS');
}
u8() {
this.assertSize(1);
const chunk = this.chunks[0];
let x = this.x;
const octet = chunk[x++];
if (x === chunk.length) {
this.chunks.shift();
this.chunkSize -= chunk.length;
x = 0;
}
this.x = x;
return octet;
}
u32() {
const octet0 = this.u8();
const octet1 = this.u8();
const octet2 = this.u8();
const octet3 = this.u8();
return (octet0 * 0x1000000 + (octet1 << 16) + (octet2 << 8)) | octet3;
}
copy(size, dst, pos) {
if (!size)
return;
this.assertSize(size);
const chunk0 = this.chunks[0];
const size0 = Math.min(chunk0.length - this.x, size);
dst.set(chunk0.subarray(this.x, this.x + size0), pos);
size -= size0;
if (size <= 0) {
this.skipUnsafe(size0);
return;
}
let chunkIndex = 1;
while (size > 0) {
const chunk1 = this.chunks[chunkIndex];
const size1 = Math.min(chunk1.length, size);
dst.set(chunk1.subarray(0, size1), pos + size0);
size -= size1;
chunkIndex++;
}
this.skipUnsafe(size);
}
copyXor(size, dst, pos, mask, maskIndex) {
if (!size)
return;
this.assertSize(size);
const chunk0 = this.chunks[0];
let x = this.x;
const size0 = Math.min(chunk0.length - x, size);
const end = x + size0;
for (; x < end;)
dst[pos++] = chunk0[x++] ^ mask[maskIndex++ % 4];
size -= size0;
if (size <= 0) {
this.skipUnsafe(size0);
return;
}
let chunkIndex = 1;
while (size > 0) {
const chunk1 = this.chunks[chunkIndex++];
const size1 = Math.min(chunk1.length, size);
for (let x = 0; x < size1;)
dst[pos++] = chunk1[x++] ^ mask[maskIndex++ % 4];
size -= size1;
}
this.skipUnsafe(size);
}
buf(size) {
this.assertSize(size);
const buf = new Uint8Array(size);
this.copy(size, buf, 0);
return buf;
}
bufXor(size, mask, maskIndex) {
this.assertSize(size);
const buf = new Uint8Array(size);
this.copyXor(size, buf, 0, mask, maskIndex);
return buf;
}
skipUnsafe(n) {
if (!n)
return;
const chunk = this.chunks[0];
const chunkLength = chunk.length;
const remaining = chunkLength - this.x;
if (remaining > n) {
this.x = this.x + n;
return;
}
this.x = 0;
this.chunks.shift();
this.chunkSize -= chunkLength;
n -= remaining;
this.skipUnsafe(n);
}
skip(n) {
this.assertSize(n);
this.skipUnsafe(n);
}
peek() {
this.assertSize(1);
return this.chunks[0][this.x];
}
/**
* Get current byte value without advancing the cursor.
* @deprecated Use peek() instead.
*/
peak() {
return this.peek();
}
utf8(length, mask, maskIndex) {
this.assertSize(length);
let i = 0;
const points = [];
while (i < length) {
let code = this.u8() ^ mask[maskIndex++ % 4];
i++;
if ((code & 0x80) !== 0) {
const octet2 = (this.u8() ^ mask[maskIndex++ % 4]) & 0x3f;
i++;
if ((code & 0xe0) === 0xc0) {
code = ((code & 0x1f) << 6) | octet2;
}
else {
const octet3 = (this.u8() ^ mask[maskIndex++ % 4]) & 0x3f;
i++;
if ((code & 0xf0) === 0xe0) {
code = ((code & 0x1f) << 12) | (octet2 << 6) | octet3;
}
else {
if ((code & 0xf8) === 0xf0) {
const octet4 = (this.u8() ^ mask[maskIndex++ % 4]) & 0x3f;
i++;
let unit = ((code & 0x07) << 0x12) | (octet2 << 0x0c) | (octet3 << 0x06) | octet4;
if (unit > 0xffff) {
unit -= 0x10000;
const unit0 = ((unit >>> 10) & 0x3ff) | 0xd800;
code = 0xdc00 | (unit & 0x3ff);
points.push(unit0);
}
else {
code = unit;
}
}
}
}
}
points.push(code);
}
return fromCharCode.apply(String, points);
}
}
exports.StreamingOctetReader = StreamingOctetReader;
//# sourceMappingURL=StreamingOctetReader.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,78 @@
import { Writer } from './Writer';
import type { IReader, IReaderResettable } from './types';
import { Reader } from './Reader';
export declare class StreamingReader implements IReader, IReaderResettable {
protected readonly writer: Writer;
/**
* Offset from the start of the buffer (x0 in Writer).
*/
protected dx: number;
constructor(allocSize?: number);
/**
* Returns the number of bytes remaining in the buffer.
*/
size(): number;
/**
* Assert that there is enough data in the buffer to read `size` bytes.
*
* @param size Number of bytes to read.
*/
protected assertSize(size: number): void;
/**
* Add a chunk of data to be decoded. The chunk is copied into the
* internal buffer, so you can reuse the chunk after calling this method; or
* this chunk can be neutered by the caller.
*
* @param uint8 `Uint8Array` chunk of data to be decoded.
*/
push(uint8: Uint8Array): void;
/**
* Mark the current position as consumed. This will free up memory
* for reuse.
*/
consume(): void;
get uint8(): Uint8Array;
get view(): DataView;
get x(): number;
set x(x: number);
peek(): number;
/**
* Get current byte value without advancing the cursor.
* @deprecated Use peek() instead.
*/
peak(): number;
skip(length: number): void;
buf(size?: number): Uint8Array;
subarray(start?: number, end?: number): Uint8Array;
/**
* Creates a new {@link Reader} that references the same underlying memory
* buffer. But with independent cursor and end.
*
* @param start Start offset relative to the current cursor position.
* @param end End offset relative to the current cursor position.
* @returns A new {@link Reader} instance.
*/
slice(start?: number, end?: number): Reader;
/**
* Similar to {@link slice} but also advances the cursor. Returns a new
* {@link Reader} that references the same underlying memory buffer, starting
* from the current cursor position.
*
* @param size Number of bytes to cut from the current position.
* @returns A new {@link Reader} instance.
*/
cut(size?: number): Reader;
u8(): number;
i8(): number;
u16(): number;
i16(): number;
u32(): number;
i32(): number;
u64(): bigint;
i64(): bigint;
f32(): number;
f64(): number;
utf8(size: number): string;
ascii(length: number): string;
reset(uint8: Uint8Array): void;
}

View File

@@ -0,0 +1,196 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StreamingReader = void 0;
const Writer_1 = require("./Writer");
const decodeUtf8_1 = require("./utf8/decodeUtf8");
const Reader_1 = require("./Reader");
class StreamingReader {
constructor(allocSize = 16 * 1024) {
/**
* Offset from the start of the buffer (x0 in Writer).
*/
this.dx = 0;
this.writer = new Writer_1.Writer(allocSize);
}
/**
* Returns the number of bytes remaining in the buffer.
*/
size() {
return this.writer.x - this.x;
}
/**
* Assert that there is enough data in the buffer to read `size` bytes.
*
* @param size Number of bytes to read.
*/
assertSize(size) {
if (size > this.size())
throw new RangeError('OUT_OF_BOUNDS');
}
/**
* Add a chunk of data to be decoded. The chunk is copied into the
* internal buffer, so you can reuse the chunk after calling this method; or
* this chunk can be neutered by the caller.
*
* @param uint8 `Uint8Array` chunk of data to be decoded.
*/
push(uint8) {
this.writer.buf(uint8, uint8.length);
}
/**
* Mark the current position as consumed. This will free up memory
* for reuse.
*/
consume() {
this.writer.x0 += this.dx;
this.dx = 0;
}
// ------------------------------------------------------------------ IReader
get uint8() {
return this.writer.uint8;
}
get view() {
return this.writer.view;
}
get x() {
return this.writer.x0 + this.dx;
}
set x(x) {
this.dx = x - this.writer.x0;
}
peek() {
this.assertSize(1);
return this.view.getUint8(this.x);
}
/**
* Get current byte value without advancing the cursor.
* @deprecated Use peek() instead.
*/
peak() {
return this.peek();
}
skip(length) {
this.assertSize(length);
this.x += length;
}
buf(size = this.size()) {
this.assertSize(size);
const end = this.x + size;
const bin = this.uint8.subarray(this.x, end);
this.x = end;
return bin;
}
subarray(start = 0, end) {
const x = this.x;
const actualStart = x + start;
const actualEnd = typeof end === 'number' ? x + end : this.size() + x - start;
return this.uint8.subarray(actualStart, actualEnd);
}
/**
* Creates a new {@link Reader} that references the same underlying memory
* buffer. But with independent cursor and end.
*
* @param start Start offset relative to the current cursor position.
* @param end End offset relative to the current cursor position.
* @returns A new {@link Reader} instance.
*/
slice(start = 0, end) {
const x = this.x;
const actualStart = x + start;
const actualEnd = typeof end === 'number' ? x + end : this.size() + x - start;
return new Reader_1.Reader(this.uint8, this.view, actualStart, actualEnd);
}
/**
* Similar to {@link slice} but also advances the cursor. Returns a new
* {@link Reader} that references the same underlying memory buffer, starting
* from the current cursor position.
*
* @param size Number of bytes to cut from the current position.
* @returns A new {@link Reader} instance.
*/
cut(size = this.size()) {
const slice = this.slice(0, size);
this.skip(size);
return slice;
}
u8() {
this.assertSize(1);
return this.view.getUint8(this.x++);
}
i8() {
this.assertSize(1);
return this.view.getInt8(this.x++);
}
u16() {
this.assertSize(2);
const num = this.view.getUint16(this.x);
this.x += 2;
return num;
}
i16() {
this.assertSize(2);
const num = this.view.getInt16(this.x);
this.x += 2;
return num;
}
u32() {
this.assertSize(4);
const num = this.view.getUint32(this.x);
this.x += 4;
return num;
}
i32() {
this.assertSize(4);
const num = this.view.getInt32(this.x);
this.x += 4;
return num;
}
u64() {
this.assertSize(8);
const num = this.view.getBigUint64(this.x);
this.x += 8;
return num;
}
i64() {
this.assertSize(8);
const num = this.view.getBigInt64(this.x);
this.x += 8;
return num;
}
f32() {
this.assertSize(4);
const pos = this.x;
this.x += 4;
return this.view.getFloat32(pos);
}
f64() {
this.assertSize(8);
const pos = this.x;
this.x += 8;
return this.view.getFloat64(pos);
}
utf8(size) {
this.assertSize(size);
const start = this.x;
this.x += size;
return (0, decodeUtf8_1.decodeUtf8)(this.uint8, start, size);
}
ascii(length) {
this.assertSize(length);
const uint8 = this.uint8;
let str = '';
const end = this.x + length;
for (let i = this.x; i < end; i++)
str += String.fromCharCode(uint8[i]);
this.x = end;
return str;
}
// -------------------------------------------------------- IReaderResettable
reset(uint8) {
this.dx = 0;
this.writer.reset();
this.push(uint8);
}
}
exports.StreamingReader = StreamingReader;
//# sourceMappingURL=StreamingReader.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
export declare class Uint8ArrayCut {
readonly uint8: Uint8Array;
readonly start: number;
readonly size: number;
constructor(uint8: Uint8Array, start: number, size: number);
}

12
node_modules/@jsonjoy.com/buffers/lib/Uint8ArrayCut.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Uint8ArrayCut = void 0;
class Uint8ArrayCut {
constructor(uint8, start, size) {
this.uint8 = uint8;
this.start = start;
this.size = size;
}
}
exports.Uint8ArrayCut = Uint8ArrayCut;
//# sourceMappingURL=Uint8ArrayCut.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Uint8ArrayCut.js","sourceRoot":"","sources":["../src/Uint8ArrayCut.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAa;IACxB,YACkB,KAAiB,EACjB,KAAa,EACb,IAAY;QAFZ,UAAK,GAAL,KAAK,CAAY;QACjB,UAAK,GAAL,KAAK,CAAQ;QACb,SAAI,GAAJ,IAAI,CAAQ;IAC3B,CAAC;CACL;AAND,sCAMC"}

69
node_modules/@jsonjoy.com/buffers/lib/Writer.d.ts generated vendored Normal file
View File

@@ -0,0 +1,69 @@
import { Slice } from './Slice';
import type { IWriterGrowable, IWriter } from './types';
/**
* Writer class provides an efficient way to encode binary data. It grows the
* internal memory buffer automatically as more space is required. It is useful
* in cases when it is not known in advance the size of memory needed.
*/
export declare class Writer implements IWriter, IWriterGrowable {
allocSize: number;
/** @ignore */
uint8: Uint8Array;
/** @ignore */
view: DataView;
/** @ignore */
x0: number;
/** @ignore */
x: number;
protected size: number;
/**
* @param allocSize Number of bytes to allocate at a time when buffer ends.
*/
constructor(allocSize?: number);
/** @ignore */
protected grow(size: number): void;
/**
* Make sure the internal buffer has enough space to write the specified number
* of bytes, otherwise resize the internal buffer to accommodate for more size.
*
* @param capacity Number of bytes.
*/
ensureCapacity(capacity: number): void;
/** @todo Consider renaming to "skip"? */
move(capacity: number): void;
reset(): void;
/**
* Allocates a new {@link ArrayBuffer}, useful when the underlying
* {@link ArrayBuffer} cannot be shared between threads.
*
* @param size Size of memory to allocate.
*/
newBuffer(size: number): void;
/**
* @returns Encoded memory buffer contents.
*/
flush(): Uint8Array;
flushSlice(): Slice;
u8(char: number): void;
u16(word: number): void;
u32(dword: number): void;
i32(dword: number): void;
u64(qword: number | bigint): void;
f64(float: number): void;
u8u16(u8: number, u16: number): void;
u8u32(u8: number, u32: number): void;
u8u64(u8: number, u64: number | bigint): void;
u8f32(u8: number, f32: number): void;
u8f64(u8: number, f64: number): void;
buf(buf: Uint8Array, length: number): void;
/**
* Encodes string as UTF-8. You need to call .ensureCapacity(str.length * 4)
* before calling
*
* @param str String to encode as UTF-8.
* @returns The number of bytes written
*/
utf8(str: string): number;
utf8Native(str: string): number;
ascii(str: string): void;
}

254
node_modules/@jsonjoy.com/buffers/lib/Writer.js generated vendored Normal file
View File

@@ -0,0 +1,254 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Writer = void 0;
const Slice_1 = require("./Slice");
const EMPTY_UINT8 = new Uint8Array([]);
const EMPTY_VIEW = new DataView(EMPTY_UINT8.buffer);
const hasBuffer = typeof Buffer === 'function';
const utf8Write = hasBuffer
? Buffer.prototype.utf8Write
: null;
const from = hasBuffer ? Buffer.from : null;
const textEncoder = typeof TextEncoder !== 'undefined' ? new TextEncoder() : null;
/**
* Writer class provides an efficient way to encode binary data. It grows the
* internal memory buffer automatically as more space is required. It is useful
* in cases when it is not known in advance the size of memory needed.
*/
class Writer {
/**
* @param allocSize Number of bytes to allocate at a time when buffer ends.
*/
constructor(allocSize = 64 * 1024) {
this.allocSize = allocSize;
/** @ignore */
this.view = EMPTY_VIEW;
/** @ignore */
this.x0 = 0;
/** @ignore */
this.x = 0;
this.uint8 = new Uint8Array(allocSize);
this.size = allocSize;
this.view = new DataView(this.uint8.buffer);
}
/** @ignore */
grow(size) {
const x0 = this.x0;
const x = this.x;
const oldUint8 = this.uint8;
const newUint8 = new Uint8Array(size);
const view = new DataView(newUint8.buffer);
const activeSlice = oldUint8.subarray(x0, x);
newUint8.set(activeSlice, 0);
this.x = x - x0;
this.x0 = 0;
this.uint8 = newUint8;
this.size = size;
this.view = view;
}
/**
* Make sure the internal buffer has enough space to write the specified number
* of bytes, otherwise resize the internal buffer to accommodate for more size.
*
* @param capacity Number of bytes.
*/
ensureCapacity(capacity) {
const byteLength = this.size;
const remaining = byteLength - this.x;
if (remaining < capacity) {
const total = byteLength - this.x0;
const required = capacity - remaining;
const totalRequired = total + required;
this.grow(totalRequired <= this.allocSize ? this.allocSize : totalRequired * 2);
}
}
/** @todo Consider renaming to "skip"? */
move(capacity) {
this.ensureCapacity(capacity);
this.x += capacity;
}
reset() {
this.x0 = this.x;
}
/**
* Allocates a new {@link ArrayBuffer}, useful when the underlying
* {@link ArrayBuffer} cannot be shared between threads.
*
* @param size Size of memory to allocate.
*/
newBuffer(size) {
const uint8 = (this.uint8 = new Uint8Array(size));
this.size = size;
this.view = new DataView(uint8.buffer);
this.x = this.x0 = 0;
}
/**
* @returns Encoded memory buffer contents.
*/
flush() {
const result = this.uint8.subarray(this.x0, this.x);
this.x0 = this.x;
return result;
}
flushSlice() {
const slice = new Slice_1.Slice(this.uint8, this.view, this.x0, this.x);
this.x0 = this.x;
return slice;
}
u8(char) {
this.ensureCapacity(1);
this.uint8[this.x++] = char;
}
u16(word) {
this.ensureCapacity(2);
this.view.setUint16(this.x, word);
this.x += 2;
}
u32(dword) {
this.ensureCapacity(4);
this.view.setUint32(this.x, dword);
this.x += 4;
}
i32(dword) {
this.ensureCapacity(4);
this.view.setInt32(this.x, dword);
this.x += 4;
}
u64(qword) {
this.ensureCapacity(8);
this.view.setBigUint64(this.x, BigInt(qword));
this.x += 8;
}
f64(float) {
this.ensureCapacity(8);
this.view.setFloat64(this.x, float);
this.x += 8;
}
u8u16(u8, u16) {
this.ensureCapacity(3);
let x = this.x;
this.uint8[x++] = u8;
this.uint8[x++] = u16 >>> 8;
this.uint8[x++] = u16 & 0xff;
this.x = x;
}
u8u32(u8, u32) {
this.ensureCapacity(5);
let x = this.x;
this.uint8[x++] = u8;
this.view.setUint32(x, u32);
this.x = x + 4;
}
u8u64(u8, u64) {
this.ensureCapacity(9);
let x = this.x;
this.uint8[x++] = u8;
this.view.setBigUint64(x, BigInt(u64));
this.x = x + 8;
}
u8f32(u8, f32) {
this.ensureCapacity(5);
let x = this.x;
this.uint8[x++] = u8;
this.view.setFloat32(x, f32);
this.x = x + 4;
}
u8f64(u8, f64) {
this.ensureCapacity(9);
let x = this.x;
this.uint8[x++] = u8;
this.view.setFloat64(x, f64);
this.x = x + 8;
}
buf(buf, length) {
this.ensureCapacity(length);
const x = this.x;
this.uint8.set(buf, x);
this.x = x + length;
}
/**
* Encodes string as UTF-8. You need to call .ensureCapacity(str.length * 4)
* before calling
*
* @param str String to encode as UTF-8.
* @returns The number of bytes written
*/
utf8(str) {
const theoreticalMaxLength = str.length * 4;
if (theoreticalMaxLength < 168)
return this.utf8Native(str);
this.ensureCapacity(theoreticalMaxLength);
const maxLength = this.size - this.x;
if (utf8Write) {
const writeLength = utf8Write.call(this.uint8, str, this.x, maxLength);
this.x += writeLength;
return writeLength;
}
else if (from) {
const uint8 = this.uint8;
const offset = uint8.byteOffset + this.x;
const buf = from(uint8.buffer).subarray(offset, offset + maxLength);
const writeLength = buf.write(str, 0, maxLength, 'utf8');
this.x += writeLength;
return writeLength;
}
else if (theoreticalMaxLength > 1024 && textEncoder) {
const writeLength = textEncoder.encodeInto(str, this.uint8.subarray(this.x, this.x + maxLength)).written;
this.x += writeLength;
return writeLength;
}
return this.utf8Native(str);
}
utf8Native(str) {
const length = str.length;
const uint8 = this.uint8;
let offset = this.x;
let pos = 0;
while (pos < length) {
let value = str.charCodeAt(pos++);
if ((value & 0xffffff80) === 0) {
uint8[offset++] = value;
continue;
}
else if ((value & 0xfffff800) === 0) {
uint8[offset++] = ((value >> 6) & 0x1f) | 0xc0;
}
else {
if (value >= 0xd800 && value <= 0xdbff) {
if (pos < length) {
const extra = str.charCodeAt(pos);
if ((extra & 0xfc00) === 0xdc00) {
pos++;
value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;
}
}
}
if ((value & 0xffff0000) === 0) {
uint8[offset++] = ((value >> 12) & 0x0f) | 0xe0;
uint8[offset++] = ((value >> 6) & 0x3f) | 0x80;
}
else {
uint8[offset++] = ((value >> 18) & 0x07) | 0xf0;
uint8[offset++] = ((value >> 12) & 0x3f) | 0x80;
uint8[offset++] = ((value >> 6) & 0x3f) | 0x80;
}
}
uint8[offset++] = (value & 0x3f) | 0x80;
}
const writeLength = offset - this.x;
this.x = offset;
return writeLength;
}
ascii(str) {
const length = str.length;
this.ensureCapacity(length);
const uint8 = this.uint8;
let x = this.x;
let pos = 0;
while (pos < length)
uint8[x++] = str.charCodeAt(pos++);
this.x = x;
}
}
exports.Writer = Writer;
//# sourceMappingURL=Writer.js.map

1
node_modules/@jsonjoy.com/buffers/lib/Writer.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/@jsonjoy.com/buffers/lib/b.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare const b: (...args: number[]) => Uint8Array<ArrayBuffer>;

6
node_modules/@jsonjoy.com/buffers/lib/b.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.b = void 0;
const b = (...args) => new Uint8Array(args);
exports.b = b;
//# sourceMappingURL=b.js.map

1
node_modules/@jsonjoy.com/buffers/lib/b.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"b.js","sourceRoot":"","sources":["../src/b.ts"],"names":[],"mappings":";;;AAAO,MAAM,CAAC,GAAG,CAAC,GAAG,IAAc,EAAE,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;AAAhD,QAAA,CAAC,KAA+C"}

View File

@@ -0,0 +1 @@
export declare const bufferToUint8Array: (buf: Buffer) => Uint8Array;

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bufferToUint8Array = void 0;
const bufferToUint8Array = (buf) => new Uint8Array(buf.buffer, buf.byteOffset, buf.length);
exports.bufferToUint8Array = bufferToUint8Array;
//# sourceMappingURL=bufferToUint8Array.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"bufferToUint8Array.js","sourceRoot":"","sources":["../src/bufferToUint8Array.ts"],"names":[],"mappings":";;;AAAO,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAc,EAAE,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;AAAzG,QAAA,kBAAkB,sBAAuF"}

View File

@@ -0,0 +1 @@
export declare const cmpUint8Array: (a: Uint8Array, b: Uint8Array) => boolean;

14
node_modules/@jsonjoy.com/buffers/lib/cmpUint8Array.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cmpUint8Array = void 0;
const cmpUint8Array = (a, b) => {
const length = a.length;
if (length !== b.length)
return false;
for (let i = 0; i < length; i++)
if (a[i] !== b[i])
return false;
return true;
};
exports.cmpUint8Array = cmpUint8Array;
//# sourceMappingURL=cmpUint8Array.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"cmpUint8Array.js","sourceRoot":"","sources":["../src/cmpUint8Array.ts"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,GAAG,CAAC,CAAa,EAAE,CAAa,EAAW,EAAE;IACrE,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACxB,IAAI,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE;QAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IACjE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AALW,QAAA,aAAa,iBAKxB"}

View File

@@ -0,0 +1,9 @@
/**
* Compares two `Uint8Arrays` byte-by-byte. Returns a negative number if `a` is
* less than `b`, a positive number if `a` is greater than `b`, or 0 if `a` is
* equal to `b`.
*
* @returns A negative number if a is less than b, a positive number if a is
* greater than b, or 0 if a is equal to b.
*/
export declare const cmpUint8Array2: (a: Uint8Array, b: Uint8Array) => number;

View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cmpUint8Array2 = void 0;
/**
* Compares two `Uint8Arrays` byte-by-byte. Returns a negative number if `a` is
* less than `b`, a positive number if `a` is greater than `b`, or 0 if `a` is
* equal to `b`.
*
* @returns A negative number if a is less than b, a positive number if a is
* greater than b, or 0 if a is equal to b.
*/
const cmpUint8Array2 = (a, b) => {
const len1 = a.length;
const len2 = b.length;
const len = Math.min(len1, len2);
for (let i = 0; i < len; i++) {
const diffChar = a[i] - b[i];
if (diffChar !== 0)
return diffChar;
}
return len1 - len2;
};
exports.cmpUint8Array2 = cmpUint8Array2;
//# sourceMappingURL=cmpUint8Array2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"cmpUint8Array2.js","sourceRoot":"","sources":["../src/cmpUint8Array2.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACI,MAAM,cAAc,GAAG,CAAC,CAAa,EAAE,CAAa,EAAU,EAAE;IACrE,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,QAAQ,KAAK,CAAC;YAAE,OAAO,QAAQ,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,GAAG,IAAI,CAAC;AACrB,CAAC,CAAC;AATW,QAAA,cAAc,kBASzB"}

View File

@@ -0,0 +1,9 @@
/**
* Compares two `Uint8Arrays`, first by length, then by each byte. Returns a
* negative number if `a` is less than `b`, a positive number if `a` is greater
* than `b`, or 0 if `a` is equal to `b`.
*
* @returns A negative number if a is less than b, a positive number if a is
* greater than b, or 0 if a is equal to b.
*/
export declare const cmpUint8Array3: (a: Uint8Array, b: Uint8Array) => number;

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cmpUint8Array3 = void 0;
/**
* Compares two `Uint8Arrays`, first by length, then by each byte. Returns a
* negative number if `a` is less than `b`, a positive number if `a` is greater
* than `b`, or 0 if `a` is equal to `b`.
*
* @returns A negative number if a is less than b, a positive number if a is
* greater than b, or 0 if a is equal to b.
*/
const cmpUint8Array3 = (a, b) => {
const len1 = a.length;
const len2 = b.length;
const diff = len1 - len2;
if (diff !== 0)
return diff;
for (let i = 0; i < len1; i++) {
const diff = a[i] - b[i];
if (diff !== 0)
return diff;
}
return 0;
};
exports.cmpUint8Array3 = cmpUint8Array3;
//# sourceMappingURL=cmpUint8Array3.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"cmpUint8Array3.js","sourceRoot":"","sources":["../src/cmpUint8Array3.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACI,MAAM,cAAc,GAAG,CAAC,CAAa,EAAE,CAAa,EAAU,EAAE;IACrE,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACzB,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,IAAI,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;IAC9B,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAVW,QAAA,cAAc,kBAUzB"}

3
node_modules/@jsonjoy.com/buffers/lib/concat.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export declare const concat: (a: Uint8Array, b: Uint8Array) => Uint8Array;
export declare const concatList: (list: Uint8Array[]) => Uint8Array;
export declare const listToUint8: (list: Uint8Array[]) => Uint8Array;

36
node_modules/@jsonjoy.com/buffers/lib/concat.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listToUint8 = exports.concatList = exports.concat = void 0;
const concat = (a, b) => {
const res = new Uint8Array(a.length + b.length);
res.set(a);
res.set(b, a.length);
return res;
};
exports.concat = concat;
const concatList = (list) => {
const length = list.length;
let size = 0, offset = 0;
for (let i = 0; i < length; i++)
size += list[i].length;
const res = new Uint8Array(size);
for (let i = 0; i < length; i++) {
const item = list[i];
res.set(item, offset);
offset += item.length;
}
return res;
};
exports.concatList = concatList;
const listToUint8 = (list) => {
switch (list.length) {
case 0:
return new Uint8Array(0);
case 1:
return list[0];
default:
return (0, exports.concatList)(list);
}
};
exports.listToUint8 = listToUint8;
//# sourceMappingURL=concat.js.map

1
node_modules/@jsonjoy.com/buffers/lib/concat.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"concat.js","sourceRoot":"","sources":["../src/concat.ts"],"names":[],"mappings":";;;AAAO,MAAM,MAAM,GAAG,CAAC,CAAa,EAAE,CAAa,EAAc,EAAE;IACjE,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IAChD,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACX,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AALW,QAAA,MAAM,UAKjB;AAEK,MAAM,UAAU,GAAG,CAAC,IAAkB,EAAc,EAAE;IAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,IAAI,IAAI,GAAG,CAAC,EACV,MAAM,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE;QAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACxD,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;IACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACrB,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACtB,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;IACxB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAZW,QAAA,UAAU,cAYrB;AAEK,MAAM,WAAW,GAAG,CAAC,IAAkB,EAAc,EAAE;IAC5D,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;QACpB,KAAK,CAAC;YACJ,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;QAC3B,KAAK,CAAC;YACJ,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB;YACE,OAAO,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;AACH,CAAC,CAAC;AATW,QAAA,WAAW,eAStB"}

1
node_modules/@jsonjoy.com/buffers/lib/copy.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare const copy: <T extends Uint8Array>(arr: T) => T;

10
node_modules/@jsonjoy.com/buffers/lib/copy.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.copy = void 0;
const copy = (arr) => {
const dupe = new Uint8Array(arr.length);
dupe.set(arr);
return dupe;
};
exports.copy = copy;
//# sourceMappingURL=copy.js.map

1
node_modules/@jsonjoy.com/buffers/lib/copy.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../src/copy.ts"],"names":[],"mappings":";;;AAAO,MAAM,IAAI,GAAG,CAAuB,GAAM,EAAK,EAAE;IACtD,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,CAAM,CAAC;IAC7C,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACd,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAJW,QAAA,IAAI,QAIf"}

1
node_modules/@jsonjoy.com/buffers/lib/f16.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare const decodeF16: (binary: number) => number;

18
node_modules/@jsonjoy.com/buffers/lib/f16.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decodeF16 = void 0;
const pow = Math.pow;
const decodeF16 = (binary) => {
const exponent = (binary & 0x7c00) >> 10;
const fraction = binary & 0x03ff;
return ((binary >> 15 ? -1 : 1) *
(exponent
? exponent === 0x1f
? fraction
? NaN
: Infinity
: pow(2, exponent - 15) * (1 + fraction / 0x400)
: 6.103515625e-5 * (fraction / 0x400)));
};
exports.decodeF16 = decodeF16;
//# sourceMappingURL=f16.js.map

1
node_modules/@jsonjoy.com/buffers/lib/f16.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"f16.js","sourceRoot":"","sources":["../src/f16.ts"],"names":[],"mappings":";;;AAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;AAEd,MAAM,SAAS,GAAG,CAAC,MAAc,EAAU,EAAE;IAClD,MAAM,QAAQ,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IACzC,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,OAAO,CACL,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC,QAAQ;YACP,CAAC,CAAC,QAAQ,KAAK,IAAI;gBACjB,CAAC,CAAC,QAAQ;oBACR,CAAC,CAAC,GAAG;oBACL,CAAC,CAAC,QAAQ;gBACZ,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,GAAG,KAAK,CAAC;YAClD,CAAC,CAAC,cAAc,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,CACzC,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,SAAS,aAapB"}

1
node_modules/@jsonjoy.com/buffers/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export * from './types';

5
node_modules/@jsonjoy.com/buffers/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./types"), exports);
//# sourceMappingURL=index.js.map

Some files were not shown because too many files have changed in this diff Show More