koilib 2.7.0 → 3.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.
Files changed (66) hide show
  1. package/README.md +75 -12
  2. package/dist/koinos.js +8556 -269
  3. package/dist/koinos.min.js +1 -1
  4. package/lib/Contract.d.ts +66 -18
  5. package/lib/Contract.js +103 -40
  6. package/lib/Contract.js.map +1 -1
  7. package/lib/Provider.d.ts +22 -7
  8. package/lib/Provider.js +60 -21
  9. package/lib/Provider.js.map +1 -1
  10. package/lib/Serializer.d.ts +9 -3
  11. package/lib/Serializer.js +111 -85
  12. package/lib/Serializer.js.map +1 -1
  13. package/lib/Signer.d.ts +58 -38
  14. package/lib/Signer.js +318 -97
  15. package/lib/Signer.js.map +1 -1
  16. package/lib/browser/Contract.d.ts +66 -18
  17. package/lib/browser/Contract.js +103 -40
  18. package/lib/browser/Contract.js.map +1 -1
  19. package/lib/browser/Provider.d.ts +22 -7
  20. package/lib/browser/Provider.js +60 -21
  21. package/lib/browser/Provider.js.map +1 -1
  22. package/lib/browser/Serializer.d.ts +9 -3
  23. package/lib/browser/Serializer.js +111 -85
  24. package/lib/browser/Serializer.js.map +1 -1
  25. package/lib/browser/Signer.d.ts +58 -38
  26. package/lib/browser/Signer.js +318 -97
  27. package/lib/browser/Signer.js.map +1 -1
  28. package/lib/browser/index.d.ts +1 -1
  29. package/lib/browser/index.js +1 -1
  30. package/lib/browser/index.js.map +1 -1
  31. package/lib/browser/indexUtils.d.ts +2 -0
  32. package/lib/browser/indexUtils.js +15 -0
  33. package/lib/browser/indexUtils.js.map +1 -0
  34. package/lib/browser/interface.d.ts +242 -46
  35. package/lib/browser/jsonDescriptors/chain-proto.json +676 -0
  36. package/lib/browser/jsonDescriptors/{krc20-proto.json → token-proto.json} +47 -4
  37. package/lib/browser/protoModules/protocol-proto.d.ts +2 -0
  38. package/lib/browser/protoModules/protocol-proto.js +6336 -0
  39. package/lib/browser/protoModules/protocol-proto.js.map +1 -0
  40. package/lib/browser/utils.d.ts +19 -255
  41. package/lib/browser/utils.js +170 -15
  42. package/lib/browser/utils.js.map +1 -1
  43. package/lib/browser/utilsNode.d.ts +1021 -0
  44. package/lib/browser/utilsNode.js +346 -0
  45. package/lib/browser/utilsNode.js.map +1 -0
  46. package/lib/index.d.ts +1 -1
  47. package/lib/index.js +1 -1
  48. package/lib/index.js.map +1 -1
  49. package/lib/indexUtils.d.ts +2 -0
  50. package/lib/indexUtils.js +15 -0
  51. package/lib/indexUtils.js.map +1 -0
  52. package/lib/interface.d.ts +242 -46
  53. package/lib/jsonDescriptors/chain-proto.json +676 -0
  54. package/lib/jsonDescriptors/{krc20-proto.json → token-proto.json} +47 -4
  55. package/lib/protoModules/protocol-proto.d.ts +2 -0
  56. package/lib/protoModules/protocol-proto.js +6336 -0
  57. package/lib/protoModules/protocol-proto.js.map +1 -0
  58. package/lib/utils.d.ts +19 -255
  59. package/lib/utils.js +170 -15
  60. package/lib/utils.js.map +1 -1
  61. package/lib/utilsNode.d.ts +1021 -0
  62. package/lib/utilsNode.js +346 -0
  63. package/lib/utilsNode.js.map +1 -0
  64. package/package.json +1 -1
  65. package/lib/browser/jsonDescriptors/protocol-proto.json +0 -246
  66. package/lib/jsonDescriptors/protocol-proto.json +0 -246
@@ -0,0 +1,346 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ChainTypes = exports.decodeGenesisData = exports.encodeGenesisData = void 0;
7
+ const sha256_1 = require("@noble/hashes/sha256");
8
+ const Serializer_1 = require("./Serializer");
9
+ const utils_1 = require("./utils");
10
+ const chain_proto_json_1 = __importDefault(require("./jsonDescriptors/chain-proto.json"));
11
+ const defaultAlias = {
12
+ "object_key::head_block": { typeName: "block" },
13
+ "object_key::chain_id": {},
14
+ "object_key::genesis_key": { isAddress: true },
15
+ "object_key::resource_limit_data": { typeName: "resource_limit_data" },
16
+ "object_key::max_account_resources": { typeName: "max_account_resources" },
17
+ "object_key::protocol_descriptor": {},
18
+ "object_key::compute_bandwidth_registry": {
19
+ typeName: "compute_bandwidth_registry",
20
+ },
21
+ "object_key::block_hash_code": {},
22
+ };
23
+ function prepareDictionary(dictionary) {
24
+ const serializerChain = new Serializer_1.Serializer(chain_proto_json_1.default, { bytesConversion: true });
25
+ const defaultDictionary = {};
26
+ Object.keys(defaultAlias).forEach((alias) => {
27
+ const key = (0, utils_1.encodeBase64)((0, utils_1.multihash)((0, sha256_1.sha256)(alias)));
28
+ defaultDictionary[key] = {
29
+ serializer: serializerChain,
30
+ alias,
31
+ ...defaultAlias[alias],
32
+ };
33
+ });
34
+ const dic = {
35
+ ...defaultDictionary,
36
+ ...dictionary,
37
+ };
38
+ return dic;
39
+ }
40
+ /**
41
+ * Function to encode genesis data in order to launch a
42
+ * new blockchain. The different values are serialized using
43
+ * protobuffers. One of the arguments is the dictionary which
44
+ * contains the relevant information to perform the serialization.
45
+ * By default the function contains the dictionary for the
46
+ * following keys:
47
+ *
48
+ * - "object_key::head_block"
49
+ * - "object_key::chain_id"
50
+ * - "object_key::genesis_key"
51
+ * - "object_key::resource_limit_data"
52
+ * - "object_key::max_account_resources"
53
+ * - "object_key::protocol_descriptor"
54
+ * - "object_key::compute_bandwidth_registry"
55
+ * - "object_key::block_hash_code"
56
+ *
57
+ * @param genesisDataDecoded - Genesis data where the values are
58
+ * objects.
59
+ * @param dictionary - Set of keys which contains the relevant
60
+ * information to perform the serialization
61
+ *
62
+ * @example
63
+ *
64
+ * ```ts
65
+ * const signer = Signer.fromSeed("seed");
66
+ * const genesisDataDecoded = {
67
+ * entries: [
68
+ * {
69
+ * space: { system: true },
70
+ * alias: "object_key::genesis_key",
71
+ * value: signer.address,
72
+ * },
73
+ * ],
74
+ * };
75
+ *
76
+ * const genesisData = await encodeGenesisData(genesisDataDecoded);
77
+ * console.log(genesisData);
78
+ *
79
+ * // {
80
+ * // entries: [
81
+ * // {
82
+ * // space: { system: true },
83
+ * // key: "EiC3nO+XbeKg4C8ugW7M7XdfmJKY4i3l91KoJWxosQPImA==",
84
+ * // value: "AMpASH7CjUHBpl2QR8E5lGKVjVLAvJRg5g==",
85
+ * // },
86
+ * // ],
87
+ * // }
88
+ * ```
89
+ *
90
+ * @example adding a custom dictionary
91
+ *
92
+ * ```ts
93
+ * const contractId = Signer.fromSeed("seed").address;
94
+ * const zone = encodeBase64(decodeBase58(contractId));
95
+ * const genesisDataDecoded = {
96
+ * entries: [
97
+ * {
98
+ * space: { system: true, zone, id: 1 },
99
+ * key: "difficulty_metadata_key",
100
+ * value: {
101
+ * target: encodeBase64url(toUint8Array("F".repeat(64))),
102
+ * last_block_time: "1641038400000",
103
+ * difficulty: encodeBase64url(toUint8Array("1".repeat(64))),
104
+ * target_block_interval: "10",
105
+ * },
106
+ * },
107
+ * ],
108
+ * };
109
+ *
110
+ * const powJson = {
111
+ * nested: {
112
+ * mypackage: {
113
+ * nested: {
114
+ * difficulty_metadata: {
115
+ * "fields": {
116
+ * "target": { "type": "bytes", "id": 1 },
117
+ * "last_block_time": { "type": "uint64", "id": 2,
118
+ * "options": { "jstype": "JS_STRING" }
119
+ * },
120
+ * "difficulty": { "type": "bytes", "id": 3 },
121
+ * "target_block_interval": { "type": "uint64", "id": 4,
122
+ * "options": { "jstype": "JS_STRING" }
123
+ * }
124
+ * }
125
+ * },
126
+ * }
127
+ * }
128
+ * }
129
+ * }
130
+ *
131
+ * const dic = {
132
+ * difficulty_metadata_key: {
133
+ * serializer: new Serializer(powJson),
134
+ * typeName: "difficulty_metadata",
135
+ * },
136
+ * };
137
+ *
138
+ * const genesisData = await encodeGenesisData(genesisDataDecoded, dic);
139
+ * console.log(genesisData);
140
+ *
141
+ * // {
142
+ * // entries: [
143
+ * // {
144
+ * // key: "difficulty_metadata_key",
145
+ * // space: {
146
+ * // id: 1,
147
+ * // system: true,
148
+ * // zone: "AMpASH7CjUHBpl2QR8E5lGKVjVLAvJRg5g==",
149
+ * // },
150
+ * // value:
151
+ * // "CiD//////////////////////////////////////////xCAlIus4S8aIBERERERERERERERERERERERERERERERERERERERERERIAo=",
152
+ * // },
153
+ * // ],
154
+ * // };
155
+ * ```
156
+ */
157
+ async function encodeGenesisData(genesisDataDecoded, dictionary = {}) {
158
+ const genesisData = {};
159
+ if (!genesisDataDecoded || !genesisDataDecoded.entries)
160
+ return genesisData;
161
+ const dic = prepareDictionary(dictionary);
162
+ genesisData.entries = await Promise.all(genesisDataDecoded.entries.map(async (entry) => {
163
+ const key = Object.keys(dic).find((k) => k === entry.key || (entry.alias && dic[k].alias === entry.alias));
164
+ if (!key)
165
+ return {
166
+ error: `key ${entry.key} not found in the dictionary`,
167
+ space: entry.space,
168
+ key: entry.key,
169
+ value: (0, utils_1.encodeBase64)(new Uint8Array()),
170
+ };
171
+ const { isAddress, serializer, typeName } = dic[key];
172
+ let valueBytes;
173
+ let error = "";
174
+ if (isAddress) {
175
+ valueBytes = (0, utils_1.decodeBase58)(entry.value);
176
+ }
177
+ else if (serializer && typeName) {
178
+ valueBytes = await serializer.serialize(entry.value, typeName);
179
+ }
180
+ else {
181
+ valueBytes = new Uint8Array();
182
+ error = "no serializer or typeName defined in the dictionary";
183
+ }
184
+ return {
185
+ ...(error && { error }),
186
+ space: entry.space,
187
+ key,
188
+ value: (0, utils_1.encodeBase64)(valueBytes),
189
+ };
190
+ }));
191
+ return genesisData;
192
+ }
193
+ exports.encodeGenesisData = encodeGenesisData;
194
+ /**
195
+ * Function to decode genesis data used to launch a
196
+ * new blockchain. The different values are deserialized using
197
+ * protobuffers. One of the arguments is the dictionary which
198
+ * contains the relevant information for the deserialization.
199
+ * By default the function contains the dictionary for the
200
+ * following keys:
201
+ *
202
+ * - "object_key::head_block"
203
+ * - "object_key::chain_id"
204
+ * - "object_key::genesis_key"
205
+ * - "object_key::resource_limit_data"
206
+ * - "object_key::max_account_resources"
207
+ * - "object_key::protocol_descriptor"
208
+ * - "object_key::compute_bandwidth_registry"
209
+ * - "object_key::block_hash_code"
210
+ *
211
+ * @param genesisData - Genesis data
212
+ * @param dictionary - Set of keys which contains the relevant
213
+ * information to perform the deserialization
214
+ *
215
+ * @example
216
+ *
217
+ * ```ts
218
+ * const genesisData = {
219
+ * entries: [
220
+ * {
221
+ * space: { system: true },
222
+ * key: "EiC3nO+XbeKg4C8ugW7M7XdfmJKY4i3l91KoJWxosQPImA==",
223
+ * value: "AMpASH7CjUHBpl2QR8E5lGKVjVLAvJRg5g==",
224
+ * },
225
+ * ],
226
+ * }
227
+ *
228
+ * const genesisDataDecoded = await decodeGenesisData(genesisData);
229
+ * console.log(genesisDataDecoded);
230
+ *
231
+ * // {
232
+ * // entries: [
233
+ * // {
234
+ * // space: { system: true },
235
+ * // key: "EiC3nO+XbeKg4C8ugW7M7XdfmJKY4i3l91KoJWxosQPImA==",
236
+ * // alias: "object_key::genesis_key",
237
+ * // value: "1KSQWDyUnFZ48Pf2hsW8Akh1b5fKUWc8Z3",
238
+ * // },
239
+ * // ],
240
+ * // };
241
+ * ```
242
+ *
243
+ * @example adding a custom dictionary
244
+ *
245
+ * ```ts
246
+ * const genesisData = {
247
+ * entries: [
248
+ * {
249
+ * key: "difficulty_metadata_key",
250
+ * space: {
251
+ * id: 1,
252
+ * system: true,
253
+ * zone: "AMpASH7CjUHBpl2QR8E5lGKVjVLAvJRg5g==",
254
+ * },
255
+ * value:
256
+ * "CiD//////////////////////////////////////////xCAlIus4S8aIBERERERERERERERERERERERERERERERERERERERERERIAo=",
257
+ * },
258
+ * ],
259
+ * };
260
+ *
261
+ * const powJson = {
262
+ * nested: {
263
+ * mypackage: {
264
+ * nested: {
265
+ * difficulty_metadata: {
266
+ * "fields": {
267
+ * "target": { "type": "bytes", "id": 1 },
268
+ * "last_block_time": { "type": "uint64", "id": 2,
269
+ * "options": { "jstype": "JS_STRING" }
270
+ * },
271
+ * "difficulty": { "type": "bytes", "id": 3 },
272
+ * "target_block_interval": { "type": "uint64", "id": 4,
273
+ * "options": { "jstype": "JS_STRING" }
274
+ * }
275
+ * }
276
+ * },
277
+ * }
278
+ * }
279
+ * }
280
+ * }
281
+ *
282
+ * const dic = {
283
+ * difficulty_metadata_key: {
284
+ * serializer: new Serializer(powJson),
285
+ * typeName: "difficulty_metadata",
286
+ * },
287
+ * };
288
+ *
289
+ * const genesisDataDecoded = await decodeGenesisData(genesisData, dic);
290
+ * console.log(genesisData);
291
+ *
292
+ * // {
293
+ * // entries: [
294
+ * // {
295
+ * // space: { system: true, zone, id: 1 },
296
+ * // key: "difficulty_metadata_key",
297
+ * // value: {
298
+ * // target: "__________________________________________8=",
299
+ * // last_block_time: "1641038400000",
300
+ * // difficulty: "ERERERERERERERERERERERERERERERERERERERERERE=",
301
+ * // target_block_interval: "10",
302
+ * // },
303
+ * // },
304
+ * // ],
305
+ * // };
306
+ * ```
307
+ */
308
+ async function decodeGenesisData(genesisData, dictionary = {}) {
309
+ const genesisDataDecoded = {};
310
+ if (!genesisData || !genesisData.entries)
311
+ return genesisDataDecoded;
312
+ const dic = prepareDictionary(dictionary);
313
+ genesisDataDecoded.entries = await Promise.all(genesisData.entries.map(async (entry) => {
314
+ const key = Object.keys(dic).find((k) => k === entry.key);
315
+ if (!key)
316
+ return {
317
+ error: `key ${entry.key} not found in the dictionary`,
318
+ ...entry,
319
+ };
320
+ const { isAddress, serializer, typeName, alias } = dic[key];
321
+ const valueBase64url = (0, utils_1.encodeBase64url)((0, utils_1.decodeBase64)(entry.value));
322
+ let value;
323
+ let error = "";
324
+ if (isAddress) {
325
+ value = (0, utils_1.encodeBase58)((0, utils_1.decodeBase64url)(valueBase64url));
326
+ }
327
+ else if (serializer && typeName) {
328
+ value = await serializer.deserialize(valueBase64url, typeName);
329
+ }
330
+ else {
331
+ value = valueBase64url;
332
+ error = "no serializer or typeName defined in the dictionary";
333
+ }
334
+ return {
335
+ ...(error && { error }),
336
+ space: entry.space,
337
+ key,
338
+ value,
339
+ ...(alias && { alias }),
340
+ };
341
+ }));
342
+ return genesisDataDecoded;
343
+ }
344
+ exports.decodeGenesisData = decodeGenesisData;
345
+ exports.ChainTypes = chain_proto_json_1.default;
346
+ //# sourceMappingURL=utilsNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utilsNode.js","sourceRoot":"","sources":["../../src/utilsNode.ts"],"names":[],"mappings":";;;;;;AAAA,iDAA8C;AAM9C,6CAA0C;AAC1C,mCAQiB;AACjB,0FAA2D;AAE3D,MAAM,YAAY,GAA0B;IAC1C,wBAAwB,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE;IAC/C,sBAAsB,EAAE,EAAE;IAC1B,yBAAyB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;IAC9C,iCAAiC,EAAE,EAAE,QAAQ,EAAE,qBAAqB,EAAE;IACtE,mCAAmC,EAAE,EAAE,QAAQ,EAAE,uBAAuB,EAAE;IAC1E,iCAAiC,EAAE,EAAE;IACrC,wCAAwC,EAAE;QACxC,QAAQ,EAAE,4BAA4B;KACvC;IACD,6BAA6B,EAAE,EAAE;CAClC,CAAC;AAEF,SAAS,iBAAiB,CACxB,UAAiC;IAEjC,MAAM,eAAe,GAAG,IAAI,uBAAU,CAAC,0BAAS,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IAE7E,MAAM,iBAAiB,GAA0B,EAAE,CAAC;IACpD,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1C,MAAM,GAAG,GAAG,IAAA,oBAAY,EAAC,IAAA,iBAAS,EAAC,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnD,iBAAiB,CAAC,GAAG,CAAC,GAAG;YACvB,UAAU,EAAE,eAAe;YAC3B,KAAK;YACL,GAAG,YAAY,CAAC,KAAK,CAAC;SACvB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG;QACV,GAAG,i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AC;QAC1D,IAAI,CAAC,GAAG;YACN,OAAO;gBACL,KAAK,EAAE,OAAO,KAAK,CAAC,GAAI,8BAA8B;gBACtD,GAAG,KAAK;aACT,CAAC;QAEJ,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QAE5D,MAAM,cAAc,GAAG,IAAA,uBAAe,EAAC,IAAA,oBAAY,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAClE,IAAI,KAAuC,CAAC;QAC5C,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,IAAI,SAAS,EAAE;YACb,KAAK,GAAG,IAAA,oBAAY,EAAC,IAAA,uBAAe,EAAC,cAAc,CAAC,CAAC,CAAC;SACvD;aAAM,IAAI,UAAU,IAAI,QAAQ,EAAE;YACjC,KAAK,GAAG,MAAM,UAAU,CAAC,WAAW,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;SAChE;aAAM;YACL,KAAK,GAAG,cAAc,CAAC;YACvB,KAAK,GAAG,qDAAqD,CAAC;SAC/D;QAED,OAAO;YACL,GAAG,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,CAAC;YACvB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,GAAG;YACH,KAAK;YACL,GAAG,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,CAAC;SACxB,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AA1CD,8CA0CC;AAEY,QAAA,UAAU,GAAG,0BAAS,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! koilib - MIT License (c) Julian Gonzalez (joticajulian@gmail.com) */
2
- export * as utils from "./utils";
2
+ export * as utils from "./indexUtils";
3
3
  export * as interfaces from "./interface";
4
4
  export * from "./Contract";
5
5
  export * from "./Signer";
package/lib/index.js CHANGED
@@ -25,7 +25,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.interfaces = exports.utils = void 0;
26
26
  /*! koilib - MIT License (c) Julian Gonzalez (joticajulian@gmail.com) */
27
27
  // eslint-disable import/no-cycle
28
- exports.utils = __importStar(require("./utils"));
28
+ exports.utils = __importStar(require("./indexUtils"));
29
29
  exports.interfaces = __importStar(require("./interface"));
30
30
  __exportStar(require("./Contract"), exports);
31
31
  __exportStar(require("./Signer"), exports);
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wEAAwE;AACxE,iCAAiC;AACjC,iDAAiC;AACjC,0DAA0C;AAC1C,6CAA2B;AAC3B,2CAAyB;AACzB,6CAA2B;AAC3B,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wEAAwE;AACxE,iCAAiC;AACjC,sDAAsC;AACtC,0DAA0C;AAC1C,6CAA2B;AAC3B,2CAAyB;AACzB,6CAA2B;AAC3B,+CAA6B"}
@@ -0,0 +1,2 @@
1
+ export * from "./utils";
2
+ export * from "./utilsNode";
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./utils"), exports);
14
+ __exportStar(require("./utilsNode"), exports);
15
+ //# sourceMappingURL=indexUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexUtils.js","sourceRoot":"","sources":["../src/indexUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB;AACxB,8CAA4B"}