@ix-xs/node-comfort 1.0.5 → 1.0.52

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/index.js CHANGED
@@ -9,7 +9,7 @@ module.exports = {
9
9
  ...checker,
10
10
  ...cli,
11
11
  ...fs,
12
- ...localStorage,
12
+ localStorage,
13
13
  ...logger,
14
14
  ...utils,
15
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ix-xs/node-comfort",
3
- "version": "1.0.5",
3
+ "version": "1.0.52",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -10,9 +10,5 @@
10
10
  "keywords": [],
11
11
  "author": "",
12
12
  "license": "ISC",
13
- "type": "commonjs",
14
- "devDependencies": {
15
- "@types/node": "^25.2.0",
16
- "typescript": "^5.9.3"
17
- }
13
+ "type": "commonjs"
18
14
  }
@@ -17,7 +17,7 @@ module.exports = class localStorage {
17
17
  #models = new Map();
18
18
 
19
19
  constructor(path = fs.createPath("localStorage/localStorage.sqlite")) {
20
- if (path.includes("/")) {
20
+ if (path.replaceAll("\\", "/").includes("/")) {
21
21
  const split = path.split("/");
22
22
  const file = split[split.length - 1];
23
23
  const folder = fs.createPath(path.replace(file, ""));
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "CommonJS",
5
- "allowJs": true,
6
- "declaration": true,
7
- "emitDeclarationOnly": true,
8
- "outDir": "types",
9
- "declarationMap": true,
10
- "skipLibCheck": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "moduleResolution": "node",
13
- "esModuleInterop": true,
14
- "resolveJsonModule": true
15
- },
16
- "include": ["**/*", "test.js"],
17
- "exclude": ["node_modules", "types"]
18
- }
package/types/index.d.ts DELETED
@@ -1,193 +0,0 @@
1
- declare const _exports: {
2
- wait(ms: number): Promise<any>;
3
- when(predicate: boolean | Promise<boolean> | (() => boolean | Promise<boolean>), payload?: any, options?: {
4
- interval?: number;
5
- timeout?: number | null;
6
- max?: number | null;
7
- }): {
8
- start(): /*elided*/ any;
9
- stop(): /*elided*/ any;
10
- on<E extends "error" | "trigger" | "timeout">(event: E, handler: {
11
- error: (error: any) => void | Promise<void>;
12
- trigger: (payload: any) => void | Promise<void>;
13
- timeout: (payload: any) => void | Promise<void>;
14
- }[E]): /*elided*/ any;
15
- };
16
- dontCrash(): {
17
- on<E extends "error" | "exit" | "sig" | "beforeExit">(event: E, handler: {
18
- error: (error: Error | unknown) => void | Promise<void>;
19
- exit: (code: number) => void | Promise<void>;
20
- sig: (signal: "SIGINT" | "SIGTERM" | "SIGQUIT") => void | Promise<void>;
21
- beforeExit: (code: number) => void | Promise<void>;
22
- }[E]): /*elided*/ any;
23
- };
24
- JSONString(value: any): string;
25
- JSONParse(value: any): any;
26
- log(content: any): {
27
- log(content: any): /*elided*/ any;
28
- logify(content: any): string;
29
- group(label: string): /*elided*/ any;
30
- groupEnd(): /*elided*/ any;
31
- setLogger(options?: {
32
- delimiters?: {
33
- start?: string;
34
- end?: string;
35
- };
36
- timestamp?: boolean;
37
- }): /*elided*/ any;
38
- };
39
- logify(content: any): string;
40
- group(label: string): {
41
- log(content: any): /*elided*/ any;
42
- logify(content: any): string;
43
- group(label: string): /*elided*/ any;
44
- groupEnd(): /*elided*/ any;
45
- setLogger(options?: {
46
- delimiters?: {
47
- start?: string;
48
- end?: string;
49
- };
50
- timestamp?: boolean;
51
- }): /*elided*/ any;
52
- };
53
- groupEnd(): {
54
- log(content: any): /*elided*/ any;
55
- logify(content: any): string;
56
- group(label: string): /*elided*/ any;
57
- groupEnd(): /*elided*/ any;
58
- setLogger(options?: {
59
- delimiters?: {
60
- start?: string;
61
- end?: string;
62
- };
63
- timestamp?: boolean;
64
- }): /*elided*/ any;
65
- };
66
- setLogger(options?: {
67
- delimiters?: {
68
- start?: string;
69
- end?: string;
70
- };
71
- timestamp?: boolean;
72
- }): {
73
- log(content: any): /*elided*/ any;
74
- logify(content: any): string;
75
- group(label: string): /*elided*/ any;
76
- groupEnd(): /*elided*/ any;
77
- setLogger(options?: {
78
- delimiters?: {
79
- start?: string;
80
- end?: string;
81
- };
82
- timestamp?: boolean;
83
- }): /*elided*/ any;
84
- };
85
- getEnv(value: string, envFilePath: any): string;
86
- createPath(path?: string): string;
87
- getFoldersIn(path?: string, recursive?: boolean): string[];
88
- getFolder(path?: string): string;
89
- getFilesIn(path?: string, recursive?: boolean): string[];
90
- getFile(path: string): string;
91
- createFolder(path: string, force?: boolean): boolean;
92
- createFile(path: string, force?: boolean, data?: string | object | null | undefined): boolean;
93
- deleteFoldersIn(path?: string, filter?: (folder: string) => boolean): number;
94
- deleteFolder(path: string): boolean;
95
- deleteFilesIn(path?: string, recursive?: boolean, filter?: (file: string) => boolean): number;
96
- deleteFile(path: string): boolean;
97
- copyFoldersIn(options: {
98
- dest: string;
99
- path?: string;
100
- recursive?: boolean;
101
- withFiles?: boolean;
102
- force?: boolean;
103
- filter?: (folder: string) => boolean;
104
- }): number;
105
- copyFolder(options: {
106
- dest: string;
107
- path?: string;
108
- recursive?: boolean;
109
- withFiles?: boolean;
110
- force?: boolean;
111
- }): boolean;
112
- copyFilesIn(options: {
113
- dest: string;
114
- path?: string;
115
- recursive?: boolean;
116
- force?: boolean;
117
- filter?: (file: string) => boolean;
118
- }): number;
119
- copyFile(options: {
120
- path: string;
121
- dest: string;
122
- force?: boolean;
123
- }): boolean;
124
- moveFoldersIn(options: {
125
- dest: string;
126
- path?: string;
127
- recursive?: boolean;
128
- withFiles?: boolean;
129
- force?: boolean;
130
- filter?: (folder: string) => boolean;
131
- }): number;
132
- moveFolder(options: {
133
- path: string;
134
- dest: string;
135
- recursive?: boolean;
136
- withFiles?: boolean;
137
- force?: boolean;
138
- }): boolean;
139
- moveFilesIn(options: {
140
- dest: string;
141
- path?: string;
142
- recursive?: boolean;
143
- force?: boolean;
144
- filter?: (file: string) => boolean;
145
- }): number;
146
- moveFile(options: {
147
- path: string;
148
- dest: string;
149
- force?: boolean;
150
- }): boolean;
151
- readFile(path: string): string;
152
- watch(options?: {
153
- path?: string;
154
- recursive?: boolean;
155
- filter?: (event: string, file: string) => boolean;
156
- }): {
157
- on<E extends "change" | "rename" | "all">(event: E, callback: {
158
- change: (file: string) => void | Promise<void>;
159
- rename: (file: string) => void | Promise<void>;
160
- all: (event: "change" | "rename" | "all", file: string) => void | Promise<void>;
161
- }[E]): /*elided*/ any;
162
- stop(): void;
163
- pause(): /*elided*/ any;
164
- resume(): /*elided*/ any;
165
- };
166
- exec(command: any): NonSharedBuffer & string;
167
- stream: {
168
- new (command: any, args: any): {
169
- "__#private@#processus": import("node:child_process").ChildProcessByStdio<null, import("node:stream").Readable, import("node:stream").Readable>;
170
- "__#private@#events": import("node:events")<any>;
171
- on<E extends "data" | "error" | "stopped">(event: E, handler: {
172
- error: (error: Error) => void | Promise<void>;
173
- data: (chunk: string) => void | Promise<void>;
174
- stopped: (code: number | null, signal: keyof import("node:child_process").ChildProcessEventMap) => void | Promise<void>;
175
- }[E]): /*elided*/ any;
176
- stop(): Promise<any>;
177
- };
178
- };
179
- isArray(value: any): value is any[];
180
- isNumber(value: any): boolean;
181
- isFunction(value: any): boolean;
182
- isObject(value: any): boolean;
183
- isBoolean(value: any): value is boolean;
184
- isString(value: any): value is string;
185
- isUndefined(value: any): value is undefined;
186
- isNull(value: any): boolean;
187
- isDate(value: any): value is Date;
188
- isMap(value: any): value is Map<unknown, unknown>;
189
- isSet(value: any): value is Set<unknown>;
190
- isError(value: any): value is Error;
191
- };
192
- export = _exports;
193
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":""}
@@ -1,49 +0,0 @@
1
- /**
2
- * @param {*} value
3
- */
4
- export function isArray(value: any): value is any[];
5
- /**
6
- * @param {*} value
7
- */
8
- export function isNumber(value: any): boolean;
9
- /**
10
- * @param {*} value
11
- */
12
- export function isFunction(value: any): boolean;
13
- /**
14
- * @param {*} value
15
- */
16
- export function isObject(value: any): boolean;
17
- /**
18
- * @param {*} value
19
- */
20
- export function isBoolean(value: any): value is boolean;
21
- /**
22
- * @param {*} value
23
- */
24
- export function isString(value: any): value is string;
25
- /**
26
- * @param {*} value
27
- */
28
- export function isUndefined(value: any): value is undefined;
29
- /**
30
- * @param {*} value
31
- */
32
- export function isNull(value: any): boolean;
33
- /**
34
- * @param {*} value
35
- */
36
- export function isDate(value: any): value is Date;
37
- /**
38
- * @param {*} value
39
- */
40
- export function isMap(value: any): value is Map<unknown, unknown>;
41
- /**
42
- * @param {*} value
43
- */
44
- export function isSet(value: any): value is Set<unknown>;
45
- /**
46
- * @param {*} value
47
- */
48
- export function isError(value: any): value is Error;
49
- //# sourceMappingURL=checker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../../src/checker.js"],"names":[],"mappings":"AAGE;;KAEE;AACF,+BAFU,GAAC,kBAIV;AACD;;KAEE;AACF,gCAFU,GAAC,WAIV;AACD;;KAEE;AACF,kCAFU,GAAC,WAIV;AACD;;KAEE;AACF,gCAFU,GAAC,WAIV;AACD;;KAEE;AACF,iCAFU,GAAC,oBAIV;AACD;;KAEE;AACF,gCAFU,GAAC,mBAIV;AACD;;KAEE;AACF,mCAFU,GAAC,sBAIV;AACD;;KAEE;AACF,8BAFU,GAAC,WAIV;AACD;;KAEE;AACF,8BAFU,GAAC,iBAIV;AACD;;KAEE;AACF,6BAFU,GAAC,kCAIV;AACD;;KAEE;AACF,6BAFU,GAAC,yBAIV;AACD;;KAEE;AACF,+BAFU,GAAC,kBAIV"}
@@ -1,26 +0,0 @@
1
- export class stream {
2
- constructor(command: any, args: any);
3
- /**
4
- * @typedef {"error"|"data"|"stopped"} EventName
5
- * @typedef {{
6
- * error: (error: Error) => void|Promise<void>,
7
- * data: (chunk: string) => void|Promise<void>,
8
- * stopped: (code: number|null, signal: keyof import("node:child_process").ChildProcessEventMap) => void|Promise<void>,
9
- * }} EventHandler
10
- */
11
- /**
12
- * @template {EventName} E
13
- * @param {E} event
14
- * @param {EventHandler[E]} handler
15
- */
16
- on<E extends "data" | "error" | "stopped">(event: E, handler: {
17
- error: (error: Error) => void | Promise<void>;
18
- data: (chunk: string) => void | Promise<void>;
19
- stopped: (code: number | null, signal: keyof import("node:child_process").ChildProcessEventMap) => void | Promise<void>;
20
- }[E]): this;
21
- stop(): Promise<any>;
22
- #private;
23
- }
24
- import EventEmitter = require("node:events");
25
- export declare function exec(command: any): NonSharedBuffer & string;
26
- //# sourceMappingURL=cli.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.js"],"names":[],"mappings":"AAUU;IAIN,qCAqBC;IAED;;;;;;;OAOA;IACA;;;;OAIA;IACA,GAJsB,CAAC,SAAb,4BAAW,SACb,CAAC;eAPF,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC;cACrC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC;iBAClC,CAAC,IAAI,EAAE,MAAM,GAAC,IAAI,EAAE,MAAM,EAAE,MAAM,OAAO,oBAAoB,EAAE,oBAAoB,KAAK,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC;gBAWlH;IAED,qBA4BC;;CACF;;AAhFD,qEAKC"}
package/types/src/fs.d.ts DELETED
@@ -1,210 +0,0 @@
1
- /**
2
- * @param {string} value
3
- */
4
- export function getEnv(value: string, envFilePath: any): string;
5
- /**
6
- * @param {string} [path=process.cwd()]
7
- */
8
- export function createPath(path?: string): string;
9
- /**
10
- * @param {string} [path]
11
- * @param {boolean} [recursive]
12
- */
13
- export function getFoldersIn(path?: string, recursive?: boolean): string[];
14
- /**
15
- * @param {string} [path]
16
- */
17
- export function getFolder(path?: string): string;
18
- /**
19
- * @param {string} [path]
20
- * @param {boolean} [recursive]
21
- */
22
- export function getFilesIn(path?: string, recursive?: boolean): string[];
23
- /**
24
- * @param {string} path
25
- */
26
- export function getFile(path: string): string;
27
- /**
28
- * @param {string} path
29
- * @param {boolean} [force]
30
- */
31
- export function createFolder(path: string, force?: boolean): boolean;
32
- /**
33
- * @param {string} path
34
- * @param {boolean} [force]
35
- * @param {string|object|null|undefined} [data]
36
- */
37
- export function createFile(path: string, force?: boolean, data?: string | object | null | undefined): boolean;
38
- /**
39
- * @param {string} [path]
40
- * @param {(folder: string) => boolean} [filter]
41
- */
42
- export function deleteFoldersIn(path?: string, filter?: (folder: string) => boolean): number;
43
- /**
44
- * @param {string} path
45
- */
46
- export function deleteFolder(path: string): boolean;
47
- /**
48
- * @param {string} [path=process.cwd()]
49
- * @param {boolean} [recursive=false]
50
- * @param {(file: string) => boolean} [filter]
51
- */
52
- export function deleteFilesIn(path?: string, recursive?: boolean, filter?: (file: string) => boolean): number;
53
- /**
54
- * @param {string} path
55
- */
56
- export function deleteFile(path: string): boolean;
57
- /**
58
- * @param {Object} options
59
- * @param {string} options.dest
60
- * @param {string} [options.path]
61
- * @param {boolean} [options.recursive=true]
62
- * @param {boolean} [options.withFiles=false]
63
- * @param {boolean} [options.force=false]
64
- * @param {(folder: string) => boolean} [options.filter]
65
- */
66
- export function copyFoldersIn(options: {
67
- dest: string;
68
- path?: string;
69
- recursive?: boolean;
70
- withFiles?: boolean;
71
- force?: boolean;
72
- filter?: (folder: string) => boolean;
73
- }): number;
74
- /**
75
- * @param {Object} options
76
- * @param {string} options.dest
77
- * @param {string} [options.path]
78
- * @param {boolean} [options.recursive=false]
79
- * @param {boolean} [options.withFiles=false]
80
- * @param {boolean} [options.force=false]
81
- */
82
- export function copyFolder(options: {
83
- dest: string;
84
- path?: string;
85
- recursive?: boolean;
86
- withFiles?: boolean;
87
- force?: boolean;
88
- }): boolean;
89
- /**
90
- * @param {Object} options
91
- * @param {string} options.dest
92
- * @param {string} [options.path]
93
- * @param {boolean} [options.recursive=true]
94
- * @param {boolean} [options.force=false]
95
- * @param {(file: string) => boolean} [options.filter]
96
- */
97
- export function copyFilesIn(options: {
98
- dest: string;
99
- path?: string;
100
- recursive?: boolean;
101
- force?: boolean;
102
- filter?: (file: string) => boolean;
103
- }): number;
104
- /**
105
- * @param {Object} options
106
- * @param {string} options.path
107
- * @param {string} options.dest
108
- * @param {boolean} [options.force=false]
109
- */
110
- export function copyFile(options: {
111
- path: string;
112
- dest: string;
113
- force?: boolean;
114
- }): boolean;
115
- /**
116
- * @param {Object} options
117
- * @param {string} options.dest
118
- * @param {string} [options.path]
119
- * @param {boolean} [options.recursive=true]
120
- * @param {boolean} [options.withFiles=false]
121
- * @param {boolean} [options.force=false]
122
- * @param {(folder: string) => boolean} [options.filter]
123
- */
124
- export function moveFoldersIn(options: {
125
- dest: string;
126
- path?: string;
127
- recursive?: boolean;
128
- withFiles?: boolean;
129
- force?: boolean;
130
- filter?: (folder: string) => boolean;
131
- }): number;
132
- /**
133
- * @param {Object} options
134
- * @param {string} options.path
135
- * @param {string} options.dest
136
- * @param {boolean} [options.recursive=false]
137
- * @param {boolean} [options.withFiles=false]
138
- * @param {boolean} [options.force=false]
139
- */
140
- export function moveFolder(options: {
141
- path: string;
142
- dest: string;
143
- recursive?: boolean;
144
- withFiles?: boolean;
145
- force?: boolean;
146
- }): boolean;
147
- /**
148
- * @param {Object} options
149
- * @param {string} options.dest
150
- * @param {string} [options.path]
151
- * @param {boolean} [options.recursive=true]
152
- * @param {boolean} [options.force=false]
153
- * @param {(file: string) => boolean} [options.filter]
154
- */
155
- export function moveFilesIn(options: {
156
- dest: string;
157
- path?: string;
158
- recursive?: boolean;
159
- force?: boolean;
160
- filter?: (file: string) => boolean;
161
- }): number;
162
- /**
163
- * @param {Object} options
164
- * @param {string} options.path
165
- * @param {string} options.dest
166
- * @param {boolean} [options.force=false]
167
- */
168
- export function moveFile(options: {
169
- path: string;
170
- dest: string;
171
- force?: boolean;
172
- }): boolean;
173
- /**
174
- * @param {string} path
175
- */
176
- export function readFile(path: string): string;
177
- /**
178
- * @param {Object} [options]
179
- * @param {string} [options.path=process.cwd()]
180
- * @param {boolean} [options.recursive=false]
181
- * @param {(event: string, file: string) => boolean} [options.filter]
182
- */
183
- export function watch(options?: {
184
- path?: string;
185
- recursive?: boolean;
186
- filter?: (event: string, file: string) => boolean;
187
- }): {
188
- /**
189
- * @typedef { "change" | "rename" | "all" } EventNames
190
- * @typedef {{
191
- * change: (file: string) => void|Promise<void>,
192
- * rename: (file: string) => void|Promise<void>,
193
- * all: (event: EventNames, file: string) => void|Promise<void>,
194
- * }} EventHandlers
195
- */
196
- /**
197
- * @template {EventNames} E
198
- * @param {E} event
199
- * @param {EventHandlers[E]} callback
200
- */
201
- on<E extends "change" | "rename" | "all">(event: E, callback: {
202
- change: (file: string) => void | Promise<void>;
203
- rename: (file: string) => void | Promise<void>;
204
- all: (event: "change" | "rename" | "all", file: string) => void | Promise<void>;
205
- }[E]): /*elided*/ any;
206
- stop(): void;
207
- pause(): /*elided*/ any;
208
- resume(): /*elided*/ any;
209
- };
210
- //# sourceMappingURL=fs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/fs.js"],"names":[],"mappings":"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"}
@@ -1,97 +0,0 @@
1
- export = localStorage;
2
- declare class localStorage {
3
- constructor(path?: string);
4
- /**
5
- * @param {{name: string, options: Record<string, {
6
- * type: "TEXT"|"INTEGER"|"REAL"|"BLOB"|"NUMERIC"|"DATE"|"DATETIME"|"TIMESTAMP"|"TIME"|"VARCHAR"|"CHAR"|"CLOB",
7
- * primaryKey?: boolean,
8
- * unique?: boolean,
9
- * notNull: boolean,
10
- * defaultValue?: any,
11
- * values?: Array<string>
12
- * autoincrement?: boolean,
13
- * }>}} table
14
- */
15
- createTable(table: {
16
- name: string;
17
- options: Record<string, {
18
- type: "TEXT" | "INTEGER" | "REAL" | "BLOB" | "NUMERIC" | "DATE" | "DATETIME" | "TIMESTAMP" | "TIME" | "VARCHAR" | "CHAR" | "CLOB";
19
- primaryKey?: boolean;
20
- unique?: boolean;
21
- notNull: boolean;
22
- defaultValue?: any;
23
- values?: Array<string>;
24
- autoincrement?: boolean;
25
- }>;
26
- }): Promise<{
27
- ok: boolean;
28
- error?: undefined;
29
- } | {
30
- error: any;
31
- ok?: undefined;
32
- }>;
33
- /**
34
- * @param {string} tableName
35
- */
36
- deleteTable(tableName: string): Promise<{
37
- ok: boolean;
38
- error?: undefined;
39
- } | {
40
- error: any;
41
- ok?: undefined;
42
- }>;
43
- /**
44
- * @param {string} tableName
45
- */
46
- clearTable(tableName: string): Promise<{
47
- ok: boolean;
48
- error?: undefined;
49
- } | {
50
- error: any;
51
- ok?: undefined;
52
- }>;
53
- /**
54
- * @param {string} tableName
55
- * @param {object} [where]
56
- */
57
- get(tableName: string, where?: object): Promise<any>;
58
- /**
59
- * @param {string} tableName
60
- * @param {object} [where]
61
- * @param {number} [limit]
62
- * @param {number} [offset]
63
- */
64
- getAll(tableName: string, where?: object, limit?: number, offset?: number): Promise<any>;
65
- /**
66
- * @param {string} tableName
67
- * @param {*} data
68
- * @param {object} [where]
69
- */
70
- set(tableName: string, data: any, where?: object): Promise<{
71
- ok: boolean;
72
- error?: undefined;
73
- } | {
74
- error: any;
75
- ok?: undefined;
76
- }>;
77
- /**
78
- * @param {string} tableName
79
- * @param {object} where
80
- */
81
- delete(tableName: string, where: object): Promise<{
82
- ok: boolean;
83
- changes: any;
84
- error?: undefined;
85
- } | {
86
- error: any;
87
- ok?: undefined;
88
- changes?: undefined;
89
- }>;
90
- /**
91
- * @param {string} tableName
92
- * @param {object} where
93
- */
94
- count(tableName: string, where?: object): Promise<any>;
95
- #private;
96
- }
97
- //# sourceMappingURL=localStorage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"localStorage.d.ts","sourceRoot":"","sources":["../../src/localStorage.js"],"names":[],"mappings":";AAciB;IAIf,2BAWC;IAkED;;;;;;;;;;OAUG;IACH,mBAVW;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;YAC/C,IAAI,EAAE,MAAM,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,SAAS,GAAC,MAAM,GAAC,UAAU,GAAC,WAAW,GAAC,MAAM,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,CAAC;YAC5G,UAAU,CAAC,EAAE,OAAO,CAAC;YACrB,MAAM,CAAC,EAAE,OAAO,CAAC;YACjB,OAAO,EAAE,OAAO,CAAC;YACjB,YAAY,CAAC,EAAE,GAAG,CAAC;YACnB,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;YACtB,aAAa,CAAC,EAAE,OAAO,CAAC;SACvB,CAAC,CAAA;KAAC;;;;;;OASL;IACD;;OAEG;IACH,uBAFW,MAAM;;;;;;OAYhB;IACD;;OAEG;IACH,sBAFW,MAAM;;;;;;OAWhB;IACD;;;OAGG;IACH,eAHW,MAAM,UACN,MAAM,gBAchB;IACD;;;;;OAKG;IACH,kBALW,MAAM,UACN,MAAM,UACN,MAAM,WACN,MAAM,gBAchB;IACD;;;;OAIG;IACH,eAJW,MAAM,QACN,GAAC,UACD,MAAM;;;;;;OA0BhB;IACD;;;OAGG;IACH,kBAHW,MAAM,SACN,MAAM;;;;;;;;OAchB;IACD;;;OAGG;IACH,iBAHW,MAAM,UACN,MAAM,gBAchB;;CACF"}
@@ -1,132 +0,0 @@
1
- /**
2
- * @param {*} content
3
- */
4
- export function log(content: any): {
5
- log(content: any): /*elided*/ any;
6
- /**
7
- * @param {any} content - Content to format.
8
- * @returns {string} Formatted string.
9
- */
10
- logify(content: any): string;
11
- /**
12
- * @param {string} label
13
- */
14
- group(label: string): /*elided*/ any;
15
- groupEnd(): /*elided*/ any;
16
- /**
17
- * @param {object} [options]
18
- * @param {object} [options.delimiters]
19
- * @param {string} [options.delimiters.start="<%="]
20
- * @param {string} [options.delimiters.end="%>"]
21
- * @param {boolean} [options.timestamp=true]
22
- */
23
- setLogger(options?: {
24
- delimiters?: {
25
- start?: string;
26
- end?: string;
27
- };
28
- timestamp?: boolean;
29
- }): /*elided*/ any;
30
- };
31
- /**
32
- * @param {any} content - Content to format.
33
- * @returns {string} Formatted string.
34
- */
35
- export function logify(content: any): string;
36
- /**
37
- * @param {string} label
38
- */
39
- export function group(label: string): {
40
- /**
41
- * @param {*} content
42
- */
43
- log(content: any): /*elided*/ any;
44
- /**
45
- * @param {any} content - Content to format.
46
- * @returns {string} Formatted string.
47
- */
48
- logify(content: any): string;
49
- group(label: string): /*elided*/ any;
50
- groupEnd(): /*elided*/ any;
51
- /**
52
- * @param {object} [options]
53
- * @param {object} [options.delimiters]
54
- * @param {string} [options.delimiters.start="<%="]
55
- * @param {string} [options.delimiters.end="%>"]
56
- * @param {boolean} [options.timestamp=true]
57
- */
58
- setLogger(options?: {
59
- delimiters?: {
60
- start?: string;
61
- end?: string;
62
- };
63
- timestamp?: boolean;
64
- }): /*elided*/ any;
65
- };
66
- export function groupEnd(): {
67
- /**
68
- * @param {*} content
69
- */
70
- log(content: any): /*elided*/ any;
71
- /**
72
- * @param {any} content - Content to format.
73
- * @returns {string} Formatted string.
74
- */
75
- logify(content: any): string;
76
- /**
77
- * @param {string} label
78
- */
79
- group(label: string): /*elided*/ any;
80
- groupEnd(): /*elided*/ any;
81
- /**
82
- * @param {object} [options]
83
- * @param {object} [options.delimiters]
84
- * @param {string} [options.delimiters.start="<%="]
85
- * @param {string} [options.delimiters.end="%>"]
86
- * @param {boolean} [options.timestamp=true]
87
- */
88
- setLogger(options?: {
89
- delimiters?: {
90
- start?: string;
91
- end?: string;
92
- };
93
- timestamp?: boolean;
94
- }): /*elided*/ any;
95
- };
96
- /**
97
- * @param {object} [options]
98
- * @param {object} [options.delimiters]
99
- * @param {string} [options.delimiters.start="<%="]
100
- * @param {string} [options.delimiters.end="%>"]
101
- * @param {boolean} [options.timestamp=true]
102
- */
103
- export function setLogger(options?: {
104
- delimiters?: {
105
- start?: string;
106
- end?: string;
107
- };
108
- timestamp?: boolean;
109
- }): {
110
- /**
111
- * @param {*} content
112
- */
113
- log(content: any): /*elided*/ any;
114
- /**
115
- * @param {any} content - Content to format.
116
- * @returns {string} Formatted string.
117
- */
118
- logify(content: any): string;
119
- /**
120
- * @param {string} label
121
- */
122
- group(label: string): /*elided*/ any;
123
- groupEnd(): /*elided*/ any;
124
- setLogger(options?: {
125
- delimiters?: {
126
- start?: string;
127
- end?: string;
128
- };
129
- timestamp?: boolean;
130
- }): /*elided*/ any;
131
- };
132
- //# sourceMappingURL=logger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.js"],"names":[],"mappings":"AA8JE;;EAEC;AACD,6BAFS,GAAC;iBAAD,GAAC;IAkCV;;;KAGC;oBAFQ,GAAG,GACD,MAAM;IAejB;;KAEC;iBADQ,MAAM;;IAYf;;;;;;KAMC;wBAJA;QAAyB,UAAU,GACnC;YAAoC,KAAK,GAAjC,MAAM;YACsB,GAAG,GAA/B,MAAM;SACd;QAA0B,SAAS,GAA3B,OAAO;KAA0B;EApCzC;AACD;;;EAGC;AACD,gCAHS,GAAG,GACD,MAAM,CAchB;AACD;;EAEC;AACD,6BAFS,MAAM;IArDf;;KAEC;iBADQ,GAAC;IAkCV;;;KAGC;oBAFQ,GAAG,GACD,MAAM;iBAgBR,MAAM;;IAYf;;;;;;KAMC;wBAJA;QAAyB,UAAU,GACnC;YAAoC,KAAK,GAAjC,MAAM;YACsB,GAAG,GAA/B,MAAM;SACd;QAA0B,SAAS,GAA3B,OAAO;KAA0B;EAVzC;AACD;IA7DA;;KAEC;iBADQ,GAAC;IAkCV;;;KAGC;oBAFQ,GAAG,GACD,MAAM;IAejB;;KAEC;iBADQ,MAAM;;IAYf;;;;;;KAMC;wBAJA;QAAyB,UAAU,GACnC;YAAoC,KAAK,GAAjC,MAAM;YACsB,GAAG,GAA/B,MAAM;SACd;QAA0B,SAAS,GAA3B,OAAO;KAA0B;EANzC;AACD;;;;;;EAMC;AACD,oCALC;IAAyB,UAAU,GACnC;QAAoC,KAAK,GAAjC,MAAM;QACsB,GAAG,GAA/B,MAAM;KACd;IAA0B,SAAS,GAA3B,OAAO;CAA0B;IAtE1C;;KAEC;iBADQ,GAAC;IAkCV;;;KAGC;oBAFQ,GAAG,GACD,MAAM;IAejB;;KAEC;iBADQ,MAAM;;wBAcd;QAAyB,UAAU,GACnC;YAAoC,KAAK,GAAjC,MAAM;YACsB,GAAG,GAA/B,MAAM;SACd;QAA0B,SAAS,GAA3B,OAAO;KAA0B;EAazC"}
@@ -1,92 +0,0 @@
1
- /**
2
- * @param {number} ms
3
- */
4
- export function wait(ms: number): Promise<any>;
5
- /**
6
- * Polls a predicate at a given interval and emits events when it matches or times out.
7
- *
8
- * The predicate is evaluated every `options.interval` milliseconds (default: 50 ms).
9
- * Be careful with the default interval: 50 ms is very frequent polling and can be
10
- * unnecessarily CPU‑intensive if your predicate or trigger handlers are heavy.
11
- * When `options.max` is `null`, the predicate can match indefinitely (infinite triggers),
12
- * so you should choose an interval that makes sense for your use‑case.
13
- *
14
- * @param {boolean|Promise<boolean>|(() => boolean|Promise<boolean>)} predicate
15
- * Condition to evaluate at each tick, or a function returning it.
16
- * @param {*} payload
17
- * Value passed to listeners when events are emitted (e.g. an object or message).
18
- * @param {object} [options]
19
- * @param {number} [options.interval=50]
20
- * Polling interval in milliseconds. Increase this value if your predicate is
21
- * expensive or you expect many triggers without a `max` limit.
22
- * @param {number|null} [options.timeout=null]
23
- * Maximum time in milliseconds before emitting a "timeout" event and stopping.
24
- * If `null`, no timeout is applied.
25
- * @param {number|null} [options.max=null]
26
- * Maximum number of successful predicate evaluations ("trigger" events) before
27
- * automatically stopping. If `null`, triggers are infinite until `stop()` is called.
28
- *
29
- * @example
30
- * // Basic usage: infinite triggers every 50 ms (default interval) – use with caution.
31
- * const task = when(() => true, { message: "Ok" });
32
- *
33
- * task.on("trigger", (payload) => {
34
- * console.log(payload.message);
35
- * // task.stop(); // stop when you’re done
36
- * });
37
- *
38
- * task.start();
39
- *
40
- * @example
41
- * // Safer usage: limit triggers and/or lower polling frequency.
42
- * when(() => true, { message: "Ok" }, { max: 1, interval: 500 }) // one trigger max, every 500 ms
43
- * .on("trigger", (payload) => {
44
- * console.log(payload.message);
45
- * })
46
- * .start();
47
- */
48
- export function when(predicate: boolean | Promise<boolean> | (() => boolean | Promise<boolean>), payload?: any, options?: {
49
- interval?: number;
50
- timeout?: number | null;
51
- max?: number | null;
52
- }): {
53
- start(): /*elided*/ any;
54
- stop(): /*elided*/ any;
55
- /**
56
- * @typedef { "error" | "trigger" | "timeout" } EventNames
57
- * @typedef {{
58
- * error: (error) => void|Promise<void>,
59
- * trigger: (payload) => void|Promise<void>,
60
- * timeout: (payload) => void|Promise<void>,
61
- * }} EventHandlers
62
- */
63
- /**
64
- * @template {EventNames} E
65
- * @param {E} event
66
- * @param {EventHandlers[E]} handler
67
- */
68
- on<E extends "error" | "trigger" | "timeout">(event: E, handler: {
69
- error: (error: any) => void | Promise<void>;
70
- trigger: (payload: any) => void | Promise<void>;
71
- timeout: (payload: any) => void | Promise<void>;
72
- }[E]): /*elided*/ any;
73
- };
74
- export function dontCrash(): {
75
- /**
76
- * @template { "error" | "exit" | "sig" | "beforeExit" } E
77
- * @param { E } event
78
- * @param { { error: (error: Error | unknown) => void | Promise<void>, exit: (code: number) => void | Promise<void>, sig: (signal: "SIGINT" | "SIGTERM" | "SIGQUIT") => void | Promise<void>, beforeExit: (code: number) => void|Promise<void> }[E] } handler
79
- */
80
- on<E extends "error" | "exit" | "sig" | "beforeExit">(event: E, handler: {
81
- error: (error: Error | unknown) => void | Promise<void>;
82
- exit: (code: number) => void | Promise<void>;
83
- sig: (signal: "SIGINT" | "SIGTERM" | "SIGQUIT") => void | Promise<void>;
84
- beforeExit: (code: number) => void | Promise<void>;
85
- }[E]): /*elided*/ any;
86
- };
87
- /**
88
- * @param {*} value
89
- */
90
- export function JSONString(value: any): string;
91
- export function JSONParse(value: any): any;
92
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.js"],"names":[],"mappings":"AAGE;;KAEE;AACF,yBAFU,MAAM,gBAIf;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,gCAlCW,OAAO,GAAC,OAAO,CAAC,OAAO,CAAC,GAAC,CAAC,MAAM,OAAO,GAAC,OAAO,CAAC,OAAO,CAAC,CAAC,YAEzD,GAAC,YAGT;IAAyB,QAAQ,GAAzB,MAAM;IAGgB,OAAO,GAA7B,MAAM,GAAC,IAAI;IAGW,GAAG,GAAzB,MAAM,GAAC,IAAI;CAInB;;;IAiHC;;;;;;;OAOG;IACH;;;;aAIA;OAH0B,CAAC,SAAd,+BAAY,SACjB,CAAC;eAPC,CAAC,KAAK,KAAA,KAAK,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC;iBAC3B,CAAC,OAAO,KAAA,KAAK,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC;iBAC/B,CAAC,OAAO,KAAA,KAAK,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC;;EAe9C;AACD;IAgBI;;;;aAIA;OAHsD,CAAC,SAA3C,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,YAAc,SAC5C,CAAC,WACD;QAAE,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAAC,GAAG,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAAC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC,CAAC,CAAC;EA4BnP;AACD;;GAEG;AACH,kCAFW,GAAC,UAIX;AACD,2CAEC"}