utils-lib-js 1.6.2 → 1.6.3

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 (72) hide show
  1. package/dist/bundle/array.d.ts +10 -0
  2. package/dist/bundle/base.d.ts +14 -0
  3. package/dist/bundle/element.d.ts +6 -0
  4. package/dist/bundle/event.d.ts +14 -0
  5. package/dist/bundle/function.d.ts +12 -0
  6. package/dist/bundle/index.d.ts +51 -0
  7. package/dist/bundle/index.js +1023 -0
  8. package/dist/bundle/object.d.ts +30 -0
  9. package/dist/bundle/request.d.ts +60 -0
  10. package/dist/bundle/static.d.ts +16 -0
  11. package/dist/bundle/storage.d.ts +9 -0
  12. package/dist/bundle/types.d.ts +103 -0
  13. package/dist/cjs/array.d.ts +10 -10
  14. package/dist/cjs/array.js +19 -19
  15. package/dist/cjs/base.d.ts +14 -14
  16. package/dist/cjs/base.js +56 -56
  17. package/dist/cjs/element.d.ts +6 -6
  18. package/dist/cjs/element.js +16 -16
  19. package/dist/cjs/event.d.ts +14 -14
  20. package/dist/cjs/event.js +53 -53
  21. package/dist/cjs/function.d.ts +12 -12
  22. package/dist/cjs/function.js +66 -66
  23. package/dist/cjs/index.d.ts +51 -51
  24. package/dist/cjs/index.js +54 -54
  25. package/dist/cjs/object.d.ts +30 -30
  26. package/dist/cjs/object.js +190 -190
  27. package/dist/cjs/request.d.ts +60 -60
  28. package/dist/cjs/request.js +239 -239
  29. package/dist/cjs/static.d.ts +16 -16
  30. package/dist/cjs/static.js +18 -18
  31. package/dist/cjs/storage.d.ts +9 -9
  32. package/dist/cjs/storage.js +41 -41
  33. package/dist/cjs/types.d.ts +103 -103
  34. package/dist/cjs/types.js +2 -2
  35. package/dist/esm/array.d.ts +10 -10
  36. package/dist/esm/array.js +13 -13
  37. package/dist/esm/base.d.ts +14 -14
  38. package/dist/esm/base.js +48 -48
  39. package/dist/esm/element.d.ts +6 -6
  40. package/dist/esm/element.js +12 -12
  41. package/dist/esm/event.d.ts +14 -14
  42. package/dist/esm/event.js +45 -45
  43. package/dist/esm/function.d.ts +12 -12
  44. package/dist/esm/function.js +59 -59
  45. package/dist/esm/index.d.ts +51 -51
  46. package/dist/esm/index.js +35 -35
  47. package/dist/esm/object.d.ts +30 -30
  48. package/dist/esm/object.js +174 -174
  49. package/dist/esm/request.d.ts +60 -60
  50. package/dist/esm/request.js +236 -236
  51. package/dist/esm/static.d.ts +16 -16
  52. package/dist/esm/static.js +15 -15
  53. package/dist/esm/storage.d.ts +9 -9
  54. package/dist/esm/storage.js +35 -35
  55. package/dist/esm/types.d.ts +103 -103
  56. package/dist/esm/types.js +1 -1
  57. package/dist/umd/array.d.ts +10 -0
  58. package/dist/umd/base.d.ts +14 -0
  59. package/dist/umd/element.d.ts +6 -0
  60. package/dist/umd/event.d.ts +14 -0
  61. package/dist/umd/function.d.ts +12 -0
  62. package/dist/umd/index.d.ts +51 -0
  63. package/dist/umd/index.js +1024 -0
  64. package/dist/umd/object.d.ts +30 -0
  65. package/dist/umd/request.d.ts +60 -0
  66. package/dist/umd/static.d.ts +16 -0
  67. package/dist/umd/storage.d.ts +9 -0
  68. package/dist/umd/types.d.ts +103 -0
  69. package/package.json +12 -4
  70. package/pnpm-lock.yaml +279 -8
  71. package/rollup.config.js +35 -0
  72. package/tsconfig.umd.json +6 -0
@@ -0,0 +1,30 @@
1
+ import { IGetValue, ISetValue, IMixIn, ICloneDeep, ICreateObjectVariable, IEnumInversion, IInherit, ICreateObject, IGetInstance, IClassDecorator, IStringToJson, IJsonToString } from "./index.js";
2
+ export declare const getValue: IGetValue;
3
+ export declare const setValue: ISetValue;
4
+ export declare const mixIn: IMixIn;
5
+ export declare const enumInversion: IEnumInversion;
6
+ export declare const isNotObject: (source: any, type: any) => boolean;
7
+ export declare const cloneDeep: ICloneDeep;
8
+ export declare const createObjectVariable: ICreateObjectVariable;
9
+ export declare const createObject: ICreateObject;
10
+ export declare const inherit: IInherit;
11
+ export declare const getInstance: IGetInstance;
12
+ export declare const classDecorator: IClassDecorator;
13
+ export declare const stringToJson: IStringToJson;
14
+ export declare const jsonToString: IJsonToString;
15
+ declare const _default: {
16
+ getValue: IGetValue;
17
+ setValue: ISetValue;
18
+ mixIn: IMixIn;
19
+ enumInversion: IEnumInversion;
20
+ isNotObject: (source: any, type: any) => boolean;
21
+ cloneDeep: ICloneDeep;
22
+ createObjectVariable: ICreateObjectVariable;
23
+ createObject: ICreateObject;
24
+ inherit: IInherit;
25
+ getInstance: IGetInstance;
26
+ classDecorator: IClassDecorator;
27
+ stringToJson: IStringToJson;
28
+ jsonToString: IJsonToString;
29
+ };
30
+ export default _default;
@@ -0,0 +1,60 @@
1
+ import { IRequest, IRequestBase, IRequestInit, IInterceptors, IUrl, IObject, IRequestBody, IRequestOptions, IRequestBaseFn, IEnv } from "./index.js";
2
+ declare class Interceptors implements IInterceptors {
3
+ private requestSuccess;
4
+ private responseSuccess;
5
+ private error;
6
+ use(type: "request" | "response" | "error", fn: Function): IInterceptors;
7
+ get reqFn(): Function;
8
+ get resFn(): Function;
9
+ get errFn(): Function;
10
+ }
11
+ declare abstract class RequestBase extends Interceptors implements IRequestBase {
12
+ readonly origin: IUrl;
13
+ constructor(origin: IUrl);
14
+ abstract fetch(url: string, opts: IRequestOptions): Promise<void>;
15
+ abstract http(url: string, opts: IRequestOptions): Promise<void>;
16
+ chackUrl: (url: IUrl) => boolean;
17
+ checkIsHttps: (url: IUrl) => boolean;
18
+ fixOrigin: (fixStr: string) => string;
19
+ envDesc: () => IEnv;
20
+ errorFn: (reject: any) => (err: any) => any;
21
+ clearTimer: (opts: any) => any;
22
+ initAbort: (params: IRequestOptions) => IRequestOptions;
23
+ requestType: () => IRequestBaseFn;
24
+ getDataByType: (type: any, response: any) => any;
25
+ formatBodyString: (bodyString: string) => IObject<Function>;
26
+ }
27
+ declare abstract class RequestInit extends RequestBase implements IRequestInit {
28
+ constructor(origin: any);
29
+ abstract fetch(url: any, opts: any): Promise<void>;
30
+ abstract http(url: any, opts: any): Promise<void>;
31
+ initDefaultParams: (url: IUrl, { method, query, headers, body, timeout, controller, type, ...others }: {
32
+ [x: string]: any;
33
+ method?: string;
34
+ query?: {};
35
+ headers?: {};
36
+ body?: any;
37
+ timeout?: number;
38
+ controller?: any;
39
+ type?: string;
40
+ }) => IRequestOptions;
41
+ initFetchParams: (url: IUrl, opts: IRequestOptions) => any;
42
+ initHttpParams: (url: IUrl, opts: IRequestOptions) => any;
43
+ }
44
+ export declare class Request extends RequestInit implements IRequest {
45
+ private request;
46
+ constructor(origin: any);
47
+ fetch: (_url: string, _opts: IRequestOptions) => Promise<any>;
48
+ http: (_url: string, _opts: IRequestOptions) => Promise<any>;
49
+ GET: (url?: IUrl, query?: IObject<any>, _?: IRequestBody | void, opts?: IRequestOptions) => any;
50
+ POST: (url?: IUrl, query?: IObject<any>, body?: IRequestBody, opts?: IRequestOptions) => any;
51
+ PUT: (url?: IUrl, query?: IObject<any>, body?: IRequestBody, opts?: IRequestOptions) => any;
52
+ DELETE: (url?: IUrl, query?: IObject<any>, body?: IRequestBody, opts?: IRequestOptions) => any;
53
+ OPTIONS: (url?: IUrl, query?: IObject<any>, body?: IRequestBody, opts?: IRequestOptions) => any;
54
+ HEAD: (url?: IUrl, query?: IObject<any>, body?: IRequestBody, opts?: IRequestOptions) => any;
55
+ PATCH: (url?: IUrl, query?: IObject<any>, body?: IRequestBody, opts?: IRequestOptions) => any;
56
+ }
57
+ declare const _default: {
58
+ Request: typeof Request;
59
+ };
60
+ export default _default;
@@ -0,0 +1,16 @@
1
+ export declare enum types {
2
+ "[object Array]" = "array",
3
+ "[object Object]" = "object",
4
+ "[object Function]" = "function",
5
+ "[object Set]" = "set",
6
+ "[object Map]" = "map",
7
+ "[object WeakMap]" = "weakMap",
8
+ "[object WeakSet]" = "weakSet",
9
+ "[object Date]" = "date",
10
+ "[object RegExp]" = "regExp",
11
+ "[object Math]" = "math"
12
+ }
13
+ declare const _default: {
14
+ types: typeof types;
15
+ };
16
+ export default _default;
@@ -0,0 +1,9 @@
1
+ export declare const setStorage: (key: string, val: any) => void;
2
+ export declare const getStorage: (key: string) => any;
3
+ export declare const clearStorage: (key: string) => void;
4
+ declare const _default: {
5
+ setStorage: (key: string, val: any) => void;
6
+ getStorage: (key: string) => any;
7
+ clearStorage: (key: string) => void;
8
+ };
9
+ export default _default;
@@ -0,0 +1,103 @@
1
+ export type IKey = string | symbol | number;
2
+ export interface IObject<T> {
3
+ [key: IKey]: T | IObject<any>;
4
+ }
5
+ export interface IPromise extends IObject<any> {
6
+ promise: Promise<void>;
7
+ resolve: (res: any) => unknown;
8
+ reject: (err: any) => unknown;
9
+ }
10
+ export type IInstance<T> = {
11
+ _instance: Function;
12
+ } & T;
13
+ export type IDemoteArray<T> = Array<IDemoteArray<T> | T>;
14
+ export type IRandomNum = (min: number, max: number, bool?: boolean) => number;
15
+ export type IUrlSplit = (url: string) => IObject<any>;
16
+ export type IUrlJoin = (url: string, query: object) => string;
17
+ export type IGetType<T> = (data: any) => typeof data | T[keyof T] | "null";
18
+ export type IGetTypeByList = (data: any, whiteList: string[]) => boolean;
19
+ export type IGetValue = <T, U = IObject<T> | IObject<T>[IKey]>(object: U, key: string, defaultValue?: any) => U;
20
+ export type ISetValue = <T>(object: IObject<T>, key: string, value?: any) => IObject<T>;
21
+ export type IMixIn = <U extends IObject<any>>(target?: U, source?: IObject<any>, overwrite?: boolean) => U;
22
+ export type IEnumInversion = (target: IObject<string>) => IObject<string>;
23
+ export type ICloneDeep = (target?: any) => any;
24
+ export type ICreateObjectVariable = (type: string, source?: any) => any;
25
+ export type ICreateObject = <T, U extends T>(source: T) => U;
26
+ export type IInherit = <T extends Function>(source: T, target?: Function) => Function;
27
+ export type IGetInstance = (classProto: IInstance<FunctionConstructor>, overwrite?: boolean, ...params: any[]) => Function;
28
+ export type IClassDecorator = (params: IObject<any>) => <TFunction extends Function>(target: TFunction) => void;
29
+ export type IStringToJson = (target: string) => IObject<any> | null;
30
+ export type IJsonToString = (target: IObject<any>) => string;
31
+ export type IThrottle = (fn: Function, time: number) => (...args: any[]) => void;
32
+ export type IDebounce = (fn: Function, time: number) => (...args: any[]) => void;
33
+ export type IDefer = () => IPromise;
34
+ export type ICatchAwait<T extends Promise<any>> = (defer: T) => T;
35
+ export type IArrayRandom<T extends any[]> = (arr: T) => T;
36
+ export type IArrayUniq<T extends any[]> = (arr: T) => T;
37
+ export type IArrayDemote<T extends IDemoteArray<any>> = (arr: T, result?: T) => T;
38
+ interface IElementParams<T> {
39
+ ele: T | string;
40
+ style: CSSStyleDeclaration;
41
+ attr: Attr;
42
+ parent: T;
43
+ }
44
+ export type ICreateElement<T = HTMLElement> = (params: IElementParams<T>) => T;
45
+ export type IAddHandler = <T extends Document>(ele: T, type: string, handler: (e: Event) => void) => void;
46
+ export type IStopBubble = (e: Event) => void;
47
+ export type IStopDefault = (e: Event) => void;
48
+ export type IRemoveHandler = <T extends Document>(ele: T, type: string, handler: (e: Event) => void) => void;
49
+ export type IDispatchEvent = <T extends Document>(ele: T, data: any) => void;
50
+ export type IRequestParams<T> = T | IObject<any> | null;
51
+ export type IUrl = string;
52
+ export type IEnv = 'Window' | 'Node';
53
+ export type IDataType = "text" | "json" | "blob" | "formData" | "arrayBuffer";
54
+ export type IRequestMethods = "GET" | "POST" | "DELETE" | "PUT" | "OPTION" | "HEAD" | "PATCH";
55
+ export type IRequestBody = IRequestParams<BodyInit>;
56
+ export type IRequestHeaders = IRequestParams<HeadersInit>;
57
+ export type IRequestBaseFn = (url: IUrl, opts: IRequestOptions) => Promise<any>;
58
+ export type IRequestFn = (url?: IUrl, query?: IObject<any>, body?: IRequestBody, opts?: IRequestOptions) => Promise<any>;
59
+ export type IRequestOptions = {
60
+ method?: IRequestMethods;
61
+ query?: IRequestParams<IObject<any>>;
62
+ body?: IRequestBody;
63
+ headers?: IRequestHeaders;
64
+ controller?: AbortController;
65
+ timeout?: number;
66
+ timer?: number | unknown | null;
67
+ [key: string]: any;
68
+ };
69
+ export type IInterceptors = {
70
+ use(type: "request" | "response" | "error", fn: Function): IInterceptors;
71
+ get reqFn(): Function;
72
+ get resFn(): Function;
73
+ get errFn(): Function;
74
+ };
75
+ export type IRequestBase = {
76
+ readonly origin: string;
77
+ chackUrl: (url: IUrl) => boolean;
78
+ envDesc: () => IEnv;
79
+ errorFn: <Err = any, R = Function>(reject: R) => (err: Err) => R;
80
+ clearTimer: (opts: IRequestOptions) => void;
81
+ initAbort: (opts: IRequestOptions) => IRequestOptions;
82
+ requestType: () => IRequestBaseFn;
83
+ fixOrigin: (fixStr: string) => string;
84
+ fetch: IRequestBaseFn;
85
+ http: IRequestBaseFn;
86
+ getDataByType: (type: IDataType, response: Response) => Promise<any>;
87
+ formatBodyString: (bodyString: string) => IObject<Function>;
88
+ };
89
+ export type IRequestInit = {
90
+ initDefaultParams: (url: IUrl, opts: IRequestOptions) => any;
91
+ initFetchParams: (url: IUrl, opts: IRequestOptions) => any;
92
+ initHttpParams: (url: IUrl, opts: IRequestOptions) => any;
93
+ };
94
+ export type IRequest = {
95
+ GET: IRequestFn;
96
+ POST: IRequestFn;
97
+ DELETE: IRequestFn;
98
+ PUT: IRequestFn;
99
+ OPTIONS: IRequestFn;
100
+ HEAD: IRequestFn;
101
+ PATCH: IRequestFn;
102
+ } & IRequestBase;
103
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utils-lib-js",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "JavaScript工具函数,封装的一些常用的js函数",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",
@@ -17,7 +17,7 @@
17
17
  "build:hot:esm": "tsc -p tsconfig.es.json -w",
18
18
  "build:hot:node": "tsc -p tsconfig.json -w",
19
19
  "build": "pnpm run tsc:build && pnpm run commonjs",
20
- "tsc:build": "rm -fr dist && tsc -p tsconfig.json && tsc -p tsconfig.es.json",
20
+ "tsc:build": "rm -fr dist && tsc -p tsconfig.json && tsc -p tsconfig.es.json && pnpm rollup -c",
21
21
  "build:publish": "pnpm run build && pnpm run publish",
22
22
  "commonjs": "cp ./commonjs.json dist/cjs/package.json",
23
23
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -34,11 +34,19 @@
34
34
  "author": "",
35
35
  "license": "ISC",
36
36
  "devDependencies": {
37
- "@types/node": "^18.7.15"
37
+ "@rollup/plugin-commonjs": "^24.0.1",
38
+ "@rollup/plugin-json": "^6.0.0",
39
+ "@rollup/plugin-node-resolve": "^15.0.1",
40
+ "@rollup/plugin-typescript": "^11.0.0",
41
+ "@types/node": "^18.7.15",
42
+ "rollup": "^3.20.2",
43
+ "tslib": "^2.5.0",
44
+ "typescript": "^5.0.2"
38
45
  },
39
46
  "dependencies": {
40
47
  "abort-controller": "^3.0.0",
41
48
  "event-message-center": "",
42
49
  "task-queue-lib": ""
43
- }
50
+ },
51
+ "umdModuleName": "UtilsLib"
44
52
  }
package/pnpm-lock.yaml CHANGED
@@ -1,25 +1,135 @@
1
- lockfileVersion: 5.4
1
+ lockfileVersion: 5.3
2
2
 
3
3
  specifiers:
4
+ '@rollup/plugin-commonjs': ^24.0.1
5
+ '@rollup/plugin-json': ^6.0.0
6
+ '@rollup/plugin-node-resolve': ^15.0.1
7
+ '@rollup/plugin-typescript': ^11.0.0
4
8
  '@types/node': ^18.7.15
5
9
  abort-controller: ^3.0.0
6
10
  event-message-center: ''
11
+ rollup: ^3.20.2
7
12
  task-queue-lib: ''
13
+ tslib: ^2.5.0
14
+ typescript: ^5.0.2
8
15
 
9
16
  dependencies:
10
17
  abort-controller: 3.0.0
11
- event-message-center: 1.2.1
12
- task-queue-lib: 1.1.1
18
+ event-message-center: 1.3.2
19
+ task-queue-lib: 1.2.0
13
20
 
14
21
  devDependencies:
22
+ '@rollup/plugin-commonjs': 24.0.1_rollup@3.20.2
23
+ '@rollup/plugin-json': 6.0.0_rollup@3.20.2
24
+ '@rollup/plugin-node-resolve': 15.0.1_rollup@3.20.2
25
+ '@rollup/plugin-typescript': 11.0.0_0ff49df61249f8ba6d86409388305ca9
15
26
  '@types/node': 18.11.9
27
+ rollup: 3.20.2
28
+ tslib: 2.5.0
29
+ typescript: 5.0.2
16
30
 
17
31
  packages:
18
32
 
33
+ /@jridgewell/sourcemap-codec/1.4.14:
34
+ resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==}
35
+ dev: true
36
+
37
+ /@rollup/plugin-commonjs/24.0.1_rollup@3.20.2:
38
+ resolution: {integrity: sha512-15LsiWRZk4eOGqvrJyu3z3DaBu5BhXIMeWnijSRvd8irrrg9SHpQ1pH+BUK4H6Z9wL9yOxZJMTLU+Au86XHxow==}
39
+ engines: {node: '>=14.0.0'}
40
+ peerDependencies:
41
+ rollup: ^2.68.0||^3.0.0
42
+ peerDependenciesMeta:
43
+ rollup:
44
+ optional: true
45
+ dependencies:
46
+ '@rollup/pluginutils': 5.0.2_rollup@3.20.2
47
+ commondir: 1.0.1
48
+ estree-walker: 2.0.2
49
+ glob: 8.1.0
50
+ is-reference: 1.2.1
51
+ magic-string: 0.27.0
52
+ rollup: 3.20.2
53
+ dev: true
54
+
55
+ /@rollup/plugin-json/6.0.0_rollup@3.20.2:
56
+ resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==}
57
+ engines: {node: '>=14.0.0'}
58
+ peerDependencies:
59
+ rollup: ^1.20.0||^2.0.0||^3.0.0
60
+ peerDependenciesMeta:
61
+ rollup:
62
+ optional: true
63
+ dependencies:
64
+ '@rollup/pluginutils': 5.0.2_rollup@3.20.2
65
+ rollup: 3.20.2
66
+ dev: true
67
+
68
+ /@rollup/plugin-node-resolve/15.0.1_rollup@3.20.2:
69
+ resolution: {integrity: sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==}
70
+ engines: {node: '>=14.0.0'}
71
+ peerDependencies:
72
+ rollup: ^2.78.0||^3.0.0
73
+ peerDependenciesMeta:
74
+ rollup:
75
+ optional: true
76
+ dependencies:
77
+ '@rollup/pluginutils': 5.0.2_rollup@3.20.2
78
+ '@types/resolve': 1.20.2
79
+ deepmerge: 4.3.1
80
+ is-builtin-module: 3.2.1
81
+ is-module: 1.0.0
82
+ resolve: 1.22.1
83
+ rollup: 3.20.2
84
+ dev: true
85
+
86
+ /@rollup/plugin-typescript/11.0.0_0ff49df61249f8ba6d86409388305ca9:
87
+ resolution: {integrity: sha512-goPyCWBiimk1iJgSTgsehFD5OOFHiAknrRJjqFCudcW8JtWiBlK284Xnn4flqMqg6YAjVG/EE+3aVzrL5qNSzQ==}
88
+ engines: {node: '>=14.0.0'}
89
+ peerDependencies:
90
+ rollup: ^2.14.0||^3.0.0
91
+ tslib: '*'
92
+ typescript: '>=3.7.0'
93
+ peerDependenciesMeta:
94
+ rollup:
95
+ optional: true
96
+ tslib:
97
+ optional: true
98
+ dependencies:
99
+ '@rollup/pluginutils': 5.0.2_rollup@3.20.2
100
+ resolve: 1.22.1
101
+ rollup: 3.20.2
102
+ tslib: 2.5.0
103
+ typescript: 5.0.2
104
+ dev: true
105
+
106
+ /@rollup/pluginutils/5.0.2_rollup@3.20.2:
107
+ resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==}
108
+ engines: {node: '>=14.0.0'}
109
+ peerDependencies:
110
+ rollup: ^1.20.0||^2.0.0||^3.0.0
111
+ peerDependenciesMeta:
112
+ rollup:
113
+ optional: true
114
+ dependencies:
115
+ '@types/estree': 1.0.0
116
+ estree-walker: 2.0.2
117
+ picomatch: 2.3.1
118
+ rollup: 3.20.2
119
+ dev: true
120
+
121
+ /@types/estree/1.0.0:
122
+ resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==}
123
+ dev: true
124
+
19
125
  /@types/node/18.11.9:
20
126
  resolution: {integrity: sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==}
21
127
  dev: true
22
128
 
129
+ /@types/resolve/1.20.2:
130
+ resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==}
131
+ dev: true
132
+
23
133
  /abort-controller/3.0.0:
24
134
  resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
25
135
  engines: {node: '>=6.5'}
@@ -27,8 +137,36 @@ packages:
27
137
  event-target-shim: 5.0.1
28
138
  dev: false
29
139
 
30
- /event-message-center/1.2.1:
31
- resolution: {integrity: sha512-Ld/XWhSMZbggqLd6Z5+U88Pim+kUbfa0x5oKBCMg5h+EsNDpss4LrvJF2hOj4YnAsn8RP1NYaqzySSGvcfIiaA==}
140
+ /balanced-match/1.0.2:
141
+ resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
142
+ dev: true
143
+
144
+ /brace-expansion/2.0.1:
145
+ resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
146
+ dependencies:
147
+ balanced-match: 1.0.2
148
+ dev: true
149
+
150
+ /builtin-modules/3.3.0:
151
+ resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==}
152
+ engines: {node: '>=6'}
153
+ dev: true
154
+
155
+ /commondir/1.0.1:
156
+ resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==}
157
+ dev: true
158
+
159
+ /deepmerge/4.3.1:
160
+ resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==}
161
+ engines: {node: '>=0.10.0'}
162
+ dev: true
163
+
164
+ /estree-walker/2.0.2:
165
+ resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
166
+ dev: true
167
+
168
+ /event-message-center/1.3.2:
169
+ resolution: {integrity: sha512-xOsocE6VvtJ0QhGBf2KHzeYPT6YDOcCOmPMrnZANZYSHCxgQ7OynN+kMEr3gLRbuPJZwv6Abeiy4Gyn/mJf/cQ==}
32
170
  dev: false
33
171
 
34
172
  /event-target-shim/5.0.1:
@@ -36,8 +174,141 @@ packages:
36
174
  engines: {node: '>=6'}
37
175
  dev: false
38
176
 
39
- /task-queue-lib/1.1.1:
40
- resolution: {integrity: sha512-COVqioPe8Wk9fBT7rT/50j+VeL8Rbjsv3z4I4lIlqpvcohfM98cC6GIT/EC2PaUD3wwEde3kp2NaICzQKeQizQ==}
177
+ /fs.realpath/1.0.0:
178
+ resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
179
+ dev: true
180
+
181
+ /fsevents/2.3.2:
182
+ resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
183
+ engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
184
+ os: [darwin]
185
+ requiresBuild: true
186
+ dev: true
187
+ optional: true
188
+
189
+ /function-bind/1.1.1:
190
+ resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}
191
+ dev: true
192
+
193
+ /glob/8.1.0:
194
+ resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==}
195
+ engines: {node: '>=12'}
196
+ dependencies:
197
+ fs.realpath: 1.0.0
198
+ inflight: 1.0.6
199
+ inherits: 2.0.4
200
+ minimatch: 5.1.6
201
+ once: 1.4.0
202
+ dev: true
203
+
204
+ /has/1.0.3:
205
+ resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==}
206
+ engines: {node: '>= 0.4.0'}
207
+ dependencies:
208
+ function-bind: 1.1.1
209
+ dev: true
210
+
211
+ /inflight/1.0.6:
212
+ resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
213
+ dependencies:
214
+ once: 1.4.0
215
+ wrappy: 1.0.2
216
+ dev: true
217
+
218
+ /inherits/2.0.4:
219
+ resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
220
+ dev: true
221
+
222
+ /is-builtin-module/3.2.1:
223
+ resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==}
224
+ engines: {node: '>=6'}
225
+ dependencies:
226
+ builtin-modules: 3.3.0
227
+ dev: true
228
+
229
+ /is-core-module/2.11.0:
230
+ resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==}
41
231
  dependencies:
42
- event-message-center: 1.2.1
232
+ has: 1.0.3
233
+ dev: true
234
+
235
+ /is-module/1.0.0:
236
+ resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==}
237
+ dev: true
238
+
239
+ /is-reference/1.2.1:
240
+ resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==}
241
+ dependencies:
242
+ '@types/estree': 1.0.0
243
+ dev: true
244
+
245
+ /magic-string/0.27.0:
246
+ resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==}
247
+ engines: {node: '>=12'}
248
+ dependencies:
249
+ '@jridgewell/sourcemap-codec': 1.4.14
250
+ dev: true
251
+
252
+ /minimatch/5.1.6:
253
+ resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
254
+ engines: {node: '>=10'}
255
+ dependencies:
256
+ brace-expansion: 2.0.1
257
+ dev: true
258
+
259
+ /once/1.4.0:
260
+ resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
261
+ dependencies:
262
+ wrappy: 1.0.2
263
+ dev: true
264
+
265
+ /path-parse/1.0.7:
266
+ resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
267
+ dev: true
268
+
269
+ /picomatch/2.3.1:
270
+ resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
271
+ engines: {node: '>=8.6'}
272
+ dev: true
273
+
274
+ /resolve/1.22.1:
275
+ resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==}
276
+ hasBin: true
277
+ dependencies:
278
+ is-core-module: 2.11.0
279
+ path-parse: 1.0.7
280
+ supports-preserve-symlinks-flag: 1.0.0
281
+ dev: true
282
+
283
+ /rollup/3.20.2:
284
+ resolution: {integrity: sha512-3zwkBQl7Ai7MFYQE0y1MeQ15+9jsi7XxfrqwTb/9EK8D9C9+//EBR4M+CuA1KODRaNbFez/lWxA5vhEGZp4MUg==}
285
+ engines: {node: '>=14.18.0', npm: '>=8.0.0'}
286
+ hasBin: true
287
+ optionalDependencies:
288
+ fsevents: 2.3.2
289
+ dev: true
290
+
291
+ /supports-preserve-symlinks-flag/1.0.0:
292
+ resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
293
+ engines: {node: '>= 0.4'}
294
+ dev: true
295
+
296
+ /task-queue-lib/1.2.0:
297
+ resolution: {integrity: sha512-UTJlAIKketjeU3w8+iugtU4a467x9Rj1PgknmjRWQ69fsr+zAfo2kqXCcNSyItI/Le/OoDn96BTMT/Gfycb2lA==}
298
+ dependencies:
299
+ event-message-center: 1.3.2
43
300
  dev: false
301
+
302
+ /tslib/2.5.0:
303
+ resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==}
304
+ dev: true
305
+
306
+ /typescript/5.0.2:
307
+ resolution: {integrity: sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==}
308
+ engines: {node: '>=12.20'}
309
+ hasBin: true
310
+ dev: true
311
+
312
+ /wrappy/1.0.2:
313
+ resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
314
+ dev: true
@@ -0,0 +1,35 @@
1
+ import typescript from "@rollup/plugin-typescript";
2
+ import json from "@rollup/plugin-json";
3
+ import resolve from "@rollup/plugin-node-resolve";
4
+ import commonjs from "@rollup/plugin-commonjs";
5
+ import { readFileSync } from "fs";
6
+ const packageJson = JSON.parse(readFileSync("./package.json", "utf8"));
7
+ const pkgName = packageJson.umdModuleName;
8
+ export default {
9
+ input: "src/index.ts",
10
+ output: [
11
+ {
12
+ file: "dist/umd/index.js",
13
+ format: "umd",
14
+ name: pkgName,
15
+ globals: {
16
+ "event-message-center": "MessageCenter",
17
+ "task-queue-lib": "TaskQueue",
18
+ },
19
+ external: ["event-message-center", "task-queue"],
20
+ },
21
+ {
22
+ file: "dist/bundle/index.js",
23
+ format: "iife",
24
+ name: pkgName,
25
+ },
26
+ ],
27
+ plugins: [
28
+ typescript({
29
+ tsconfig: "./tsconfig.umd.json",
30
+ }),
31
+ json(),
32
+ resolve(),
33
+ commonjs(),
34
+ ],
35
+ };
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "./tsconfig",
3
+ "compilerOptions": {
4
+ "module": "esnext"
5
+ }
6
+ }