@ixfx/debug 0.39.0 → 0.41.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
@@ -19,3 +19,72 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
+
23
+ ---
24
+
25
+ Mersenne Twister
26
+ https://github.com/jawj/mtwist
27
+ © Copyright 2014 – 2021 George MacKerron
28
+ MIT License
29
+
30
+ ---
31
+
32
+ Ramer Douglas Peucker implementation
33
+
34
+ Marius Karthaus
35
+ http://www.LowVoice.nl
36
+
37
+ ---
38
+
39
+ The MIT License (MIT)
40
+
41
+ Copyright © 2022 github.com/pushkine/
42
+
43
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44
+
45
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
46
+
47
+ 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.
48
+
49
+ ---
50
+
51
+ collections/BinaryTreeNode
52
+ collections/BinarySearchTree
53
+ collections/TreeNode
54
+ https://github.com/amejiarosario/dsa.js-data-structures-algorithms-javascript
55
+
56
+ MIT License
57
+
58
+ Copyright (c) 2019 Adrian Mejia
59
+
60
+ Permission is hereby granted, free of charge, to any person obtaining a copy
61
+ of this software and associated documentation files (the "Software"), to deal
62
+ in the Software without restriction, including without limitation the rights
63
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
64
+ copies of the Software, and to permit persons to whom the Software is
65
+ furnished to do so, subject to the following conditions:
66
+
67
+ The above copyright notice and this permission notice shall be included in all
68
+ copies or substantial portions of the Software.
69
+
70
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
71
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
72
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
73
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
74
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
75
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
76
+ SOFTWARE.
77
+
78
+ ----
79
+
80
+ Package: colorizr
81
+
82
+ https://github.com/gilbarbara/colorizr
83
+
84
+ Copyright (c) 2015 Gil Barbara
85
+
86
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
87
+
88
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
89
+
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.
@@ -0,0 +1,129 @@
1
+ //#region src/types.d.ts
2
+ type LogSet = {
3
+ readonly log: MessageLogger;
4
+ readonly warn: MessageLogger;
5
+ readonly error: MessageLogger;
6
+ };
7
+ type MessageLogger = (message: LogMessage | string) => void;
8
+ type LogKind = `info` | `debug` | `error` | `warn`;
9
+ type LogMessage = {
10
+ readonly kind?: LogKind;
11
+ readonly msg: any;
12
+ readonly category?: string;
13
+ };
14
+ //# sourceMappingURL=types.d.ts.map
15
+
16
+ //#endregion
17
+ //#region src/logger.d.ts
18
+ /**
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
+ */
50
+ declare const logger: (prefix: string, kind?: `log` | `warn` | `error`, colourKey?: string) => MessageLogger;
51
+ /**
52
+ * Returns a bundled collection of {@link logger}s
53
+ *
54
+ * ```js
55
+ * const con = logSet(`a`);
56
+ * con.log(`Hello`); // console.log(`a Hello`);
57
+ * con.warn(`Uh-oh`); // console.warn(`a Uh-oh`);
58
+ * con.error(`Eek!`); // console.error(`a Eek!`);
59
+ * ```
60
+ *
61
+ * By default each prefix is assigned a colour. To use
62
+ * another logic, provide the `colourKey` parameter.
63
+ *
64
+ * ```js
65
+ * // Both set of loggers will use same colour
66
+ * const con = logSet(`a`, true, `system`);
67
+ * const con2 = logSet(`b`, true, `system`);
68
+ * ```
69
+ * @param prefix Prefix for log messages
70
+ * @param verbose True by default. If false, log() messages are a no-op
71
+ * @param colourKey If specified, log messages will be coloured by this key instead of prefix (default)
72
+ * @returns
73
+ */
74
+ declare const logSet: (prefix: string, verbose?: boolean, colourKey?: string) => {
75
+ log: MessageLogger;
76
+ warn: MessageLogger;
77
+ error: MessageLogger;
78
+ };
79
+ /**
80
+ * Either a flag for default console logging, or a simple log function
81
+ */
82
+ type LogOption = boolean | MessageLogger;
83
+ /**
84
+ * Resolve a LogOption to a function
85
+ * @param l
86
+ * @returns
87
+ */
88
+ declare const resolveLogOption: (l?: LogOption, defaults?: {
89
+ readonly category?: string;
90
+ readonly kind?: string;
91
+ }) => MessageLogger;
92
+ declare const logColours: (key: string, args?: unknown) => string;
93
+ //# sourceMappingURL=logger.d.ts.map
94
+ //#endregion
95
+ //#region src/fps-counter.d.ts
96
+ /**
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
+ */
115
+ declare const fpsCounter: (autoDisplay?: boolean, computeAfterFrames?: number) => () => number;
116
+ //# sourceMappingURL=fps-counter.d.ts.map
117
+ //#endregion
118
+ //#region src/error-message.d.ts
119
+ /**
120
+ * Returns a string representation of an error
121
+ * @param ex
122
+ * @returns
123
+ */
124
+ declare const getErrorMessage: (ex: unknown) => string;
125
+ //# sourceMappingURL=error-message.d.ts.map
126
+
127
+ //#endregion
128
+ export { LogKind, LogMessage, LogOption, LogSet, MessageLogger, fpsCounter, getErrorMessage, logColours, logSet, logger, resolveLogOption };
129
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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;;;;;;AAqBA;AAOA;;;;AAwCC;AAID;;;;ACjJA;;;cDoBa,iFAKR;AEvCL;;;;;;;;;;;;;;;;;;;;;;;cFuFa;OAgBZ;;;;;;;KAKW,SAAA,aAAsB;;;;;;cAOrB,uBACP;;;MAEH;cAyCU;;;;;ADpKb;;;;;AAG+B;AAE/B;AACA;AACA;;;;ACgCA;AAqDA;;;;;cCzEa;AD8Fb;;;;ADjHA;;;;AAGkB,cGEL,eHFK,EAAA,CAAA,EAAA,EAAA,OAAA,EAAA,GAAA,MAAA;AAAa"}
@@ -0,0 +1,2 @@
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
@@ -0,0 +1 @@
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\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,CAEL,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,CCpJW,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"}
@@ -0,0 +1,7 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,13 @@
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,10 +1,5 @@
1
1
  export * from './types.js';
2
2
  export * from './logger.js';
3
3
  export * from './fps-counter.js';
4
- /**
5
- * Returns a string representation of an error
6
- * @param ex
7
- * @returns
8
- */
9
- export declare const getErrorMessage: (ex: unknown) => string;
4
+ export * from './error-message.js';
10
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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;AAEjC;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,IAAI,OAAO,KAAG,MAM7C,CAAC"}
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 CHANGED
@@ -1,16 +1,4 @@
1
1
  export * from './types.js';
2
2
  export * from './logger.js';
3
3
  export * from './fps-counter.js';
4
- /**
5
- * Returns a string representation of an error
6
- * @param ex
7
- * @returns
8
- */
9
- export const getErrorMessage = (ex) => {
10
- if (typeof ex === `string`)
11
- return ex;
12
- if (ex instanceof Error) {
13
- return ex.message;
14
- }
15
- return ex;
16
- };
4
+ export * from './error-message.js';
@@ -1 +1 @@
1
- {"root":["../src/fps-counter.ts","../src/index.ts","../src/logger.ts","../src/types.ts","../src/util.ts","../__tests__/test.ts"],"version":"5.8.3"}
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"}
package/package.json CHANGED
@@ -1,18 +1,22 @@
1
1
  {
2
2
  "name": "@ixfx/debug",
3
- "version": "0.39.0",
3
+ "version": "0.41.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "files": [
8
- "dist/"
8
+ "dist/",
9
+ "bundle/"
9
10
  ],
11
+ "dependencies": {},
10
12
  "exports": {
11
13
  ".": {
12
14
  "types": "./dist/src/index.d.ts",
13
15
  "import": "./dist/src/index.js"
14
16
  }
15
17
  },
16
- "dependencies": {},
18
+ "scripts": {
19
+ "package-bundle": "tsdown"
20
+ },
17
21
  "main": "dist/src/index.js"
18
22
  }