musicxml-io 0.8.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -3
- package/dist/accessors/index.d.mts +185 -0
- package/dist/accessors/index.d.ts +185 -0
- package/dist/accessors/index.js +58 -0
- package/dist/accessors/index.mjs +58 -0
- package/dist/browser.d.mts +171 -0
- package/dist/browser.d.ts +171 -0
- package/dist/browser.js +510 -0
- package/dist/browser.mjs +510 -0
- package/dist/chunk-53J57HX6.mjs +7645 -0
- package/dist/{chunk-KJXV3TD4.js → chunk-BQKGH2LT.js} +22 -3
- package/dist/chunk-C6ZNOTY2.js +7645 -0
- package/dist/{chunk-D5NOEHYN.mjs → chunk-CLONJVWZ.mjs} +22 -3
- package/dist/chunk-OEX7NVZN.js +120 -0
- package/dist/chunk-R6JMBTUB.mjs +120 -0
- package/dist/{index-_2RxeLOf.d.mts → index-BGUfI7Li.d.mts} +2 -2
- package/dist/{index-rtFmAs-i.d.ts → index-se1B-IZl.d.ts} +2 -2
- package/dist/index.d.mts +8 -350
- package/dist/index.d.ts +8 -350
- package/dist/index.js +45 -7715
- package/dist/index.mjs +42 -7712
- package/dist/operations/index.d.mts +2 -2
- package/dist/operations/index.d.ts +2 -2
- package/dist/operations/index.js +2 -2
- package/dist/operations/index.mjs +1 -1
- package/dist/query/index.d.mts +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/{types-CzsW5TLm.d.mts → types-B_6pqTfs.d.mts} +1 -1
- package/dist/{types-CzsW5TLm.d.ts → types-B_6pqTfs.d.ts} +1 -1
- package/package.json +12 -2
|
@@ -11,11 +11,30 @@
|
|
|
11
11
|
var _chunkEWLB5X64js = require('./chunk-EWLB5X64.js');
|
|
12
12
|
|
|
13
13
|
// src/id.ts
|
|
14
|
-
var _nanoid = require('nanoid');
|
|
15
14
|
var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-";
|
|
16
|
-
var
|
|
15
|
+
var ID_LENGTH = 10;
|
|
16
|
+
var POOL_SIZE = ID_LENGTH * 128;
|
|
17
|
+
var pool;
|
|
18
|
+
var poolOffset = 0;
|
|
19
|
+
function randomBytes() {
|
|
20
|
+
if (pool === void 0 || poolOffset + ID_LENGTH > POOL_SIZE) {
|
|
21
|
+
if (pool === void 0) {
|
|
22
|
+
pool = new Uint8Array(POOL_SIZE);
|
|
23
|
+
}
|
|
24
|
+
globalThis.crypto.getRandomValues(pool);
|
|
25
|
+
poolOffset = 0;
|
|
26
|
+
}
|
|
27
|
+
const bytes = pool.subarray(poolOffset, poolOffset + ID_LENGTH);
|
|
28
|
+
poolOffset += ID_LENGTH;
|
|
29
|
+
return bytes;
|
|
30
|
+
}
|
|
17
31
|
function generateId() {
|
|
18
|
-
|
|
32
|
+
const bytes = randomBytes();
|
|
33
|
+
let id = "i";
|
|
34
|
+
for (let i = 0; i < ID_LENGTH; i++) {
|
|
35
|
+
id += ALPHABET[bytes[i] & 63];
|
|
36
|
+
}
|
|
37
|
+
return id;
|
|
19
38
|
}
|
|
20
39
|
|
|
21
40
|
// src/validator/index.ts
|