@karmaniverous/entity-manager 6.1.0-5 → 6.1.0
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/dist/cjs/{src/EntityManager.js → EntityManager.js} +4 -4
- package/dist/cjs/{src/EntityManagerClient.js → EntityManagerClient.js} +6 -6
- package/dist/cjs/{src/ParsedConfig.js → ParsedConfig.js} +52 -52
- package/dist/cjs/{src/addKeys.js → addKeys.js} +2 -2
- package/dist/cjs/{src/decodeGeneratedProperty.js → decodeGeneratedProperty.js} +2 -2
- package/dist/cjs/{src/encodeGeneratedProperty.js → encodeGeneratedProperty.js} +2 -2
- package/dist/cjs/{src/getHashKeySpace.js → getHashKeySpace.js} +2 -2
- package/dist/cjs/{src/query.js → query.js} +7 -9
- package/dist/cjs/{src/rehydrateIndexItem.js → rehydrateIndexItem.js} +2 -3
- package/dist/cjs/{src/rehydratePageKeyMap.js → rehydratePageKeyMap.js} +4 -5
- package/dist/cjs/{src/unwrapIndex.js → unwrapIndex.js} +2 -2
- package/dist/cjs/{src/updateItemHashKey.js → updateItemHashKey.js} +5 -5
- package/dist/cjs/{src/updateItemRangeKey.js → updateItemRangeKey.js} +2 -2
- package/dist/mjs/{src/EntityManager.js → EntityManager.js} +1 -1
- package/dist/mjs/{src/EntityManagerClient.js → EntityManagerClient.js} +2 -2
- package/dist/mjs/{src/ParsedConfig.js → ParsedConfig.js} +3 -3
- package/dist/mjs/{src/addKeys.js → addKeys.js} +1 -1
- package/dist/mjs/{src/decodeGeneratedProperty.js → decodeGeneratedProperty.js} +1 -1
- package/dist/mjs/{src/encodeGeneratedProperty.js → encodeGeneratedProperty.js} +1 -1
- package/dist/mjs/{src/getHashKeySpace.js → getHashKeySpace.js} +1 -1
- package/dist/mjs/{src/query.js → query.js} +3 -5
- package/dist/mjs/{src/rehydrateIndexItem.js → rehydrateIndexItem.js} +1 -2
- package/dist/mjs/{src/rehydratePageKeyMap.js → rehydratePageKeyMap.js} +1 -2
- package/dist/mjs/{src/unwrapIndex.js → unwrapIndex.js} +1 -1
- package/dist/mjs/{src/updateItemHashKey.js → updateItemHashKey.js} +2 -2
- package/dist/mjs/{src/updateItemRangeKey.js → updateItemRangeKey.js} +1 -1
- package/package.json +6 -6
- package/dist/cjs/_virtual/_commonjsHelpers.js +0 -7
- package/dist/cjs/_virtual/index.js +0 -9
- package/dist/cjs/_virtual/lz-string.js +0 -9
- package/dist/cjs/_virtual/lz-string2.js +0 -5
- package/dist/cjs/node_modules/@karmaniverous/entity-tools/dist/mjs/Nil.js +0 -14
- package/dist/cjs/node_modules/@karmaniverous/entity-tools/dist/mjs/defaultTranscodes.js +0 -94
- package/dist/cjs/node_modules/@karmaniverous/entity-tools/dist/mjs/sort.js +0 -52
- package/dist/cjs/node_modules/lz-string/libs/lz-string.js +0 -520
- package/dist/cjs/node_modules/radash/dist/esm/array.js +0 -90
- package/dist/cjs/node_modules/radash/dist/esm/async.js +0 -62
- package/dist/cjs/node_modules/radash/dist/esm/object.js +0 -25
- package/dist/cjs/node_modules/radash/dist/esm/typed.js +0 -35
- package/dist/cjs/node_modules/string-hash/index.js +0 -28
- package/dist/cjs/node_modules/tslib/tslib.es6.js +0 -39
- package/dist/cjs/node_modules/zod/lib/index.js +0 -4342
- package/dist/mjs/_virtual/_commonjsHelpers.js +0 -5
- package/dist/mjs/_virtual/index.js +0 -7
- package/dist/mjs/_virtual/lz-string.js +0 -7
- package/dist/mjs/_virtual/lz-string2.js +0 -3
- package/dist/mjs/node_modules/@karmaniverous/entity-tools/dist/mjs/Nil.js +0 -12
- package/dist/mjs/node_modules/@karmaniverous/entity-tools/dist/mjs/defaultTranscodes.js +0 -92
- package/dist/mjs/node_modules/@karmaniverous/entity-tools/dist/mjs/sort.js +0 -50
- package/dist/mjs/node_modules/lz-string/libs/lz-string.js +0 -518
- package/dist/mjs/node_modules/radash/dist/esm/array.js +0 -80
- package/dist/mjs/node_modules/radash/dist/esm/async.js +0 -58
- package/dist/mjs/node_modules/radash/dist/esm/object.js +0 -22
- package/dist/mjs/node_modules/radash/dist/esm/typed.js +0 -28
- package/dist/mjs/node_modules/string-hash/index.js +0 -26
- package/dist/mjs/node_modules/tslib/tslib.es6.js +0 -36
- package/dist/mjs/node_modules/zod/lib/index.js +0 -4233
- /package/dist/cjs/{src/conditionalize.js → conditionalize.js} +0 -0
- /package/dist/cjs/{src/decodeEntityElement.js → decodeEntityElement.js} +0 -0
- /package/dist/cjs/{src/dehydrateIndexItem.js → dehydrateIndexItem.js} +0 -0
- /package/dist/cjs/{src/dehydratePageKeyMap.js → dehydratePageKeyMap.js} +0 -0
- /package/dist/cjs/{src/encodeEntityElement.js → encodeEntityElement.js} +0 -0
- /package/dist/cjs/{src/getShardBump.js → getShardBump.js} +0 -0
- /package/dist/cjs/{src/index.js → index.js} +0 -0
- /package/dist/cjs/{src/removeKeys.js → removeKeys.js} +0 -0
- /package/dist/cjs/{src/validateEntityGeneratedProperty.js → validateEntityGeneratedProperty.js} +0 -0
- /package/dist/cjs/{src/validateEntityIndexToken.js → validateEntityIndexToken.js} +0 -0
- /package/dist/cjs/{src/validateEntityToken.js → validateEntityToken.js} +0 -0
- /package/dist/mjs/{src/conditionalize.js → conditionalize.js} +0 -0
- /package/dist/mjs/{src/decodeEntityElement.js → decodeEntityElement.js} +0 -0
- /package/dist/mjs/{src/dehydrateIndexItem.js → dehydrateIndexItem.js} +0 -0
- /package/dist/mjs/{src/dehydratePageKeyMap.js → dehydratePageKeyMap.js} +0 -0
- /package/dist/mjs/{src/encodeEntityElement.js → encodeEntityElement.js} +0 -0
- /package/dist/mjs/{src/getShardBump.js → getShardBump.js} +0 -0
- /package/dist/mjs/{src/index.js → index.js} +0 -0
- /package/dist/mjs/{src/removeKeys.js → removeKeys.js} +0 -0
- /package/dist/mjs/{src/validateEntityGeneratedProperty.js → validateEntityGeneratedProperty.js} +0 -0
- /package/dist/mjs/{src/validateEntityIndexToken.js → validateEntityIndexToken.js} +0 -0
- /package/dist/mjs/{src/validateEntityToken.js → validateEntityToken.js} +0 -0
|
@@ -1,520 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var lzString = require('../../../_virtual/lz-string2.js');
|
|
4
|
-
|
|
5
|
-
lzString.__module.exports;
|
|
6
|
-
|
|
7
|
-
var hasRequiredLzString;
|
|
8
|
-
|
|
9
|
-
function requireLzString () {
|
|
10
|
-
if (hasRequiredLzString) return lzString.__module.exports;
|
|
11
|
-
hasRequiredLzString = 1;
|
|
12
|
-
(function (module) {
|
|
13
|
-
// Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net>
|
|
14
|
-
// This work is free. You can redistribute it and/or modify it
|
|
15
|
-
// under the terms of the WTFPL, Version 2
|
|
16
|
-
// For more information see LICENSE.txt or http://www.wtfpl.net/
|
|
17
|
-
//
|
|
18
|
-
// For more information, the home page:
|
|
19
|
-
// http://pieroxy.net/blog/pages/lz-string/testing.html
|
|
20
|
-
//
|
|
21
|
-
// LZ-based compression algorithm, version 1.4.5
|
|
22
|
-
var LZString = (function() {
|
|
23
|
-
|
|
24
|
-
// private property
|
|
25
|
-
var f = String.fromCharCode;
|
|
26
|
-
var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
27
|
-
var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
|
|
28
|
-
var baseReverseDic = {};
|
|
29
|
-
|
|
30
|
-
function getBaseValue(alphabet, character) {
|
|
31
|
-
if (!baseReverseDic[alphabet]) {
|
|
32
|
-
baseReverseDic[alphabet] = {};
|
|
33
|
-
for (var i=0 ; i<alphabet.length ; i++) {
|
|
34
|
-
baseReverseDic[alphabet][alphabet.charAt(i)] = i;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return baseReverseDic[alphabet][character];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
var LZString = {
|
|
41
|
-
compressToBase64 : function (input) {
|
|
42
|
-
if (input == null) return "";
|
|
43
|
-
var res = LZString._compress(input, 6, function(a){return keyStrBase64.charAt(a);});
|
|
44
|
-
switch (res.length % 4) { // To produce valid Base64
|
|
45
|
-
default: // When could this happen ?
|
|
46
|
-
case 0 : return res;
|
|
47
|
-
case 1 : return res+"===";
|
|
48
|
-
case 2 : return res+"==";
|
|
49
|
-
case 3 : return res+"=";
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
decompressFromBase64 : function (input) {
|
|
54
|
-
if (input == null) return "";
|
|
55
|
-
if (input == "") return null;
|
|
56
|
-
return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrBase64, input.charAt(index)); });
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
compressToUTF16 : function (input) {
|
|
60
|
-
if (input == null) return "";
|
|
61
|
-
return LZString._compress(input, 15, function(a){return f(a+32);}) + " ";
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
decompressFromUTF16: function (compressed) {
|
|
65
|
-
if (compressed == null) return "";
|
|
66
|
-
if (compressed == "") return null;
|
|
67
|
-
return LZString._decompress(compressed.length, 16384, function(index) { return compressed.charCodeAt(index) - 32; });
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
//compress into uint8array (UCS-2 big endian format)
|
|
71
|
-
compressToUint8Array: function (uncompressed) {
|
|
72
|
-
var compressed = LZString.compress(uncompressed);
|
|
73
|
-
var buf=new Uint8Array(compressed.length*2); // 2 bytes per character
|
|
74
|
-
|
|
75
|
-
for (var i=0, TotalLen=compressed.length; i<TotalLen; i++) {
|
|
76
|
-
var current_value = compressed.charCodeAt(i);
|
|
77
|
-
buf[i*2] = current_value >>> 8;
|
|
78
|
-
buf[i*2+1] = current_value % 256;
|
|
79
|
-
}
|
|
80
|
-
return buf;
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
//decompress from uint8array (UCS-2 big endian format)
|
|
84
|
-
decompressFromUint8Array:function (compressed) {
|
|
85
|
-
if (compressed===null || compressed===undefined){
|
|
86
|
-
return LZString.decompress(compressed);
|
|
87
|
-
} else {
|
|
88
|
-
var buf=new Array(compressed.length/2); // 2 bytes per character
|
|
89
|
-
for (var i=0, TotalLen=buf.length; i<TotalLen; i++) {
|
|
90
|
-
buf[i]=compressed[i*2]*256+compressed[i*2+1];
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
var result = [];
|
|
94
|
-
buf.forEach(function (c) {
|
|
95
|
-
result.push(f(c));
|
|
96
|
-
});
|
|
97
|
-
return LZString.decompress(result.join(''));
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
//compress into a string that is already URI encoded
|
|
105
|
-
compressToEncodedURIComponent: function (input) {
|
|
106
|
-
if (input == null) return "";
|
|
107
|
-
return LZString._compress(input, 6, function(a){return keyStrUriSafe.charAt(a);});
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
//decompress from an output of compressToEncodedURIComponent
|
|
111
|
-
decompressFromEncodedURIComponent:function (input) {
|
|
112
|
-
if (input == null) return "";
|
|
113
|
-
if (input == "") return null;
|
|
114
|
-
input = input.replace(/ /g, "+");
|
|
115
|
-
return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrUriSafe, input.charAt(index)); });
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
compress: function (uncompressed) {
|
|
119
|
-
return LZString._compress(uncompressed, 16, function(a){return f(a);});
|
|
120
|
-
},
|
|
121
|
-
_compress: function (uncompressed, bitsPerChar, getCharFromInt) {
|
|
122
|
-
if (uncompressed == null) return "";
|
|
123
|
-
var i, value,
|
|
124
|
-
context_dictionary= {},
|
|
125
|
-
context_dictionaryToCreate= {},
|
|
126
|
-
context_c="",
|
|
127
|
-
context_wc="",
|
|
128
|
-
context_w="",
|
|
129
|
-
context_enlargeIn= 2, // Compensate for the first entry which should not count
|
|
130
|
-
context_dictSize= 3,
|
|
131
|
-
context_numBits= 2,
|
|
132
|
-
context_data=[],
|
|
133
|
-
context_data_val=0,
|
|
134
|
-
context_data_position=0,
|
|
135
|
-
ii;
|
|
136
|
-
|
|
137
|
-
for (ii = 0; ii < uncompressed.length; ii += 1) {
|
|
138
|
-
context_c = uncompressed.charAt(ii);
|
|
139
|
-
if (!Object.prototype.hasOwnProperty.call(context_dictionary,context_c)) {
|
|
140
|
-
context_dictionary[context_c] = context_dictSize++;
|
|
141
|
-
context_dictionaryToCreate[context_c] = true;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
context_wc = context_w + context_c;
|
|
145
|
-
if (Object.prototype.hasOwnProperty.call(context_dictionary,context_wc)) {
|
|
146
|
-
context_w = context_wc;
|
|
147
|
-
} else {
|
|
148
|
-
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {
|
|
149
|
-
if (context_w.charCodeAt(0)<256) {
|
|
150
|
-
for (i=0 ; i<context_numBits ; i++) {
|
|
151
|
-
context_data_val = (context_data_val << 1);
|
|
152
|
-
if (context_data_position == bitsPerChar-1) {
|
|
153
|
-
context_data_position = 0;
|
|
154
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
155
|
-
context_data_val = 0;
|
|
156
|
-
} else {
|
|
157
|
-
context_data_position++;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
value = context_w.charCodeAt(0);
|
|
161
|
-
for (i=0 ; i<8 ; i++) {
|
|
162
|
-
context_data_val = (context_data_val << 1) | (value&1);
|
|
163
|
-
if (context_data_position == bitsPerChar-1) {
|
|
164
|
-
context_data_position = 0;
|
|
165
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
166
|
-
context_data_val = 0;
|
|
167
|
-
} else {
|
|
168
|
-
context_data_position++;
|
|
169
|
-
}
|
|
170
|
-
value = value >> 1;
|
|
171
|
-
}
|
|
172
|
-
} else {
|
|
173
|
-
value = 1;
|
|
174
|
-
for (i=0 ; i<context_numBits ; i++) {
|
|
175
|
-
context_data_val = (context_data_val << 1) | value;
|
|
176
|
-
if (context_data_position ==bitsPerChar-1) {
|
|
177
|
-
context_data_position = 0;
|
|
178
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
179
|
-
context_data_val = 0;
|
|
180
|
-
} else {
|
|
181
|
-
context_data_position++;
|
|
182
|
-
}
|
|
183
|
-
value = 0;
|
|
184
|
-
}
|
|
185
|
-
value = context_w.charCodeAt(0);
|
|
186
|
-
for (i=0 ; i<16 ; i++) {
|
|
187
|
-
context_data_val = (context_data_val << 1) | (value&1);
|
|
188
|
-
if (context_data_position == bitsPerChar-1) {
|
|
189
|
-
context_data_position = 0;
|
|
190
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
191
|
-
context_data_val = 0;
|
|
192
|
-
} else {
|
|
193
|
-
context_data_position++;
|
|
194
|
-
}
|
|
195
|
-
value = value >> 1;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
context_enlargeIn--;
|
|
199
|
-
if (context_enlargeIn == 0) {
|
|
200
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
201
|
-
context_numBits++;
|
|
202
|
-
}
|
|
203
|
-
delete context_dictionaryToCreate[context_w];
|
|
204
|
-
} else {
|
|
205
|
-
value = context_dictionary[context_w];
|
|
206
|
-
for (i=0 ; i<context_numBits ; i++) {
|
|
207
|
-
context_data_val = (context_data_val << 1) | (value&1);
|
|
208
|
-
if (context_data_position == bitsPerChar-1) {
|
|
209
|
-
context_data_position = 0;
|
|
210
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
211
|
-
context_data_val = 0;
|
|
212
|
-
} else {
|
|
213
|
-
context_data_position++;
|
|
214
|
-
}
|
|
215
|
-
value = value >> 1;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
context_enlargeIn--;
|
|
221
|
-
if (context_enlargeIn == 0) {
|
|
222
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
223
|
-
context_numBits++;
|
|
224
|
-
}
|
|
225
|
-
// Add wc to the dictionary.
|
|
226
|
-
context_dictionary[context_wc] = context_dictSize++;
|
|
227
|
-
context_w = String(context_c);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// Output the code for w.
|
|
232
|
-
if (context_w !== "") {
|
|
233
|
-
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {
|
|
234
|
-
if (context_w.charCodeAt(0)<256) {
|
|
235
|
-
for (i=0 ; i<context_numBits ; i++) {
|
|
236
|
-
context_data_val = (context_data_val << 1);
|
|
237
|
-
if (context_data_position == bitsPerChar-1) {
|
|
238
|
-
context_data_position = 0;
|
|
239
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
240
|
-
context_data_val = 0;
|
|
241
|
-
} else {
|
|
242
|
-
context_data_position++;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
value = context_w.charCodeAt(0);
|
|
246
|
-
for (i=0 ; i<8 ; i++) {
|
|
247
|
-
context_data_val = (context_data_val << 1) | (value&1);
|
|
248
|
-
if (context_data_position == bitsPerChar-1) {
|
|
249
|
-
context_data_position = 0;
|
|
250
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
251
|
-
context_data_val = 0;
|
|
252
|
-
} else {
|
|
253
|
-
context_data_position++;
|
|
254
|
-
}
|
|
255
|
-
value = value >> 1;
|
|
256
|
-
}
|
|
257
|
-
} else {
|
|
258
|
-
value = 1;
|
|
259
|
-
for (i=0 ; i<context_numBits ; i++) {
|
|
260
|
-
context_data_val = (context_data_val << 1) | value;
|
|
261
|
-
if (context_data_position == bitsPerChar-1) {
|
|
262
|
-
context_data_position = 0;
|
|
263
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
264
|
-
context_data_val = 0;
|
|
265
|
-
} else {
|
|
266
|
-
context_data_position++;
|
|
267
|
-
}
|
|
268
|
-
value = 0;
|
|
269
|
-
}
|
|
270
|
-
value = context_w.charCodeAt(0);
|
|
271
|
-
for (i=0 ; i<16 ; i++) {
|
|
272
|
-
context_data_val = (context_data_val << 1) | (value&1);
|
|
273
|
-
if (context_data_position == bitsPerChar-1) {
|
|
274
|
-
context_data_position = 0;
|
|
275
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
276
|
-
context_data_val = 0;
|
|
277
|
-
} else {
|
|
278
|
-
context_data_position++;
|
|
279
|
-
}
|
|
280
|
-
value = value >> 1;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
context_enlargeIn--;
|
|
284
|
-
if (context_enlargeIn == 0) {
|
|
285
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
286
|
-
context_numBits++;
|
|
287
|
-
}
|
|
288
|
-
delete context_dictionaryToCreate[context_w];
|
|
289
|
-
} else {
|
|
290
|
-
value = context_dictionary[context_w];
|
|
291
|
-
for (i=0 ; i<context_numBits ; i++) {
|
|
292
|
-
context_data_val = (context_data_val << 1) | (value&1);
|
|
293
|
-
if (context_data_position == bitsPerChar-1) {
|
|
294
|
-
context_data_position = 0;
|
|
295
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
296
|
-
context_data_val = 0;
|
|
297
|
-
} else {
|
|
298
|
-
context_data_position++;
|
|
299
|
-
}
|
|
300
|
-
value = value >> 1;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
305
|
-
context_enlargeIn--;
|
|
306
|
-
if (context_enlargeIn == 0) {
|
|
307
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
308
|
-
context_numBits++;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
// Mark the end of the stream
|
|
313
|
-
value = 2;
|
|
314
|
-
for (i=0 ; i<context_numBits ; i++) {
|
|
315
|
-
context_data_val = (context_data_val << 1) | (value&1);
|
|
316
|
-
if (context_data_position == bitsPerChar-1) {
|
|
317
|
-
context_data_position = 0;
|
|
318
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
319
|
-
context_data_val = 0;
|
|
320
|
-
} else {
|
|
321
|
-
context_data_position++;
|
|
322
|
-
}
|
|
323
|
-
value = value >> 1;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
// Flush the last char
|
|
327
|
-
while (true) {
|
|
328
|
-
context_data_val = (context_data_val << 1);
|
|
329
|
-
if (context_data_position == bitsPerChar-1) {
|
|
330
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
331
|
-
break;
|
|
332
|
-
}
|
|
333
|
-
else context_data_position++;
|
|
334
|
-
}
|
|
335
|
-
return context_data.join('');
|
|
336
|
-
},
|
|
337
|
-
|
|
338
|
-
decompress: function (compressed) {
|
|
339
|
-
if (compressed == null) return "";
|
|
340
|
-
if (compressed == "") return null;
|
|
341
|
-
return LZString._decompress(compressed.length, 32768, function(index) { return compressed.charCodeAt(index); });
|
|
342
|
-
},
|
|
343
|
-
|
|
344
|
-
_decompress: function (length, resetValue, getNextValue) {
|
|
345
|
-
var dictionary = [],
|
|
346
|
-
enlargeIn = 4,
|
|
347
|
-
dictSize = 4,
|
|
348
|
-
numBits = 3,
|
|
349
|
-
entry = "",
|
|
350
|
-
result = [],
|
|
351
|
-
i,
|
|
352
|
-
w,
|
|
353
|
-
bits, resb, maxpower, power,
|
|
354
|
-
c,
|
|
355
|
-
data = {val:getNextValue(0), position:resetValue, index:1};
|
|
356
|
-
|
|
357
|
-
for (i = 0; i < 3; i += 1) {
|
|
358
|
-
dictionary[i] = i;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
bits = 0;
|
|
362
|
-
maxpower = Math.pow(2,2);
|
|
363
|
-
power=1;
|
|
364
|
-
while (power!=maxpower) {
|
|
365
|
-
resb = data.val & data.position;
|
|
366
|
-
data.position >>= 1;
|
|
367
|
-
if (data.position == 0) {
|
|
368
|
-
data.position = resetValue;
|
|
369
|
-
data.val = getNextValue(data.index++);
|
|
370
|
-
}
|
|
371
|
-
bits |= (resb>0 ? 1 : 0) * power;
|
|
372
|
-
power <<= 1;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
switch (bits) {
|
|
376
|
-
case 0:
|
|
377
|
-
bits = 0;
|
|
378
|
-
maxpower = Math.pow(2,8);
|
|
379
|
-
power=1;
|
|
380
|
-
while (power!=maxpower) {
|
|
381
|
-
resb = data.val & data.position;
|
|
382
|
-
data.position >>= 1;
|
|
383
|
-
if (data.position == 0) {
|
|
384
|
-
data.position = resetValue;
|
|
385
|
-
data.val = getNextValue(data.index++);
|
|
386
|
-
}
|
|
387
|
-
bits |= (resb>0 ? 1 : 0) * power;
|
|
388
|
-
power <<= 1;
|
|
389
|
-
}
|
|
390
|
-
c = f(bits);
|
|
391
|
-
break;
|
|
392
|
-
case 1:
|
|
393
|
-
bits = 0;
|
|
394
|
-
maxpower = Math.pow(2,16);
|
|
395
|
-
power=1;
|
|
396
|
-
while (power!=maxpower) {
|
|
397
|
-
resb = data.val & data.position;
|
|
398
|
-
data.position >>= 1;
|
|
399
|
-
if (data.position == 0) {
|
|
400
|
-
data.position = resetValue;
|
|
401
|
-
data.val = getNextValue(data.index++);
|
|
402
|
-
}
|
|
403
|
-
bits |= (resb>0 ? 1 : 0) * power;
|
|
404
|
-
power <<= 1;
|
|
405
|
-
}
|
|
406
|
-
c = f(bits);
|
|
407
|
-
break;
|
|
408
|
-
case 2:
|
|
409
|
-
return "";
|
|
410
|
-
}
|
|
411
|
-
dictionary[3] = c;
|
|
412
|
-
w = c;
|
|
413
|
-
result.push(c);
|
|
414
|
-
while (true) {
|
|
415
|
-
if (data.index > length) {
|
|
416
|
-
return "";
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
bits = 0;
|
|
420
|
-
maxpower = Math.pow(2,numBits);
|
|
421
|
-
power=1;
|
|
422
|
-
while (power!=maxpower) {
|
|
423
|
-
resb = data.val & data.position;
|
|
424
|
-
data.position >>= 1;
|
|
425
|
-
if (data.position == 0) {
|
|
426
|
-
data.position = resetValue;
|
|
427
|
-
data.val = getNextValue(data.index++);
|
|
428
|
-
}
|
|
429
|
-
bits |= (resb>0 ? 1 : 0) * power;
|
|
430
|
-
power <<= 1;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
switch (c = bits) {
|
|
434
|
-
case 0:
|
|
435
|
-
bits = 0;
|
|
436
|
-
maxpower = Math.pow(2,8);
|
|
437
|
-
power=1;
|
|
438
|
-
while (power!=maxpower) {
|
|
439
|
-
resb = data.val & data.position;
|
|
440
|
-
data.position >>= 1;
|
|
441
|
-
if (data.position == 0) {
|
|
442
|
-
data.position = resetValue;
|
|
443
|
-
data.val = getNextValue(data.index++);
|
|
444
|
-
}
|
|
445
|
-
bits |= (resb>0 ? 1 : 0) * power;
|
|
446
|
-
power <<= 1;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
dictionary[dictSize++] = f(bits);
|
|
450
|
-
c = dictSize-1;
|
|
451
|
-
enlargeIn--;
|
|
452
|
-
break;
|
|
453
|
-
case 1:
|
|
454
|
-
bits = 0;
|
|
455
|
-
maxpower = Math.pow(2,16);
|
|
456
|
-
power=1;
|
|
457
|
-
while (power!=maxpower) {
|
|
458
|
-
resb = data.val & data.position;
|
|
459
|
-
data.position >>= 1;
|
|
460
|
-
if (data.position == 0) {
|
|
461
|
-
data.position = resetValue;
|
|
462
|
-
data.val = getNextValue(data.index++);
|
|
463
|
-
}
|
|
464
|
-
bits |= (resb>0 ? 1 : 0) * power;
|
|
465
|
-
power <<= 1;
|
|
466
|
-
}
|
|
467
|
-
dictionary[dictSize++] = f(bits);
|
|
468
|
-
c = dictSize-1;
|
|
469
|
-
enlargeIn--;
|
|
470
|
-
break;
|
|
471
|
-
case 2:
|
|
472
|
-
return result.join('');
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
if (enlargeIn == 0) {
|
|
476
|
-
enlargeIn = Math.pow(2, numBits);
|
|
477
|
-
numBits++;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
if (dictionary[c]) {
|
|
481
|
-
entry = dictionary[c];
|
|
482
|
-
} else {
|
|
483
|
-
if (c === dictSize) {
|
|
484
|
-
entry = w + w.charAt(0);
|
|
485
|
-
} else {
|
|
486
|
-
return null;
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
result.push(entry);
|
|
490
|
-
|
|
491
|
-
// Add w+entry[0] to the dictionary.
|
|
492
|
-
dictionary[dictSize++] = w + entry.charAt(0);
|
|
493
|
-
enlargeIn--;
|
|
494
|
-
|
|
495
|
-
w = entry;
|
|
496
|
-
|
|
497
|
-
if (enlargeIn == 0) {
|
|
498
|
-
enlargeIn = Math.pow(2, numBits);
|
|
499
|
-
numBits++;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
return LZString;
|
|
506
|
-
})();
|
|
507
|
-
|
|
508
|
-
if( module != null ) {
|
|
509
|
-
module.exports = LZString;
|
|
510
|
-
} else if( typeof angular !== 'undefined' && angular != null ) {
|
|
511
|
-
angular.module('LZString', [])
|
|
512
|
-
.factory('LZString', function () {
|
|
513
|
-
return LZString;
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
|
-
} (lzString.__module));
|
|
517
|
-
return lzString.__module.exports;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
exports.__require = requireLzString;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var typed = require('./typed.js');
|
|
4
|
-
|
|
5
|
-
function zipToObject(keys, values) {
|
|
6
|
-
if (!keys || !keys.length) {
|
|
7
|
-
return {};
|
|
8
|
-
}
|
|
9
|
-
const getValue = typed.isFunction(values) ? values : typed.isArray(values) ? (_k, i) => values[i] : (_k, _i) => values;
|
|
10
|
-
return keys.reduce((acc, key, idx) => {
|
|
11
|
-
acc[key] = getValue(key, idx);
|
|
12
|
-
return acc;
|
|
13
|
-
}, {});
|
|
14
|
-
}
|
|
15
|
-
const sort = (array, getter, desc = false) => {
|
|
16
|
-
if (!array)
|
|
17
|
-
return [];
|
|
18
|
-
const asc = (a, b) => getter(a) - getter(b);
|
|
19
|
-
const dsc = (a, b) => getter(b) - getter(a);
|
|
20
|
-
return array.slice().sort(desc === true ? dsc : asc);
|
|
21
|
-
};
|
|
22
|
-
const counting = (list2, identity) => {
|
|
23
|
-
if (!list2)
|
|
24
|
-
return {};
|
|
25
|
-
return list2.reduce((acc, item) => {
|
|
26
|
-
const id = identity(item);
|
|
27
|
-
acc[id] = (acc[id] ?? 0) + 1;
|
|
28
|
-
return acc;
|
|
29
|
-
}, {});
|
|
30
|
-
};
|
|
31
|
-
const objectify = (array, getKey, getValue = (item) => item) => {
|
|
32
|
-
return array.reduce((acc, item) => {
|
|
33
|
-
acc[getKey(item)] = getValue(item);
|
|
34
|
-
return acc;
|
|
35
|
-
}, {});
|
|
36
|
-
};
|
|
37
|
-
const cluster = (list2, size = 2) => {
|
|
38
|
-
const clusterCount = Math.ceil(list2.length / size);
|
|
39
|
-
return new Array(clusterCount).fill(null).map((_c, i) => {
|
|
40
|
-
return list2.slice(i * size, i * size + size);
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
const unique = (array, toKey) => {
|
|
44
|
-
const valueMap = array.reduce((acc, item) => {
|
|
45
|
-
const key = toKey ? toKey(item) : item;
|
|
46
|
-
if (acc[key])
|
|
47
|
-
return acc;
|
|
48
|
-
acc[key] = item;
|
|
49
|
-
return acc;
|
|
50
|
-
}, {});
|
|
51
|
-
return Object.values(valueMap);
|
|
52
|
-
};
|
|
53
|
-
function* range(startOrLength, end, valueOrMapper = (i) => i, step = 1) {
|
|
54
|
-
const mapper = typed.isFunction(valueOrMapper) ? valueOrMapper : () => valueOrMapper;
|
|
55
|
-
const start = end ? startOrLength : 0;
|
|
56
|
-
const final = end ?? startOrLength;
|
|
57
|
-
for (let i = start; i <= final; i += step) {
|
|
58
|
-
yield mapper(i);
|
|
59
|
-
if (i + step > final)
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
const list = (startOrLength, end, valueOrMapper, step) => {
|
|
64
|
-
return Array.from(range(startOrLength, end, valueOrMapper, step));
|
|
65
|
-
};
|
|
66
|
-
const fork = (list2, condition) => {
|
|
67
|
-
if (!list2)
|
|
68
|
-
return [[], []];
|
|
69
|
-
return list2.reduce(
|
|
70
|
-
(acc, item) => {
|
|
71
|
-
const [a, b] = acc;
|
|
72
|
-
if (condition(item)) {
|
|
73
|
-
return [[...a, item], b];
|
|
74
|
-
} else {
|
|
75
|
-
return [a, [...b, item]];
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
[[], []]
|
|
79
|
-
);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
exports.cluster = cluster;
|
|
83
|
-
exports.counting = counting;
|
|
84
|
-
exports.fork = fork;
|
|
85
|
-
exports.list = list;
|
|
86
|
-
exports.objectify = objectify;
|
|
87
|
-
exports.range = range;
|
|
88
|
-
exports.sort = sort;
|
|
89
|
-
exports.unique = unique;
|
|
90
|
-
exports.zipToObject = zipToObject;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var array = require('./array.js');
|
|
4
|
-
var typed = require('./typed.js');
|
|
5
|
-
|
|
6
|
-
class AggregateError extends Error {
|
|
7
|
-
constructor(errors = []) {
|
|
8
|
-
super();
|
|
9
|
-
const name = errors.find((e) => e.name)?.name ?? "";
|
|
10
|
-
this.name = `AggregateError(${name}...)`;
|
|
11
|
-
this.message = `AggregateError with ${errors.length} errors`;
|
|
12
|
-
this.stack = errors.find((e) => e.stack)?.stack ?? this.stack;
|
|
13
|
-
this.errors = errors;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
const parallel = async (limit, array$1, func) => {
|
|
17
|
-
const work = array$1.map((item, index) => ({
|
|
18
|
-
index,
|
|
19
|
-
item
|
|
20
|
-
}));
|
|
21
|
-
const processor = async (res) => {
|
|
22
|
-
const results2 = [];
|
|
23
|
-
while (true) {
|
|
24
|
-
const next = work.pop();
|
|
25
|
-
if (!next)
|
|
26
|
-
return res(results2);
|
|
27
|
-
const [error, result] = await tryit(func)(next.item);
|
|
28
|
-
results2.push({
|
|
29
|
-
error,
|
|
30
|
-
result,
|
|
31
|
-
index: next.index
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
const queues = array.list(1, limit).map(() => new Promise(processor));
|
|
36
|
-
const itemResults = await Promise.all(queues);
|
|
37
|
-
const [errors, results] = array.fork(
|
|
38
|
-
array.sort(itemResults.flat(), (r) => r.index),
|
|
39
|
-
(x) => !!x.error
|
|
40
|
-
);
|
|
41
|
-
if (errors.length > 0) {
|
|
42
|
-
throw new AggregateError(errors.map((error) => error.error));
|
|
43
|
-
}
|
|
44
|
-
return results.map((r) => r.result);
|
|
45
|
-
};
|
|
46
|
-
const tryit = (func) => {
|
|
47
|
-
return (...args) => {
|
|
48
|
-
try {
|
|
49
|
-
const result = func(...args);
|
|
50
|
-
if (typed.isPromise(result)) {
|
|
51
|
-
return result.then((value) => [void 0, value]).catch((err) => [err, void 0]);
|
|
52
|
-
}
|
|
53
|
-
return [void 0, result];
|
|
54
|
-
} catch (err) {
|
|
55
|
-
return [err, void 0];
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
exports.AggregateError = AggregateError;
|
|
61
|
-
exports.parallel = parallel;
|
|
62
|
-
exports.tryit = tryit;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const shake = (obj, filter = (x) => x === void 0) => {
|
|
4
|
-
if (!obj)
|
|
5
|
-
return {};
|
|
6
|
-
const keys2 = Object.keys(obj);
|
|
7
|
-
return keys2.reduce((acc, key) => {
|
|
8
|
-
if (filter(obj[key])) {
|
|
9
|
-
return acc;
|
|
10
|
-
} else {
|
|
11
|
-
acc[key] = obj[key];
|
|
12
|
-
return acc;
|
|
13
|
-
}
|
|
14
|
-
}, {});
|
|
15
|
-
};
|
|
16
|
-
const mapValues = (obj, mapFunc) => {
|
|
17
|
-
const keys2 = Object.keys(obj);
|
|
18
|
-
return keys2.reduce((acc, key) => {
|
|
19
|
-
acc[key] = mapFunc(obj[key], key);
|
|
20
|
-
return acc;
|
|
21
|
-
}, {});
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
exports.mapValues = mapValues;
|
|
25
|
-
exports.shake = shake;
|