@ocap/util 1.27.16 → 1.28.1
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/esm/bn.d.ts +8 -6
- package/esm/bn.js +11 -7
- package/esm/constant.d.ts +4 -1
- package/esm/constant.js +5 -1
- package/esm/create-sorted-list.d.ts +4 -1
- package/esm/create-sorted-list.js +8 -3
- package/esm/curve.d.ts +85 -55
- package/esm/curve.js +132 -127
- package/esm/error.d.ts +12 -9
- package/esm/error.js +24 -17
- package/esm/get-list-field.d.ts +4 -1
- package/esm/get-list-field.js +7 -2
- package/esm/get-related-addr.d.ts +4 -1
- package/esm/get-related-addr.js +5 -1
- package/esm/index.d.ts +47 -44
- package/esm/index.js +364 -469
- package/esm/lodash.d.ts +12 -0
- package/esm/md5.d.ts +4 -1
- package/esm/md5.js +7 -3
- package/esm/ready.d.ts +13 -9
- package/esm/ready.js +33 -36
- package/esm/retry.d.ts +16 -9
- package/esm/retry.js +26 -27
- package/esm/tsfixme.d.ts +3 -0
- package/esm/url.d.ts +16 -12
- package/esm/url.js +67 -92
- package/lib/_virtual/rolldown_runtime.js +29 -0
- package/lib/bn.d.ts +8 -6
- package/lib/bn.js +12 -12
- package/lib/constant.d.ts +4 -1
- package/lib/constant.js +6 -4
- package/lib/create-sorted-list.d.ts +4 -1
- package/lib/create-sorted-list.js +11 -10
- package/lib/curve.d.ts +84 -55
- package/lib/curve.js +139 -137
- package/lib/error.d.ts +12 -9
- package/lib/error.js +25 -21
- package/lib/get-list-field.d.ts +4 -1
- package/lib/get-list-field.js +9 -9
- package/lib/get-related-addr.d.ts +4 -1
- package/lib/get-related-addr.js +5 -4
- package/lib/index.d.ts +47 -44
- package/lib/index.js +386 -506
- package/lib/lodash.d.ts +12 -0
- package/lib/md5.d.ts +4 -1
- package/lib/md5.js +9 -10
- package/lib/ready.d.ts +13 -9
- package/lib/ready.js +34 -42
- package/lib/retry.d.ts +16 -9
- package/lib/retry.js +27 -30
- package/lib/tsfixme.d.ts +3 -0
- package/lib/url.d.ts +16 -12
- package/lib/url.js +69 -118
- package/package.json +20 -9
package/esm/lodash.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare module 'lodash/camelCase';
|
|
2
|
+
declare module 'lodash/flatten';
|
|
3
|
+
declare module 'lodash/get';
|
|
4
|
+
declare module 'lodash/isBoolean';
|
|
5
|
+
declare module 'lodash/isNull';
|
|
6
|
+
declare module 'lodash/isNumber';
|
|
7
|
+
declare module 'lodash/isObject';
|
|
8
|
+
declare module 'lodash/isString';
|
|
9
|
+
declare module 'lodash/padEnd';
|
|
10
|
+
declare module 'lodash/padStart';
|
|
11
|
+
declare module 'lodash/uniq';
|
|
12
|
+
declare module 'lodash/upperFirst';
|
package/esm/md5.d.ts
CHANGED
package/esm/md5.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import crypto from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import crypto from "crypto";
|
|
2
|
+
|
|
3
|
+
//#region src/md5.ts
|
|
4
|
+
const md5 = (x) => crypto.createHash("md5").update(x).digest("hex");
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
export { md5 };
|
package/esm/ready.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import EventEmitter from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import EventEmitter from "events";
|
|
2
|
+
|
|
3
|
+
//#region src/ready.d.ts
|
|
4
|
+
declare class Ready extends EventEmitter {
|
|
5
|
+
emit: $TSFixMe;
|
|
6
|
+
ready: $TSFixMe;
|
|
7
|
+
readyCallbacks: $TSFixMe;
|
|
8
|
+
readyMarks: $TSFixMe;
|
|
9
|
+
constructor();
|
|
10
|
+
markReady(mark?: $TSFixMe): void;
|
|
11
|
+
onReady(cb: $TSFixMe): void;
|
|
10
12
|
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Ready };
|
package/esm/ready.js
CHANGED
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
import EventEmitter from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
import EventEmitter from "events";
|
|
2
|
+
|
|
3
|
+
//#region src/ready.ts
|
|
4
|
+
var Ready = class extends EventEmitter {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
this.ready = false;
|
|
8
|
+
this.readyCallbacks = [];
|
|
9
|
+
this.readyMarks = {};
|
|
10
|
+
}
|
|
11
|
+
markReady(mark) {
|
|
12
|
+
if (this.ready) return;
|
|
13
|
+
if (mark === void 0) {
|
|
14
|
+
this.ready = true;
|
|
15
|
+
this.readyCallbacks.forEach((x) => x());
|
|
16
|
+
this.emit("ready");
|
|
17
|
+
} else {
|
|
18
|
+
this.readyMarks[mark] = true;
|
|
19
|
+
this.ready = Object.values(this.readyMarks).every((x) => !!x);
|
|
20
|
+
if (this.ready) {
|
|
21
|
+
this.readyCallbacks.forEach((cb) => cb());
|
|
22
|
+
this.emit("ready");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
onReady(cb) {
|
|
27
|
+
if (this.ready) cb();
|
|
28
|
+
else this.readyCallbacks.push(cb);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Ready };
|
package/esm/retry.d.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
//#region src/retry.d.ts
|
|
1
2
|
interface RetryOptions {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
retryLimit?: number;
|
|
4
|
+
backoff?: {
|
|
5
|
+
baseDelay: number;
|
|
6
|
+
maxDelay: number;
|
|
7
|
+
};
|
|
8
|
+
shouldRetry?: (error: unknown) => boolean;
|
|
9
|
+
onError?: (error: unknown, attempt: number) => Promise<void> | void;
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
declare function withRetry<T>(handle: () => Promise<T>, {
|
|
12
|
+
retryLimit,
|
|
13
|
+
backoff,
|
|
14
|
+
shouldRetry,
|
|
15
|
+
onError
|
|
16
|
+
}?: RetryOptions): Promise<T>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { withRetry };
|
package/esm/retry.js
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/retry.ts
|
|
2
2
|
function wait(ms) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
return new Promise((resolve) => {
|
|
4
|
+
setTimeout(resolve, ms);
|
|
5
|
+
});
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const delay = Math.min(maxDelay, baseDelay * 2 ** attempt);
|
|
27
|
-
await wait(Math.random() * delay);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
7
|
+
async function withRetry(handle, { retryLimit = 30, backoff = {
|
|
8
|
+
baseDelay: 20,
|
|
9
|
+
maxDelay: 1e3
|
|
10
|
+
}, shouldRetry = () => true, onError = () => {} } = {}) {
|
|
11
|
+
let attempt = 0;
|
|
12
|
+
let lastError;
|
|
13
|
+
while (attempt <= retryLimit) {
|
|
14
|
+
attempt++;
|
|
15
|
+
try {
|
|
16
|
+
return await handle();
|
|
17
|
+
} catch (error) {
|
|
18
|
+
if (!shouldRetry(error) || attempt > retryLimit) throw error;
|
|
19
|
+
lastError = error;
|
|
20
|
+
if (onError) await onError(lastError, attempt);
|
|
21
|
+
const { baseDelay, maxDelay } = backoff;
|
|
22
|
+
const delay = Math.min(maxDelay, baseDelay * 2 ** attempt);
|
|
23
|
+
await wait(Math.random() * delay);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
30
26
|
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { withRetry };
|
package/esm/tsfixme.d.ts
ADDED
package/esm/url.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import * as ipaddr from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import * as ipaddr from "ipaddr.js";
|
|
2
|
+
|
|
3
|
+
//#region src/url.d.ts
|
|
4
|
+
declare function parseIp(host: string): ipaddr.IPv4 | ipaddr.IPv6 | null;
|
|
5
|
+
declare function isUnicastAddress(host: string): boolean;
|
|
6
|
+
declare function resolveHostAddresses(host: string): Promise<string[]>;
|
|
7
|
+
interface VerifyUrlOptions {
|
|
8
|
+
allowIp?: boolean;
|
|
9
|
+
maxLength?: number;
|
|
10
|
+
protocols?: string[];
|
|
11
|
+
blockedHosts?: string[];
|
|
12
|
+
blockedSuffixes?: string[];
|
|
13
|
+
checkDns?: boolean;
|
|
12
14
|
}
|
|
13
|
-
|
|
15
|
+
declare function verifyUrl(url: string, options?: VerifyUrlOptions): Promise<boolean>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { VerifyUrlOptions, isUnicastAddress, parseIp, resolveHostAddresses, verifyUrl };
|
package/esm/url.js
CHANGED
|
@@ -1,101 +1,76 @@
|
|
|
1
|
-
import { URL } from
|
|
2
|
-
import * as ipaddr from
|
|
3
|
-
import { Resolver } from
|
|
1
|
+
import { URL } from "url";
|
|
2
|
+
import * as ipaddr from "ipaddr.js";
|
|
3
|
+
import { Resolver } from "dns/promises.js";
|
|
4
|
+
|
|
5
|
+
//#region src/url.ts
|
|
4
6
|
const MAX_URL_LENGTH = 256;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
7
|
+
function parseIp(host) {
|
|
8
|
+
if (!ipaddr.isValid(host)) return null;
|
|
9
|
+
try {
|
|
10
|
+
return ipaddr.parse(host);
|
|
11
|
+
} catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
14
|
}
|
|
15
15
|
function stripTrailingDots(host) {
|
|
16
|
-
|
|
16
|
+
return host.replace(/\.+$/, "");
|
|
17
17
|
}
|
|
18
18
|
function isBlockedHostname(host, blockedHosts, blockedSuffixes) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return true;
|
|
24
|
-
return false;
|
|
19
|
+
const normalized = host.toLowerCase();
|
|
20
|
+
if (blockedHosts.includes(normalized)) return true;
|
|
21
|
+
if (blockedSuffixes.some((suffix) => normalized.endsWith(suffix))) return true;
|
|
22
|
+
return false;
|
|
25
23
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const mapped = parsed.toIPv4Address();
|
|
33
|
-
return mapped.range() === 'unicast';
|
|
34
|
-
}
|
|
35
|
-
return range === 'unicast';
|
|
24
|
+
function isUnicastAddress(host) {
|
|
25
|
+
const parsed = parseIp(host);
|
|
26
|
+
if (!parsed) return false;
|
|
27
|
+
const range = parsed.range();
|
|
28
|
+
if (range === "ipv4Mapped" && parsed.kind() === "ipv6") return parsed.toIPv4Address().range() === "unicast";
|
|
29
|
+
return range === "unicast";
|
|
36
30
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
return addresses.filter(Boolean);
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
console.warn(`DNS resolution failed for host: ${host}, error: ${error?.message}`);
|
|
64
|
-
return [];
|
|
65
|
-
}
|
|
31
|
+
async function resolveHostAddresses(host) {
|
|
32
|
+
try {
|
|
33
|
+
const resolver = new Resolver();
|
|
34
|
+
resolver.setServers(["8.8.8.8", "1.1.1.1"]);
|
|
35
|
+
const addresses = [];
|
|
36
|
+
try {
|
|
37
|
+
const ipv4Addresses = await resolver.resolve4(host);
|
|
38
|
+
addresses.push(...ipv4Addresses);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.warn(`IPv4 resolution failed for ${host}:`, error?.message);
|
|
41
|
+
}
|
|
42
|
+
if (!addresses.length) try {
|
|
43
|
+
const ipv6Addresses = await resolver.resolve6(host);
|
|
44
|
+
addresses.push(...ipv6Addresses);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.warn(`IPv6 resolution failed for ${host}:`, error?.message);
|
|
47
|
+
}
|
|
48
|
+
return addresses.filter(Boolean);
|
|
49
|
+
} catch (error) {
|
|
50
|
+
console.warn(`DNS resolution failed for host: ${host}, error: ${error?.message}`);
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
66
53
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
if (!isUnicastAddress(normalizedHost)) {
|
|
88
|
-
throw new Error(`IP address is not unicast: ${normalizedHost}`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (checkDns && !isIP) {
|
|
92
|
-
const resolved = await resolveHostAddresses(normalizedHost);
|
|
93
|
-
if (resolved.length === 0) {
|
|
94
|
-
throw new Error(`DNS resolution failed: no addresses found for ${normalizedHost}`);
|
|
95
|
-
}
|
|
96
|
-
if (!resolved.every((address) => isUnicastAddress(address))) {
|
|
97
|
-
throw new Error(`DNS resolved to non-unicast addresses for ${normalizedHost}`);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return true;
|
|
54
|
+
async function verifyUrl(url, options = {}) {
|
|
55
|
+
if (!url) throw new Error("URL is required");
|
|
56
|
+
const { maxLength = MAX_URL_LENGTH, protocols = ["https:"], blockedHosts = ["localhost"], blockedSuffixes = [], allowIp = false, checkDns = false } = options;
|
|
57
|
+
if (url.length > maxLength) throw new Error(`URL exceeds maximum length of ${maxLength} characters: ${url.length}`);
|
|
58
|
+
const { hostname, protocol } = new URL(url);
|
|
59
|
+
if (!protocols.includes(protocol)) throw new Error(`Protocol '${protocol}' is not allowed. Allowed protocols: ${protocols.join(", ")}`);
|
|
60
|
+
const normalizedHost = stripTrailingDots(hostname);
|
|
61
|
+
if (isBlockedHostname(normalizedHost, blockedHosts, blockedSuffixes)) throw new Error(`Hostname '${normalizedHost}' is blocked`);
|
|
62
|
+
const isIP = Boolean(parseIp(normalizedHost));
|
|
63
|
+
if (isIP) {
|
|
64
|
+
if (!allowIp) throw new Error(`IP addresses are not allowed: ${normalizedHost}`);
|
|
65
|
+
if (!isUnicastAddress(normalizedHost)) throw new Error(`IP address is not unicast: ${normalizedHost}`);
|
|
66
|
+
}
|
|
67
|
+
if (checkDns && !isIP) {
|
|
68
|
+
const resolved = await resolveHostAddresses(normalizedHost);
|
|
69
|
+
if (resolved.length === 0) throw new Error(`DNS resolution failed: no addresses found for ${normalizedHost}`);
|
|
70
|
+
if (!resolved.every((address) => isUnicastAddress(address))) throw new Error(`DNS resolved to non-unicast addresses for ${normalizedHost}`);
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
101
73
|
}
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
export { isUnicastAddress, parseIp, resolveHostAddresses, verifyUrl };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
exports.__toESM = __toESM;
|
package/lib/bn.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import BaseBN from
|
|
2
|
-
|
|
1
|
+
import BaseBN from "bn.js";
|
|
2
|
+
|
|
3
|
+
//#region src/bn.d.ts
|
|
4
|
+
interface BN extends BaseBN {}
|
|
5
|
+
declare class BN extends BaseBN {
|
|
6
|
+
constructor(value: number | string | number[] | Uint8Array | Buffer | BaseBN | null | undefined, base?: number | 'hex', endian?: BaseBN.Endianness);
|
|
3
7
|
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export { BaseBN };
|
|
8
|
+
//#endregion
|
|
9
|
+
export { BN, BaseBN };
|
package/lib/bn.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.js');
|
|
2
|
+
let bn_js = require("bn.js");
|
|
3
|
+
bn_js = require_rolldown_runtime.__toESM(bn_js);
|
|
4
|
+
|
|
5
|
+
//#region src/bn.ts
|
|
6
|
+
var BN = class extends bn_js.default {
|
|
7
|
+
constructor(value, base, endian) {
|
|
8
|
+
super(value === null ? "0" : value, base, endian);
|
|
9
|
+
}
|
|
4
10
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const bn_js_1 = __importDefault(require("bn.js"));
|
|
8
|
-
exports.BaseBN = bn_js_1.default;
|
|
9
|
-
class BN extends bn_js_1.default {
|
|
10
|
-
constructor(value, base, endian) {
|
|
11
|
-
super(value === null ? '0' : value, base, endian);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
14
13
|
exports.BN = BN;
|
|
14
|
+
exports.BaseBN = bn_js.default;
|
package/lib/constant.d.ts
CHANGED
package/lib/constant.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
|
|
2
|
+
//#region src/constant.ts
|
|
3
|
+
const DEFAULT_TOKEN_DECIMAL = 18;
|
|
4
|
+
|
|
5
|
+
//#endregion
|
|
6
|
+
exports.DEFAULT_TOKEN_DECIMAL = DEFAULT_TOKEN_DECIMAL;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.js');
|
|
2
|
+
let lodash_uniq = require("lodash/uniq");
|
|
3
|
+
lodash_uniq = require_rolldown_runtime.__toESM(lodash_uniq);
|
|
4
|
+
let lodash_flatten = require("lodash/flatten");
|
|
5
|
+
lodash_flatten = require_rolldown_runtime.__toESM(lodash_flatten);
|
|
6
|
+
|
|
7
|
+
//#region src/create-sorted-list.ts
|
|
8
|
+
const createSortedList = (list) => (0, lodash_uniq.default)((0, lodash_flatten.default)(list)).filter(Boolean).sort();
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
exports.createSortedList = createSortedList;
|