@ixfx/debug 0.45.0 → 0.56.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021-2024 Clint Heyer
3
+ Copyright (c) 2021-2025 Clint Heyer
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -88,3 +88,30 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
88
88
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
89
89
 
90
90
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
91
+
92
+ ----
93
+
94
+ Package: Kalman.js
95
+ https://github.com/wouterbulten/kalmanjs
96
+
97
+ MIT License
98
+
99
+ Copyright (c) 2019 Wouter Bulten
100
+
101
+ Permission is hereby granted, free of charge, to any person obtaining a copy
102
+ of this software and associated documentation files (the "Software"), to deal
103
+ in the Software without restriction, including without limitation the rights
104
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
105
+ copies of the Software, and to permit persons to whom the Software is
106
+ furnished to do so, subject to the following conditions:
107
+
108
+ The above copyright notice and this permission notice shall be included in all
109
+ copies or substantial portions of the Software.
110
+
111
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
112
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
113
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
114
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
115
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
116
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
117
+ SOFTWARE.
@@ -11,42 +11,40 @@ type LogMessage = {
11
11
  readonly msg: any;
12
12
  readonly category?: string;
13
13
  };
14
- //# sourceMappingURL=types.d.ts.map
15
-
16
14
  //#endregion
17
15
  //#region src/logger.d.ts
18
16
  /**
19
- * Returns a console logging function which prefixes messages. This is
20
- * useful for tracing messages from different components. Each prefix
21
- * is assigned a colour, further helping to distinguish messages.
22
- *
23
- * Use {@link logSet} to get a bundled set.
24
- *
25
- * ```
26
- * // Initialise once
27
- * const log = logger(`a`);
28
- * const error = logger(`a`, `error`);
29
- * const warn = logger(`a`, `warn);
30
- *
31
- * // And then use
32
- * log(`Hello`); // console.log(`a Hello`);
33
- * error(`Uh-oh`); // console.error(`a Uh-oh`);
34
- * warn(`Eek!`); // console.warn(`a Eeek!`);
35
- * ```
36
- *
37
- * Provide the `colourKey` parameter to make log messages
38
- * be coloured the same, even though the prefix is different.
39
- * ```js
40
- * // Both loggers will use the same colour because they
41
- * // share the colour key `system`
42
- * const log = logger(`a`,`log`,`system`);
43
- * const log2 = logger(`b`, `log`, `system`);
44
- * ```
45
- * @param prefix
46
- * @param kind
47
- * @param colourKey Optional key to colour log lines by instead of prefix
48
- * @returns
49
- */
17
+ * Returns a console logging function which prefixes messages. This is
18
+ * useful for tracing messages from different components. Each prefix
19
+ * is assigned a colour, further helping to distinguish messages.
20
+ *
21
+ * Use {@link logSet} to get a bundled set.
22
+ *
23
+ * ```
24
+ * // Initialise once
25
+ * const log = logger(`a`);
26
+ * const error = logger(`a`, `error`);
27
+ * const warn = logger(`a`, `warn);
28
+ *
29
+ * // And then use
30
+ * log(`Hello`); // console.log(`a Hello`);
31
+ * error(`Uh-oh`); // console.error(`a Uh-oh`);
32
+ * warn(`Eek!`); // console.warn(`a Eeek!`);
33
+ * ```
34
+ *
35
+ * Provide the `colourKey` parameter to make log messages
36
+ * be coloured the same, even though the prefix is different.
37
+ * ```js
38
+ * // Both loggers will use the same colour because they
39
+ * // share the colour key `system`
40
+ * const log = logger(`a`,`log`,`system`);
41
+ * const log2 = logger(`b`, `log`, `system`);
42
+ * ```
43
+ * @param prefix
44
+ * @param kind
45
+ * @param colourKey Optional key to colour log lines by instead of prefix
46
+ * @returns
47
+ */
50
48
  declare const logger: (prefix: string, kind?: `log` | `warn` | `error`, colourKey?: string) => MessageLogger;
51
49
  /**
52
50
  * Returns a bundled collection of {@link logger}s
@@ -77,53 +75,48 @@ declare const logSet: (prefix: string, verbose?: boolean, colourKey?: string) =>
77
75
  error: MessageLogger;
78
76
  };
79
77
  /**
80
- * Either a flag for default console logging, or a simple log function
81
- */
78
+ * Either a flag for default console logging, or a simple log function
79
+ */
82
80
  type LogOption = boolean | MessageLogger;
83
81
  /**
84
- * Resolve a LogOption to a function
85
- * @param l
86
- * @returns
87
- */
82
+ * Resolve a LogOption to a function
83
+ * @param l
84
+ * @returns
85
+ */
88
86
  declare const resolveLogOption: (l?: LogOption, defaults?: {
89
87
  readonly category?: string;
90
88
  readonly kind?: string;
91
89
  }) => MessageLogger;
92
90
  declare const logColours: (key: string, args?: unknown) => string;
93
- //# sourceMappingURL=logger.d.ts.map
94
91
  //#endregion
95
92
  //#region src/fps-counter.d.ts
96
93
  /**
97
- * Calculates frames per second.
98
- *
99
- * Returns a function which needs to be called at the end of each frame.
100
- *
101
- * ```js
102
- * const fps = fpsCounter();
103
- *
104
- * function loop() {
105
- * fps(); // Calculate fps
106
- * window.requestAnimationFrame(loop);
107
- * }
108
- *
109
- * loop();
110
- * ```
111
- * @param autoDisplay If true (default), prints out the FPS to the console
112
- * @param computeAfterFrames Calculates after this many frames. Higher numbers smoothes the value somewhat
113
- * @returns
114
- */
94
+ * Calculates frames per second.
95
+ *
96
+ * Returns a function which needs to be called at the end of each frame.
97
+ *
98
+ * ```js
99
+ * const fps = fpsCounter();
100
+ *
101
+ * function loop() {
102
+ * fps(); // Calculate fps
103
+ * window.requestAnimationFrame(loop);
104
+ * }
105
+ *
106
+ * loop();
107
+ * ```
108
+ * @param autoDisplay If true (default), prints out the FPS to the console
109
+ * @param computeAfterFrames Calculates after this many frames. Higher numbers smoothes the value somewhat
110
+ * @returns
111
+ */
115
112
  declare const fpsCounter: (autoDisplay?: boolean, computeAfterFrames?: number) => () => number;
116
- //# sourceMappingURL=fps-counter.d.ts.map
117
113
  //#endregion
118
114
  //#region src/error-message.d.ts
119
115
  /**
120
- * Returns a string representation of an error
121
- * @param ex
122
- * @returns
123
- */
116
+ * Returns a string representation of an error
117
+ * @param ex
118
+ * @returns
119
+ */
124
120
  declare const getErrorMessage: (ex: unknown) => string;
125
- //# sourceMappingURL=error-message.d.ts.map
126
-
127
121
  //#endregion
128
- export { LogKind, LogMessage, LogOption, LogSet, MessageLogger, fpsCounter, getErrorMessage, logColours, logSet, logger, resolveLogOption };
129
- //# sourceMappingURL=index.d.ts.map
122
+ export { LogKind, LogMessage, LogOption, LogSet, MessageLogger, fpsCounter, getErrorMessage, logColours, logSet, logger, resolveLogOption };
package/dist/index.js ADDED
@@ -0,0 +1,185 @@
1
+ //#region src/util.ts
2
+ const getOrGenerateSync = (map, fn) => (key, args) => {
3
+ let value = map.get(key);
4
+ if (value !== void 0) return value;
5
+ value = fn(key, args);
6
+ map.set(key, value);
7
+ return value;
8
+ };
9
+
10
+ //#endregion
11
+ //#region src/logger.ts
12
+ /**
13
+ * Returns a console logging function which prefixes messages. This is
14
+ * useful for tracing messages from different components. Each prefix
15
+ * is assigned a colour, further helping to distinguish messages.
16
+ *
17
+ * Use {@link logSet} to get a bundled set.
18
+ *
19
+ * ```
20
+ * // Initialise once
21
+ * const log = logger(`a`);
22
+ * const error = logger(`a`, `error`);
23
+ * const warn = logger(`a`, `warn);
24
+ *
25
+ * // And then use
26
+ * log(`Hello`); // console.log(`a Hello`);
27
+ * error(`Uh-oh`); // console.error(`a Uh-oh`);
28
+ * warn(`Eek!`); // console.warn(`a Eeek!`);
29
+ * ```
30
+ *
31
+ * Provide the `colourKey` parameter to make log messages
32
+ * be coloured the same, even though the prefix is different.
33
+ * ```js
34
+ * // Both loggers will use the same colour because they
35
+ * // share the colour key `system`
36
+ * const log = logger(`a`,`log`,`system`);
37
+ * const log2 = logger(`b`, `log`, `system`);
38
+ * ```
39
+ * @param prefix
40
+ * @param kind
41
+ * @param colourKey Optional key to colour log lines by instead of prefix
42
+ * @returns
43
+ */
44
+ const logger = (prefix, kind = `log`, colourKey) => (m) => {
45
+ if (m === void 0) m = `(undefined)`;
46
+ else if (typeof m === `object`) m = JSON.stringify(m);
47
+ const colour = colourKey ?? prefix;
48
+ switch (kind) {
49
+ case `log`:
50
+ console.log(`%c${prefix} ${m}`, `color: ${logColours(colour)}`);
51
+ break;
52
+ case `warn`:
53
+ console.warn(prefix, m);
54
+ break;
55
+ case `error`:
56
+ console.error(prefix, m);
57
+ break;
58
+ }
59
+ };
60
+ /**
61
+ * Returns a bundled collection of {@link logger}s
62
+ *
63
+ * ```js
64
+ * const con = logSet(`a`);
65
+ * con.log(`Hello`); // console.log(`a Hello`);
66
+ * con.warn(`Uh-oh`); // console.warn(`a Uh-oh`);
67
+ * con.error(`Eek!`); // console.error(`a Eek!`);
68
+ * ```
69
+ *
70
+ * By default each prefix is assigned a colour. To use
71
+ * another logic, provide the `colourKey` parameter.
72
+ *
73
+ * ```js
74
+ * // Both set of loggers will use same colour
75
+ * const con = logSet(`a`, true, `system`);
76
+ * const con2 = logSet(`b`, true, `system`);
77
+ * ```
78
+ * @param prefix Prefix for log messages
79
+ * @param verbose True by default. If false, log() messages are a no-op
80
+ * @param colourKey If specified, log messages will be coloured by this key instead of prefix (default)
81
+ * @returns
82
+ */
83
+ const logSet = (prefix, verbose = true, colourKey) => {
84
+ if (verbose) return {
85
+ log: logger(prefix, `log`, colourKey),
86
+ warn: logger(prefix, `warn`, colourKey),
87
+ error: logger(prefix, `error`, colourKey)
88
+ };
89
+ return {
90
+ log: (_) => {
91
+ /** no-op */
92
+ },
93
+ warn: logger(prefix, `warn`, colourKey),
94
+ error: logger(prefix, `error`, colourKey)
95
+ };
96
+ };
97
+ /**
98
+ * Resolve a LogOption to a function
99
+ * @param l
100
+ * @returns
101
+ */
102
+ const resolveLogOption = (l, defaults = {}) => {
103
+ if (l === void 0 || typeof l === `boolean` && !l) return (_) => {
104
+ /** no-op */
105
+ };
106
+ const defaultCat = defaults.category ?? ``;
107
+ const defaultKind = defaults.kind ?? void 0;
108
+ if (typeof l === `boolean`) return (messageOrString) => {
109
+ const m = typeof messageOrString === `string` ? { msg: messageOrString } : messageOrString;
110
+ const kind = m.kind ?? defaultKind;
111
+ const category = m.category ?? defaultCat;
112
+ let message = m.msg;
113
+ if (category) message = `[${category}] ${message}`;
114
+ switch (kind) {
115
+ case `error`:
116
+ console.error(message);
117
+ break;
118
+ case `warn`:
119
+ console.warn(message);
120
+ break;
121
+ case `info`:
122
+ console.info(message);
123
+ break;
124
+ default: console.log(message);
125
+ }
126
+ };
127
+ return l;
128
+ };
129
+ let logColourCount = 0;
130
+ const logColours = getOrGenerateSync(/* @__PURE__ */ new Map(), () => {
131
+ return `hsl(${++logColourCount * 137.508},50%,75%)`;
132
+ });
133
+
134
+ //#endregion
135
+ //#region src/fps-counter.ts
136
+ /**
137
+ * Calculates frames per second.
138
+ *
139
+ * Returns a function which needs to be called at the end of each frame.
140
+ *
141
+ * ```js
142
+ * const fps = fpsCounter();
143
+ *
144
+ * function loop() {
145
+ * fps(); // Calculate fps
146
+ * window.requestAnimationFrame(loop);
147
+ * }
148
+ *
149
+ * loop();
150
+ * ```
151
+ * @param autoDisplay If true (default), prints out the FPS to the console
152
+ * @param computeAfterFrames Calculates after this many frames. Higher numbers smoothes the value somewhat
153
+ * @returns
154
+ */
155
+ const fpsCounter = (autoDisplay = true, computeAfterFrames = 500) => {
156
+ let count = 0;
157
+ let lastFps = 0;
158
+ let countStart = performance.now();
159
+ return () => {
160
+ if (count++ >= computeAfterFrames) {
161
+ const elapsed = performance.now() - countStart;
162
+ countStart = performance.now();
163
+ count = 0;
164
+ lastFps = Math.floor(computeAfterFrames / elapsed * 1e3);
165
+ if (autoDisplay) console.log(`fps: ${lastFps}`);
166
+ }
167
+ return lastFps;
168
+ };
169
+ };
170
+
171
+ //#endregion
172
+ //#region src/error-message.ts
173
+ /**
174
+ * Returns a string representation of an error
175
+ * @param ex
176
+ * @returns
177
+ */
178
+ const getErrorMessage = (ex) => {
179
+ if (typeof ex === `string`) return ex;
180
+ if (ex instanceof Error) return ex.message;
181
+ return ex;
182
+ };
183
+
184
+ //#endregion
185
+ export { fpsCounter, getErrorMessage, logColours, logSet, logger, resolveLogOption };
package/package.json CHANGED
@@ -1,23 +1,46 @@
1
1
  {
2
2
  "name": "@ixfx/debug",
3
- "version": "0.45.0",
3
+ "version": "0.56.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "files": [
8
- "dist/",
9
- "bundle/"
8
+ "dist"
10
9
  ],
11
- "dependencies": {},
10
+ "types": "./dist/index.d.ts",
12
11
  "exports": {
13
- ".": {
14
- "types": "./dist/src/index.d.ts",
15
- "import": "./dist/src/index.js"
12
+ ".": "./dist/index.js",
13
+ "./package.json": "./package.json"
14
+ },
15
+ "typesVersions": {
16
+ "*": {
17
+ "*": [
18
+ "./dist/*",
19
+ "./*"
20
+ ]
16
21
  }
17
22
  },
18
- "scripts": {
19
- "package-bundle": "tsdown",
20
- "clean": "rm -rf dist && rm -rf bundle"
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "description": "ixfx guards",
27
+ "keywords": [
28
+ "ixfx",
29
+ "interactivity",
30
+ "guards"
31
+ ],
32
+ "homepage": "https://ixfxfun.dev",
33
+ "bugs": {
34
+ "url": "https://github.com/@ixfxfun/ixfx/issues"
35
+ },
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/@ixfxfun/ixfx.git",
39
+ "directory": "packages/guards"
40
+ },
41
+ "author": "Clint Heyer <clint@thestaticvoid.net>",
42
+ "engines": {
43
+ "node": ">=20.19.0"
21
44
  },
22
- "main": "dist/src/index.js"
45
+ "scripts": {}
23
46
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/logger.ts","../src/fps-counter.ts","../src/error-message.ts"],"sourcesContent":[],"mappings":";KAAY,MAAA;EAAA,SAAM,GAAA,EACF,aADE;EAAA,SAAA,IAAA,EAED,aAFC;EAAA,SACF,KAAA,EAEE,aAFF;CAAa;AAEX,KAEN,aAAA,GAFM,CAAA,OAAA,EAEoB,UAFpB,GAAA,MAAA,EAAA,GAAA,IAAA;AAAa,KAGnB,OAAA,GAHmB,MAAA,GAAA,OAAA,GAAA,OAAA,GAAA,MAAA;AAEnB,KAEA,UAAA,GAFa;EACb,SAAA,IAAO,CAAA,EAED,OAFC;EACP,SAAA,GAAA,EAAU,GAAA;;;;;;;AAPtB;;;;;AAG+B;AAE/B;AACA;AACA;;;;ACgCA;AAqDA;;;;;;AAoBA;AAOA;;;;AAwCC;AAID;;;;AChJA;;;cDoBa,iFAKR;AEvCL;;;;;;;;;;;;;;;;;;;;;;;cFuFa;OAeZ;;;;;;;KAKW,SAAA,aAAsB;;;;;;cAOrB,uBACP;;;MAEH;cAyCU;;;;;ADnKb;;;;;AAG+B;AAE/B;AACA;AACA;;;;ACgCA;AAqDA;;;;;cCzEa;AD6Fb;;;;ADhHA;;;;AAGkB,cGEL,eHFK,EAAA,CAAA,EAAA,EAAA,OAAA,EAAA,GAAA,MAAA;AAAa"}
package/bundle/index.js DELETED
@@ -1,2 +0,0 @@
1
- const e=(e,t)=>(n,r)=>{let i=e.get(n);return i===void 0?(i=t(n,r),e.set(n,i),i):i},t=(e,t=`log`,n)=>r=>{r===void 0?r=`(undefined)`:typeof r==`object`&&(r=JSON.stringify(r));let i=n??e;switch(t){case`log`:console.log(`%c${e} ${r}`,`color: ${a(i)}`);break;case`warn`:console.warn(e,r);break;case`error`:console.error(e,r);break}},n=(e,n=!0,r)=>n?{log:t(e,`log`,r),warn:t(e,`warn`,r),error:t(e,`error`,r)}:{log:e=>{},warn:t(e,`warn`,r),error:t(e,`error`,r)},r=(e,t={})=>{if(e===void 0||typeof e==`boolean`&&!e)return e=>{};let n=t.category??``,r=t.kind??void 0;return typeof e==`boolean`?e=>{let t=typeof e==`string`?{msg:e}:e,i=t.kind??r,a=t.category??n,o=t.msg;switch(a&&(o=`[${a}] ${o}`),i){case`error`:console.error(o);break;case`warn`:console.warn(o);break;case`info`:console.info(o);break;default:console.log(o)}}:e};let i=0;const a=e(new Map,()=>{let e=++i*137.508;return`hsl(${e},50%,75%)`}),o=(e=!0,t=500)=>{let n=0,r=0,i=performance.now();return()=>{if(n++>=t){let a=performance.now()-i;i=performance.now(),n=0,r=Math.floor(t/a*1e3),e&&console.log(`fps: ${r}`)}return r}},s=e=>typeof e==`string`?e:e instanceof Error?e.message:e;export{o as fpsCounter,s as getErrorMessage,a as logColours,n as logSet,t as logger,r as resolveLogOption};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["map: Map<K, V>","fn: (key: K, args?: Z) => V","key: K","args?: Z","prefix: string","kind: `log` | `warn` | `error`","colourKey?: string","m: any","_: any","l?: LogOption","defaults: { readonly category?: string; readonly kind?: string }","_: LogMessage | string","messageOrString: LogMessage | string","ex: unknown"],"sources":["../src/util.ts","../src/logger.ts","../src/fps-counter.ts","../src/error-message.ts"],"sourcesContent":["export const getOrGenerateSync =\n <K, V, Z>(map: Map<K, V>, fn: (key: K, args?: Z) => V) =>\n (key: K, args?: Z): V => {\n let value = map.get(key);\n if (value !== undefined) return value;\n value = fn(key, args);\n map.set(key, value);\n return value;\n };","import type { MessageLogger, LogMessage } from \"./types.js\";\nimport { getOrGenerateSync } from \"./util.js\";\n\n/**\n * Returns a console logging function which prefixes messages. This is\n * useful for tracing messages from different components. Each prefix\n * is assigned a colour, further helping to distinguish messages.\n *\n * Use {@link logSet} to get a bundled set.\n *\n * ```\n * // Initialise once\n * const log = logger(`a`);\n * const error = logger(`a`, `error`);\n * const warn = logger(`a`, `warn);\n *\n * // And then use\n * log(`Hello`); // console.log(`a Hello`);\n * error(`Uh-oh`); // console.error(`a Uh-oh`);\n * warn(`Eek!`); // console.warn(`a Eeek!`);\n * ```\n *\n * Provide the `colourKey` parameter to make log messages\n * be coloured the same, even though the prefix is different.\n * ```js\n * // Both loggers will use the same colour because they\n * // share the colour key `system`\n * const log = logger(`a`,`log`,`system`);\n * const log2 = logger(`b`, `log`, `system`);\n * ```\n * @param prefix\n * @param kind\n * @param colourKey Optional key to colour log lines by instead of prefix\n * @returns\n */\n\n\n\n\nexport const logger =\n (\n prefix: string,\n kind: `log` | `warn` | `error` = `log`,\n colourKey?: string\n ): MessageLogger =>\n (m: any) => {\n if (m === undefined) {\n m = `(undefined)`;\n } else if (typeof m === `object`) {\n m = JSON.stringify(m);\n }\n\n const colour = colourKey ?? prefix;\n switch (kind) {\n case `log`: {\n console.log(`%c${ prefix } ${ m }`, `color: ${ logColours(colour) }`);\n break;\n }\n case `warn`: {\n console.warn(prefix, m);\n break;\n }\n case `error`: {\n console.error(prefix, m);\n break;\n }\n }\n };\n\n/**\n* Returns a bundled collection of {@link logger}s\n*\n* ```js\n* const con = logSet(`a`);\n* con.log(`Hello`); // console.log(`a Hello`);\n* con.warn(`Uh-oh`); // console.warn(`a Uh-oh`);\n* con.error(`Eek!`); // console.error(`a Eek!`);\n* ```\n*\n* By default each prefix is assigned a colour. To use\n* another logic, provide the `colourKey` parameter.\n*\n* ```js\n* // Both set of loggers will use same colour\n* const con = logSet(`a`, true, `system`);\n* const con2 = logSet(`b`, true, `system`);\n* ```\n* @param prefix Prefix for log messages\n* @param verbose True by default. If false, log() messages are a no-op\n* @param colourKey If specified, log messages will be coloured by this key instead of prefix (default)\n* @returns\n*/\nexport const logSet = (prefix: string, verbose = true, colourKey?: string) => {\n if (verbose) {\n return {\n log: logger(prefix, `log`, colourKey),\n warn: logger(prefix, `warn`, colourKey),\n error: logger(prefix, `error`, colourKey),\n };\n }\n return {\n log: (_: any) => {\n /** no-op */\n },\n warn: logger(prefix, `warn`, colourKey),\n error: logger(prefix, `error`, colourKey),\n };\n};\n\n/**\n * Either a flag for default console logging, or a simple log function\n */\nexport type LogOption = boolean | MessageLogger;\n\n/**\n * Resolve a LogOption to a function\n * @param l\n * @returns\n */\nexport const resolveLogOption = (\n l?: LogOption,\n defaults: { readonly category?: string; readonly kind?: string } = {}\n): MessageLogger => {\n if (l === undefined || (typeof l === `boolean` && !l)) {\n return (_: LogMessage | string) => {\n /** no-op */\n };\n }\n const defaultCat = defaults.category ?? ``;\n const defaultKind = defaults.kind ?? undefined;\n\n if (typeof l === `boolean`) {\n return (messageOrString: LogMessage | string) => {\n const m =\n typeof messageOrString === `string` ? { msg: messageOrString } : messageOrString;\n const kind = m.kind ?? defaultKind;\n const category = m.category ?? defaultCat;\n let message = m.msg;\n if (category) message = `[${ category }] ${ message }`;\n switch (kind) {\n case `error`: {\n console.error(message);\n break;\n }\n case `warn`: {\n console.warn(message);\n break;\n }\n case `info`: {\n console.info(message);\n break;\n }\n default: {\n console.log(message);\n }\n }\n };\n }\n return l;\n};\n\n\nlet logColourCount = 0;\nexport const logColours = getOrGenerateSync(new Map<string, string>(), () => {\n const hue = ++logColourCount * 137.508; // use golden angle approximation\n return `hsl(${ hue },50%,75%)`;\n});","/**\n * Calculates frames per second.\n * \n * Returns a function which needs to be called at the end of each frame.\n * \n * ```js\n * const fps = fpsCounter();\n * \n * function loop() {\n * fps(); // Calculate fps\n * window.requestAnimationFrame(loop);\n * }\n * \n * loop();\n * ```\n * @param autoDisplay If true (default), prints out the FPS to the console\n * @param computeAfterFrames Calculates after this many frames. Higher numbers smoothes the value somewhat\n * @returns \n */\nexport const fpsCounter = (autoDisplay = true, computeAfterFrames = 500) => {\n let count = 0;\n let lastFps = 0;\n let countStart = performance.now();\n\n return () => {\n if (count++ >= computeAfterFrames) {\n const elapsed = performance.now() - countStart;\n countStart = performance.now();\n count = 0;\n lastFps = Math.floor((computeAfterFrames / elapsed) * 1000);\n if (autoDisplay) console.log(`fps: ${ lastFps }`);\n }\n return lastFps\n }\n}","/**\n * Returns a string representation of an error\n * @param ex \n * @returns \n */\nexport const getErrorMessage = (ex: unknown): string => {\n if (typeof ex === `string`) return ex;\n if (ex instanceof Error) {\n return ex.message;\n }\n return ex as string;\n};"],"mappings":"AAAA,MAAa,EACX,CAAUA,EAAgBC,IACxB,CAACC,EAAQC,IAAgB,CACvB,IAAI,EAAQ,EAAI,IAAI,EAAI,CAIxB,OAHI,IAAU,IAAA,IACd,EAAQ,EAAG,EAAK,EAAK,CACrB,EAAI,IAAI,EAAK,EAAM,CACZ,GAHyB,CAIjC,EC+BQ,EACX,CACEC,EACAC,EAAiC,MACjCC,IAEA,AAACC,GAAW,CACN,IAAM,IAAA,GACR,EAAI,cACK,OAAO,GAAM,WACtB,EAAI,KAAK,UAAU,EAAE,EAGvB,IAAM,EAAS,GAAa,EAC5B,OAAQ,EAAR,CACE,IAAK,MACH,QAAQ,IAAI,CAAC,EAAE,EAAG,EAAQ,CAAC,EAAG,GAAI,CAAE,CAAC,OAAO,EAAG,EAAW,EAAO,EAAG,CAAC,CACrE,MAEF,IAAK,OACH,QAAQ,KAAK,EAAQ,EAAE,CACvB,MAEF,IAAK,QACH,QAAQ,MAAM,EAAQ,EAAE,CACxB,KAEH,CACF,EAyBQ,EAAS,CAACH,EAAgB,EAAU,GAAME,IACjD,EACK,CACL,IAAK,EAAO,EAAQ,MAAO,EAAU,CACrC,KAAM,EAAO,EAAQ,OAAQ,EAAU,CACvC,MAAO,EAAO,EAAQ,QAAS,EAAU,AAC1C,EAEI,CACL,IAAK,AAACE,GAAW,CAEhB,EACD,KAAM,EAAO,EAAQ,OAAQ,EAAU,CACvC,MAAO,EAAO,EAAQ,QAAS,EAAU,AAC1C,EAaU,EAAmB,CAC9BC,EACAC,EAAmE,CAAE,IACnD,CAClB,GAAI,IAAM,IAAA,IAAc,OAAO,GAAM,WAAa,CAAC,EACjD,MAAO,CAACC,GAA2B,CAElC,EAEH,IAAM,EAAa,EAAS,UAAY,GAClC,EAAc,EAAS,MAAQ,IAAA,GA6BrC,OA3BI,OAAO,GAAM,UACR,AAACC,GAAyC,CAC/C,IAAM,EACJ,OAAO,GAAoB,SAAW,CAAE,IAAK,CAAiB,EAAG,EAC7D,EAAO,EAAE,MAAQ,EACjB,EAAW,EAAE,UAAY,EAC3B,EAAU,EAAE,IAEhB,OADI,IAAU,EAAU,CAAC,CAAC,EAAG,EAAU,EAAE,EAAG,GAAU,EAC9C,EAAR,CACE,IAAK,QACH,QAAQ,MAAM,EAAQ,CACtB,MAEF,IAAK,OACH,QAAQ,KAAK,EAAQ,CACrB,MAEF,IAAK,OACH,QAAQ,KAAK,EAAQ,CACrB,MAEF,QACE,QAAQ,IAAI,EAAQ,AAEvB,CACF,EAEI,CACR,EAGD,IAAI,EAAiB,EACrB,MAAa,EAAa,EAAkB,IAAI,IAAuB,IAAM,CAC3E,IAAM,EAAM,EAAE,EAAiB,QAC/B,MAAO,CAAC,IAAI,EAAG,EAAK,SAAS,CAAC,AAC/B,EAAC,CCnJW,EAAa,CAAC,EAAc,GAAM,EAAqB,MAAQ,CAC1E,IAAI,EAAQ,EACR,EAAU,EACV,EAAa,YAAY,KAAK,CAElC,MAAO,IAAM,CACX,GAAI,KAAW,EAAoB,CACjC,IAAM,EAAU,YAAY,KAAK,CAAG,EACpC,EAAa,YAAY,KAAK,CAC9B,EAAQ,EACR,EAAU,KAAK,MAAO,EAAqB,EAAW,IAAK,CACvD,GAAa,QAAQ,IAAI,CAAC,KAAK,EAAG,GAAU,CAAC,AAClD,CACD,OAAO,CACR,CACF,EC7BY,EAAkB,AAACC,GAC1B,OAAO,GAAO,SAAiB,EAC/B,aAAc,MACT,EAAG,QAEL"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../__tests__/test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- /**
2
- * Returns a string representation of an error
3
- * @param ex
4
- * @returns
5
- */
6
- export declare const getErrorMessage: (ex: unknown) => string;
7
- //# sourceMappingURL=error-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-message.d.ts","sourceRoot":"","sources":["../../src/error-message.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,IAAI,OAAO,KAAG,MAM7C,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Returns a string representation of an error
3
- * @param ex
4
- * @returns
5
- */
6
- export const getErrorMessage = (ex) => {
7
- if (typeof ex === `string`)
8
- return ex;
9
- if (ex instanceof Error) {
10
- return ex.message;
11
- }
12
- return ex;
13
- };
@@ -1,21 +0,0 @@
1
- /**
2
- * Calculates frames per second.
3
- *
4
- * Returns a function which needs to be called at the end of each frame.
5
- *
6
- * ```js
7
- * const fps = fpsCounter();
8
- *
9
- * function loop() {
10
- * fps(); // Calculate fps
11
- * window.requestAnimationFrame(loop);
12
- * }
13
- *
14
- * loop();
15
- * ```
16
- * @param autoDisplay If true (default), prints out the FPS to the console
17
- * @param computeAfterFrames Calculates after this many frames. Higher numbers smoothes the value somewhat
18
- * @returns
19
- */
20
- export declare const fpsCounter: (autoDisplay?: boolean, computeAfterFrames?: number) => () => number;
21
- //# sourceMappingURL=fps-counter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fps-counter.d.ts","sourceRoot":"","sources":["../../src/fps-counter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,UAAU,GAAI,qBAAkB,EAAE,2BAAwB,iBAetE,CAAA"}
@@ -1,35 +0,0 @@
1
- /**
2
- * Calculates frames per second.
3
- *
4
- * Returns a function which needs to be called at the end of each frame.
5
- *
6
- * ```js
7
- * const fps = fpsCounter();
8
- *
9
- * function loop() {
10
- * fps(); // Calculate fps
11
- * window.requestAnimationFrame(loop);
12
- * }
13
- *
14
- * loop();
15
- * ```
16
- * @param autoDisplay If true (default), prints out the FPS to the console
17
- * @param computeAfterFrames Calculates after this many frames. Higher numbers smoothes the value somewhat
18
- * @returns
19
- */
20
- export const fpsCounter = (autoDisplay = true, computeAfterFrames = 500) => {
21
- let count = 0;
22
- let lastFps = 0;
23
- let countStart = performance.now();
24
- return () => {
25
- if (count++ >= computeAfterFrames) {
26
- const elapsed = performance.now() - countStart;
27
- countStart = performance.now();
28
- count = 0;
29
- lastFps = Math.floor((computeAfterFrames / elapsed) * 1000);
30
- if (autoDisplay)
31
- console.log(`fps: ${lastFps}`);
32
- }
33
- return lastFps;
34
- };
35
- };
@@ -1,5 +0,0 @@
1
- export * from './types.js';
2
- export * from './logger.js';
3
- export * from './fps-counter.js';
4
- export * from './error-message.js';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
package/dist/src/index.js DELETED
@@ -1,4 +0,0 @@
1
- export * from './types.js';
2
- export * from './logger.js';
3
- export * from './fps-counter.js';
4
- export * from './error-message.js';
@@ -1,77 +0,0 @@
1
- import type { MessageLogger } from "./types.js";
2
- /**
3
- * Returns a console logging function which prefixes messages. This is
4
- * useful for tracing messages from different components. Each prefix
5
- * is assigned a colour, further helping to distinguish messages.
6
- *
7
- * Use {@link logSet} to get a bundled set.
8
- *
9
- * ```
10
- * // Initialise once
11
- * const log = logger(`a`);
12
- * const error = logger(`a`, `error`);
13
- * const warn = logger(`a`, `warn);
14
- *
15
- * // And then use
16
- * log(`Hello`); // console.log(`a Hello`);
17
- * error(`Uh-oh`); // console.error(`a Uh-oh`);
18
- * warn(`Eek!`); // console.warn(`a Eeek!`);
19
- * ```
20
- *
21
- * Provide the `colourKey` parameter to make log messages
22
- * be coloured the same, even though the prefix is different.
23
- * ```js
24
- * // Both loggers will use the same colour because they
25
- * // share the colour key `system`
26
- * const log = logger(`a`,`log`,`system`);
27
- * const log2 = logger(`b`, `log`, `system`);
28
- * ```
29
- * @param prefix
30
- * @param kind
31
- * @param colourKey Optional key to colour log lines by instead of prefix
32
- * @returns
33
- */
34
- export declare const logger: (prefix: string, kind?: `log` | `warn` | `error`, colourKey?: string) => MessageLogger;
35
- /**
36
- * Returns a bundled collection of {@link logger}s
37
- *
38
- * ```js
39
- * const con = logSet(`a`);
40
- * con.log(`Hello`); // console.log(`a Hello`);
41
- * con.warn(`Uh-oh`); // console.warn(`a Uh-oh`);
42
- * con.error(`Eek!`); // console.error(`a Eek!`);
43
- * ```
44
- *
45
- * By default each prefix is assigned a colour. To use
46
- * another logic, provide the `colourKey` parameter.
47
- *
48
- * ```js
49
- * // Both set of loggers will use same colour
50
- * const con = logSet(`a`, true, `system`);
51
- * const con2 = logSet(`b`, true, `system`);
52
- * ```
53
- * @param prefix Prefix for log messages
54
- * @param verbose True by default. If false, log() messages are a no-op
55
- * @param colourKey If specified, log messages will be coloured by this key instead of prefix (default)
56
- * @returns
57
- */
58
- export declare const logSet: (prefix: string, verbose?: boolean, colourKey?: string) => {
59
- log: MessageLogger;
60
- warn: MessageLogger;
61
- error: MessageLogger;
62
- };
63
- /**
64
- * Either a flag for default console logging, or a simple log function
65
- */
66
- export type LogOption = boolean | MessageLogger;
67
- /**
68
- * Resolve a LogOption to a function
69
- * @param l
70
- * @returns
71
- */
72
- export declare const resolveLogOption: (l?: LogOption, defaults?: {
73
- readonly category?: string;
74
- readonly kind?: string;
75
- }) => MessageLogger;
76
- export declare const logColours: (key: string, args?: unknown) => string;
77
- //# sourceMappingURL=logger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,YAAY,CAAC;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,eAAO,MAAM,MAAM,GAEf,QAAQ,MAAM,EACd,OAAM,KAAK,GAAG,MAAM,GAAG,OAAe,EACtC,YAAY,MAAM,KACjB,aAuBA,CAAC;AAEN;;;;;;;;;;;;;;;;;;;;;;EAsBE;AACF,eAAO,MAAM,MAAM,GAAI,QAAQ,MAAM,EAAE,iBAAc,EAAE,YAAY,MAAM;;;;CAexE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,IAAI,SAAS,EACb,WAAU;IAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,KACpE,aAqCF,CAAC;AAIF,eAAO,MAAM,UAAU,yCAGrB,CAAC"}
@@ -1,142 +0,0 @@
1
- import { getOrGenerateSync } from "./util.js";
2
- /**
3
- * Returns a console logging function which prefixes messages. This is
4
- * useful for tracing messages from different components. Each prefix
5
- * is assigned a colour, further helping to distinguish messages.
6
- *
7
- * Use {@link logSet} to get a bundled set.
8
- *
9
- * ```
10
- * // Initialise once
11
- * const log = logger(`a`);
12
- * const error = logger(`a`, `error`);
13
- * const warn = logger(`a`, `warn);
14
- *
15
- * // And then use
16
- * log(`Hello`); // console.log(`a Hello`);
17
- * error(`Uh-oh`); // console.error(`a Uh-oh`);
18
- * warn(`Eek!`); // console.warn(`a Eeek!`);
19
- * ```
20
- *
21
- * Provide the `colourKey` parameter to make log messages
22
- * be coloured the same, even though the prefix is different.
23
- * ```js
24
- * // Both loggers will use the same colour because they
25
- * // share the colour key `system`
26
- * const log = logger(`a`,`log`,`system`);
27
- * const log2 = logger(`b`, `log`, `system`);
28
- * ```
29
- * @param prefix
30
- * @param kind
31
- * @param colourKey Optional key to colour log lines by instead of prefix
32
- * @returns
33
- */
34
- export const logger = (prefix, kind = `log`, colourKey) => (m) => {
35
- if (m === undefined) {
36
- m = `(undefined)`;
37
- }
38
- else if (typeof m === `object`) {
39
- m = JSON.stringify(m);
40
- }
41
- const colour = colourKey ?? prefix;
42
- switch (kind) {
43
- case `log`: {
44
- console.log(`%c${prefix} ${m}`, `color: ${logColours(colour)}`);
45
- break;
46
- }
47
- case `warn`: {
48
- console.warn(prefix, m);
49
- break;
50
- }
51
- case `error`: {
52
- console.error(prefix, m);
53
- break;
54
- }
55
- }
56
- };
57
- /**
58
- * Returns a bundled collection of {@link logger}s
59
- *
60
- * ```js
61
- * const con = logSet(`a`);
62
- * con.log(`Hello`); // console.log(`a Hello`);
63
- * con.warn(`Uh-oh`); // console.warn(`a Uh-oh`);
64
- * con.error(`Eek!`); // console.error(`a Eek!`);
65
- * ```
66
- *
67
- * By default each prefix is assigned a colour. To use
68
- * another logic, provide the `colourKey` parameter.
69
- *
70
- * ```js
71
- * // Both set of loggers will use same colour
72
- * const con = logSet(`a`, true, `system`);
73
- * const con2 = logSet(`b`, true, `system`);
74
- * ```
75
- * @param prefix Prefix for log messages
76
- * @param verbose True by default. If false, log() messages are a no-op
77
- * @param colourKey If specified, log messages will be coloured by this key instead of prefix (default)
78
- * @returns
79
- */
80
- export const logSet = (prefix, verbose = true, colourKey) => {
81
- if (verbose) {
82
- return {
83
- log: logger(prefix, `log`, colourKey),
84
- warn: logger(prefix, `warn`, colourKey),
85
- error: logger(prefix, `error`, colourKey),
86
- };
87
- }
88
- return {
89
- log: (_) => {
90
- /** no-op */
91
- },
92
- warn: logger(prefix, `warn`, colourKey),
93
- error: logger(prefix, `error`, colourKey),
94
- };
95
- };
96
- /**
97
- * Resolve a LogOption to a function
98
- * @param l
99
- * @returns
100
- */
101
- export const resolveLogOption = (l, defaults = {}) => {
102
- if (l === undefined || (typeof l === `boolean` && !l)) {
103
- return (_) => {
104
- /** no-op */
105
- };
106
- }
107
- const defaultCat = defaults.category ?? ``;
108
- const defaultKind = defaults.kind ?? undefined;
109
- if (typeof l === `boolean`) {
110
- return (messageOrString) => {
111
- const m = typeof messageOrString === `string` ? { msg: messageOrString } : messageOrString;
112
- const kind = m.kind ?? defaultKind;
113
- const category = m.category ?? defaultCat;
114
- let message = m.msg;
115
- if (category)
116
- message = `[${category}] ${message}`;
117
- switch (kind) {
118
- case `error`: {
119
- console.error(message);
120
- break;
121
- }
122
- case `warn`: {
123
- console.warn(message);
124
- break;
125
- }
126
- case `info`: {
127
- console.info(message);
128
- break;
129
- }
130
- default: {
131
- console.log(message);
132
- }
133
- }
134
- };
135
- }
136
- return l;
137
- };
138
- let logColourCount = 0;
139
- export const logColours = getOrGenerateSync(new Map(), () => {
140
- const hue = ++logColourCount * 137.508; // use golden angle approximation
141
- return `hsl(${hue},50%,75%)`;
142
- });
@@ -1,13 +0,0 @@
1
- export type LogSet = {
2
- readonly log: MessageLogger;
3
- readonly warn: MessageLogger;
4
- readonly error: MessageLogger;
5
- };
6
- export type MessageLogger = (message: LogMessage | string) => void;
7
- export type LogKind = `info` | `debug` | `error` | `warn`;
8
- export type LogMessage = {
9
- readonly kind?: LogKind;
10
- readonly msg: any;
11
- readonly category?: string;
12
- };
13
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;CAC/B,CAAA;AACD,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,KAAK,IAAI,CAAC;AACnE,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAC1D,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAA"}
package/dist/src/types.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- export declare const getOrGenerateSync: <K, V, Z>(map: Map<K, V>, fn: (key: K, args?: Z) => V) => (key: K, args?: Z) => V;
2
- //# sourceMappingURL=util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,GAC3B,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,MAClD,KAAK,CAAC,EAAE,OAAO,CAAC,KAAG,CAMnB,CAAC"}
package/dist/src/util.js DELETED
@@ -1,8 +0,0 @@
1
- export const getOrGenerateSync = (map, fn) => (key, args) => {
2
- let value = map.get(key);
3
- if (value !== undefined)
4
- return value;
5
- value = fn(key, args);
6
- map.set(key, value);
7
- return value;
8
- };
@@ -1 +0,0 @@
1
- {"root":["../src/error-message.ts","../src/fps-counter.ts","../src/index.ts","../src/logger.ts","../src/types.ts","../src/util.ts","../__tests__/test.ts"],"version":"5.8.3"}