@unicom-cloud/utils 0.1.10 → 0.1.11
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/caseName.js +11 -0
- package/className.js +5 -0
- package/clipboardCopy.js +6 -0
- package/constant.js +4 -0
- package/contentDisposition.js +7 -0
- package/convert-time/index.js +61 -0
- package/convertTime.js +4 -0
- package/cookie.js +7 -0
- package/dayjs.js +5 -0
- package/decimal.js +5 -0
- package/eventEmitter.js +4 -0
- package/file.js +6 -0
- package/filesize.js +8 -0
- package/index.js +38 -30
- package/invariant.js +4 -0
- package/is.js +92 -0
- package/lunar-converter/index.js +641 -0
- package/lunarConverter.js +4 -0
- package/math.js +9 -0
- package/md5.js +4 -0
- package/mock.js +8 -0
- package/normalizeWheel.js +6 -0
- package/number-to-chinese/index.js +72 -0
- package/numberToChinese.js +4 -0
- package/nzh.js +4 -0
- package/object-keys-sort/index.js +7 -0
- package/objectKeysSort.js +2 -5
- package/package.json +1 -1
- package/random.js +15 -0
- package/screenfull.js +4 -0
- package/search-tree/index.js +54 -0
- package/searchTree.js +4 -0
- package/snapdom.js +6 -0
- package/tree.js +11 -0
- package/turboStream.js +6 -0
- package/types/case-name/index.d.ts +11 -0
- package/types/class-name/index.d.ts +2 -0
- package/types/clipboard-copy/index.d.ts +2 -0
- package/types/constant/address.d.ts +14 -0
- package/types/constant/chineseCharacters.d.ts +2 -0
- package/types/constant/constellations.d.ts +2 -0
- package/types/constant/domain.d.ts +2 -0
- package/types/constant/identity.d.ts +2 -0
- package/types/constant/index.d.ts +1 -0
- package/types/constant/keyboardCode.d.ts +158 -0
- package/types/constant/licensePlate.d.ts +2 -0
- package/types/constant/name.d.ts +4 -0
- package/types/constant/platform.d.ts +11 -0
- package/types/constant/protocol.d.ts +2 -0
- package/types/constant/ui.d.ts +14 -0
- package/types/content-disposition/index.d.ts +10 -0
- package/types/convert-time/index.d.ts +32 -0
- package/types/cookie/index.d.ts +4 -0
- package/types/cookie/src/index.d.ts +114 -0
- package/types/dayjs/index.d.ts +1 -0
- package/types/decimal/decimal.d.ts +4 -0
- package/types/decimal/index.d.ts +1 -0
- package/types/event-emitter/index.d.ts +17 -0
- package/types/file/fileToURL.d.ts +2 -0
- package/types/file/index.d.ts +3 -0
- package/types/file/saveAs.d.ts +2 -0
- package/types/filesize/index.d.ts +2 -0
- package/types/filesize/src/constants.d.ts +42 -0
- package/types/filesize/src/filesize.d.ts +47 -0
- package/types/index.d.ts +24 -0
- package/types/invariant/index.d.ts +2 -0
- package/types/is/index.d.ts +53 -0
- package/types/lunar-converter/index.d.ts +113 -0
- package/types/math/index.d.ts +11 -0
- package/types/md5/index.d.ts +2 -0
- package/types/mock/MockWebSocket.d.ts +17 -0
- package/types/mock/MockXMLHttpRequest.d.ts +17 -0
- package/types/mock/index.d.ts +2 -0
- package/types/normalize-wheel/ExecutionEnvironment.d.ts +9 -0
- package/types/normalize-wheel/UserAgent_DEPRECATED.d.ts +86 -0
- package/types/normalize-wheel/index.d.ts +115 -0
- package/types/normalize-wheel/isEventSupported.d.ts +16 -0
- package/types/number-to-chinese/index.d.ts +11 -0
- package/types/nzh/cn.d.ts +8 -0
- package/types/nzh/hk.d.ts +8 -0
- package/types/nzh/index.d.ts +1 -0
- package/types/nzh/nzh.d.ts +36 -0
- package/types/nzh/src/autoGet.d.ts +8 -0
- package/types/nzh/src/index.d.ts +34 -0
- package/types/nzh/src/langs/cn_b.d.ts +10 -0
- package/types/nzh/src/langs/cn_s.d.ts +7 -0
- package/types/nzh/src/langs/hk_b.d.ts +10 -0
- package/types/nzh/src/langs/hk_s.d.ts +7 -0
- package/types/nzh/src/utils.d.ts +65 -0
- package/types/object-keys-sort/index.d.ts +4 -0
- package/types/random/address.d.ts +8 -0
- package/types/random/constellation.d.ts +2 -0
- package/types/random/image.d.ts +5 -0
- package/types/random/index.d.ts +40 -0
- package/types/random/licensePlate.d.ts +2 -0
- package/types/random/name.d.ts +9 -0
- package/types/random/number.d.ts +6 -0
- package/types/random/text.d.ts +13 -0
- package/types/random/time.d.ts +2 -0
- package/types/random/web.d.ts +11 -0
- package/types/screenfull/index.d.ts +10 -0
- package/types/search-tree/index.d.ts +20 -0
- package/types/snapdom/index.d.ts +1 -0
- package/types/snapdom/src/api/preCache.d.ts +8 -0
- package/types/snapdom/src/api/snapdom.d.ts +26 -0
- package/types/snapdom/src/core/cache.d.ts +11 -0
- package/types/snapdom/src/core/capture.d.ts +17 -0
- package/types/snapdom/src/core/clone.d.ts +11 -0
- package/types/snapdom/src/core/prepare.d.ts +8 -0
- package/types/snapdom/src/index.browser.d.ts +1 -0
- package/types/snapdom/src/index.d.ts +2 -0
- package/types/snapdom/src/modules/background.d.ts +10 -0
- package/types/snapdom/src/modules/fonts.d.ts +25 -0
- package/types/snapdom/src/modules/images.d.ts +8 -0
- package/types/snapdom/src/modules/pseudo.d.ts +12 -0
- package/types/snapdom/src/modules/styles.d.ts +10 -0
- package/types/snapdom/src/utils/cssTools.d.ts +38 -0
- package/types/snapdom/src/utils/helpers.d.ts +71 -0
- package/types/tree/index.d.ts +8 -0
- package/types/turbo-stream/index.d.ts +1 -0
- package/types/turbo-stream/src/decode.d.ts +7 -0
- package/types/turbo-stream/src/encode.d.ts +27 -0
- package/types/turbo-stream/src/shared.d.ts +107 -0
- package/types/turbo-stream/src/turbo-stream.d.ts +4 -0
- package/types/url-toolkit/index.d.ts +2 -0
- package/types/url-toolkit/src/url-toolkit.d.ts +18 -0
- package/urlToolkit.js +8 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const ASYNC_FRAME_TYPE_PROMISE = 1;
|
|
2
|
+
declare const ASYNC_FRAME_TYPE_ITERABLE = 2;
|
|
3
|
+
type AsyncFrame = [
|
|
4
|
+
type: typeof ASYNC_FRAME_TYPE_PROMISE,
|
|
5
|
+
id: number,
|
|
6
|
+
promise: PromiseLike<unknown>
|
|
7
|
+
] | [
|
|
8
|
+
type: typeof ASYNC_FRAME_TYPE_ITERABLE,
|
|
9
|
+
id: number,
|
|
10
|
+
iterable: AsyncIterable<unknown>
|
|
11
|
+
];
|
|
12
|
+
export type EncodePlugin = (value: unknown) => [string, ...unknown[]] | false | null | undefined;
|
|
13
|
+
export type EncodeOptions = {
|
|
14
|
+
plugins?: EncodePlugin[];
|
|
15
|
+
redactErrors?: boolean | string;
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
};
|
|
18
|
+
export declare function encode(value: unknown, { plugins, redactErrors, signal }?: EncodeOptions): ReadableStream<string>;
|
|
19
|
+
export declare function encodeSync(value: unknown, chunks: {
|
|
20
|
+
push(...chunk: string[]): void;
|
|
21
|
+
}, refs: WeakMap<object, number>, promises: WeakMap<object, number>, asyncFrames: {
|
|
22
|
+
push(frame: AsyncFrame): void;
|
|
23
|
+
}, counters: {
|
|
24
|
+
refId: number;
|
|
25
|
+
promiseId: number;
|
|
26
|
+
}, plugins: EncodePlugin[], redactErrors: boolean | string): void;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export declare const STR_ARRAY_BUFFER = "A";
|
|
2
|
+
export declare const STR_ASYNC_ITERABLE = "*";
|
|
3
|
+
export declare const STR_BIG_INT_64_ARRAY = "J";
|
|
4
|
+
export declare const STR_BIG_UINT_64_ARRAY = "j";
|
|
5
|
+
export declare const STR_BIGINT = "b";
|
|
6
|
+
export declare const STR_BLOB = "K";
|
|
7
|
+
export declare const STR_DATA_VIEW = "V";
|
|
8
|
+
export declare const STR_DATE = "D";
|
|
9
|
+
export declare const STR_ERROR = "E";
|
|
10
|
+
export declare const STR_FAILURE = "!";
|
|
11
|
+
export declare const STR_FALSE = "false";
|
|
12
|
+
export declare const STR_FILE = "k";
|
|
13
|
+
export declare const STR_FLOAT_32_ARRAY = "H";
|
|
14
|
+
export declare const STR_FLOAT_64_ARRAY = "h";
|
|
15
|
+
export declare const STR_FORM_DATA = "F";
|
|
16
|
+
export declare const STR_INFINITY = "I";
|
|
17
|
+
export declare const STR_INT_16_ARRAY = "L";
|
|
18
|
+
export declare const STR_INT_32_ARRAY = "G";
|
|
19
|
+
export declare const STR_INT_8_ARRAY = "O";
|
|
20
|
+
export declare const STR_MAP = "M";
|
|
21
|
+
export declare const STR_NaN = "NaN";
|
|
22
|
+
export declare const STR_NEGATIVE_INFINITY = "i";
|
|
23
|
+
export declare const STR_NEGATIVE_ZERO = "z";
|
|
24
|
+
export declare const STR_NULL = "null";
|
|
25
|
+
export declare const STR_PLUGIN = "P";
|
|
26
|
+
export declare const STR_PROMISE = "$";
|
|
27
|
+
export declare const STR_READABLE_STREAM = "R";
|
|
28
|
+
export declare const STR_REDACTED = "<redacted>";
|
|
29
|
+
export declare const STR_REFERENCE_SYMBOL = "@";
|
|
30
|
+
export declare const STR_REGEXP = "r";
|
|
31
|
+
export declare const STR_SET = "S";
|
|
32
|
+
export declare const STR_SUCCESS = ":";
|
|
33
|
+
export declare const STR_SYMBOL = "s";
|
|
34
|
+
export declare const STR_TRUE = "true";
|
|
35
|
+
export declare const STR_UINT_16_ARRAY = "l";
|
|
36
|
+
export declare const STR_UINT_32_ARRAY = "g";
|
|
37
|
+
export declare const STR_UINT_8_ARRAY = "o";
|
|
38
|
+
export declare const STR_UINT_8_ARRAY_CLAMPED = "C";
|
|
39
|
+
export declare const STR_UNDEFINED = "u";
|
|
40
|
+
export declare const STR_URL = "U";
|
|
41
|
+
declare let SUPPORTS_FILE: boolean;
|
|
42
|
+
export { SUPPORTS_FILE };
|
|
43
|
+
export declare class WaitGroup {
|
|
44
|
+
#private;
|
|
45
|
+
p: number;
|
|
46
|
+
add(): void;
|
|
47
|
+
done(): void;
|
|
48
|
+
wait(): Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
export declare class Deferred<T> {
|
|
51
|
+
promise: Promise<T>;
|
|
52
|
+
resolve: (value: T) => void;
|
|
53
|
+
reject: (error: unknown) => void;
|
|
54
|
+
constructor();
|
|
55
|
+
}
|
|
56
|
+
export declare class DeferredAsyncIterable<T> {
|
|
57
|
+
#private;
|
|
58
|
+
iterable: AsyncIterable<T>;
|
|
59
|
+
constructor();
|
|
60
|
+
resolve(): void;
|
|
61
|
+
reject(error: unknown): void;
|
|
62
|
+
yield(value: T): void;
|
|
63
|
+
}
|
|
64
|
+
export declare class DeferredReadableStream<T> extends DeferredAsyncIterable<T> {
|
|
65
|
+
readable: ReadableStream<T>;
|
|
66
|
+
}
|
|
67
|
+
export declare class TurboBlob extends Blob {
|
|
68
|
+
#private;
|
|
69
|
+
promise?: Promise<ArrayBuffer>;
|
|
70
|
+
constructor();
|
|
71
|
+
constructor(from: TurboBlob, start: number | undefined, end: number | undefined, contentType: string | undefined);
|
|
72
|
+
get size(): number;
|
|
73
|
+
set size(value: number);
|
|
74
|
+
get type(): string;
|
|
75
|
+
set type(value: string);
|
|
76
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
77
|
+
bytes(): Promise<Uint8Array>;
|
|
78
|
+
slice(start?: number, end?: number, contentType?: string): Blob;
|
|
79
|
+
stream(): ReadableStream<Uint8Array>;
|
|
80
|
+
text(): Promise<string>;
|
|
81
|
+
}
|
|
82
|
+
declare const FileBaseClass: {
|
|
83
|
+
new (fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
|
|
84
|
+
prototype: File;
|
|
85
|
+
} | {
|
|
86
|
+
new (blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
|
|
87
|
+
prototype: Blob;
|
|
88
|
+
};
|
|
89
|
+
export declare class TurboFile extends FileBaseClass {
|
|
90
|
+
#private;
|
|
91
|
+
promise?: Promise<ArrayBuffer>;
|
|
92
|
+
constructor();
|
|
93
|
+
constructor(from: TurboFile, start: number | undefined, end: number | undefined, contentType: string | undefined);
|
|
94
|
+
get name(): string;
|
|
95
|
+
set name(value: string);
|
|
96
|
+
get lastModified(): number;
|
|
97
|
+
set lastModified(value: number);
|
|
98
|
+
get size(): number;
|
|
99
|
+
set size(value: number);
|
|
100
|
+
get type(): string;
|
|
101
|
+
set type(value: string);
|
|
102
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
103
|
+
bytes(): Promise<Uint8Array>;
|
|
104
|
+
slice(start?: number, end?: number, contentType?: string): Blob;
|
|
105
|
+
stream(): ReadableStream<Uint8Array>;
|
|
106
|
+
text(): Promise<string>;
|
|
107
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { buildAbsoluteURL };
|
|
3
|
+
export { parseURL };
|
|
4
|
+
export { normalizePath };
|
|
5
|
+
export { buildURLFromParts };
|
|
6
|
+
}
|
|
7
|
+
export default _default;
|
|
8
|
+
export function buildAbsoluteURL(baseURL: any, relativeURL: any, opts: any): any;
|
|
9
|
+
export function buildURLFromParts(parts: any): any;
|
|
10
|
+
export function normalizePath(path: any): any;
|
|
11
|
+
export function parseURL(url: any): {
|
|
12
|
+
scheme: string;
|
|
13
|
+
netLoc: string;
|
|
14
|
+
path: string;
|
|
15
|
+
params: string;
|
|
16
|
+
query: string;
|
|
17
|
+
fragment: string;
|
|
18
|
+
} | null;
|
package/urlToolkit.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { buildAbsoluteURL as e, buildURLFromParts as l, default as o, normalizePath as t, parseURL as u } from "./url-toolkit/src/url-toolkit.js";
|
|
2
|
+
export {
|
|
3
|
+
e as buildAbsoluteURL,
|
|
4
|
+
l as buildURLFromParts,
|
|
5
|
+
o as default,
|
|
6
|
+
t as normalizePath,
|
|
7
|
+
u as parseURL
|
|
8
|
+
};
|