@xylabs/profile 3.6.12 → 4.0.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.
Files changed (48) hide show
  1. package/dist/neutral/index.d.ts +6 -2
  2. package/package.json +5 -12
  3. package/xy.config.ts +12 -0
  4. package/dist/browser/index.cjs +0 -60
  5. package/dist/browser/index.cjs.map +0 -1
  6. package/dist/browser/index.d.cts +0 -2
  7. package/dist/browser/index.d.cts.map +0 -1
  8. package/dist/browser/index.d.mts +0 -2
  9. package/dist/browser/index.d.mts.map +0 -1
  10. package/dist/browser/index.d.ts +0 -2
  11. package/dist/browser/index.d.ts.map +0 -1
  12. package/dist/browser/index.mjs +0 -37
  13. package/dist/browser/index.mjs.map +0 -1
  14. package/dist/browser/profiler.d.cts +0 -5
  15. package/dist/browser/profiler.d.cts.map +0 -1
  16. package/dist/browser/profiler.d.mts +0 -5
  17. package/dist/browser/profiler.d.mts.map +0 -1
  18. package/dist/browser/profiler.d.ts +0 -5
  19. package/dist/browser/profiler.d.ts.map +0 -1
  20. package/dist/neutral/index.cjs +0 -60
  21. package/dist/neutral/index.cjs.map +0 -1
  22. package/dist/neutral/index.d.cts +0 -2
  23. package/dist/neutral/index.d.cts.map +0 -1
  24. package/dist/neutral/index.d.mts +0 -2
  25. package/dist/neutral/index.d.mts.map +0 -1
  26. package/dist/neutral/index.d.ts.map +0 -1
  27. package/dist/neutral/profiler.d.cts +0 -5
  28. package/dist/neutral/profiler.d.cts.map +0 -1
  29. package/dist/neutral/profiler.d.mts +0 -5
  30. package/dist/neutral/profiler.d.mts.map +0 -1
  31. package/dist/neutral/profiler.d.ts +0 -5
  32. package/dist/neutral/profiler.d.ts.map +0 -1
  33. package/dist/node/index.cjs +0 -66
  34. package/dist/node/index.cjs.map +0 -1
  35. package/dist/node/index.d.cts +0 -2
  36. package/dist/node/index.d.cts.map +0 -1
  37. package/dist/node/index.d.mts +0 -2
  38. package/dist/node/index.d.mts.map +0 -1
  39. package/dist/node/index.d.ts +0 -2
  40. package/dist/node/index.d.ts.map +0 -1
  41. package/dist/node/index.mjs +0 -37
  42. package/dist/node/index.mjs.map +0 -1
  43. package/dist/node/profiler.d.cts +0 -5
  44. package/dist/node/profiler.d.cts.map +0 -1
  45. package/dist/node/profiler.d.mts +0 -5
  46. package/dist/node/profiler.d.mts.map +0 -1
  47. package/dist/node/profiler.d.ts +0 -5
  48. package/dist/node/profiler.d.ts.map +0 -1
@@ -1,2 +1,6 @@
1
- export * from './profiler.ts';
2
- //# sourceMappingURL=index.d.ts.map
1
+ type Profiler = Record<string, number[]>;
2
+ declare const createProfiler: () => Profiler;
3
+ declare const profile: (profiler: Profiler, name: string) => void;
4
+ declare const profileReport: (profiler: Profiler) => Record<string, number>;
5
+
6
+ export { type Profiler, createProfiler, profile, profileReport };
package/package.json CHANGED
@@ -13,18 +13,11 @@
13
13
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
14
14
  "exports": {
15
15
  ".": {
16
- "require": {
17
- "types": "./dist/neutral/index.d.cts",
18
- "default": "./dist/neutral/index.cjs"
19
- },
20
- "import": {
21
- "types": "./dist/neutral/index.d.ts",
22
- "default": "./dist/neutral/index.mjs"
23
- }
16
+ "types": "./dist/neutral/index.d.ts",
17
+ "default": "./dist/neutral/index.mjs"
24
18
  },
25
19
  "./package.json": "./package.json"
26
20
  },
27
- "main": "./dist/neutral/index.cjs",
28
21
  "types": "./dist/neutral/index.d.ts",
29
22
  "module": "./dist/neutral/index.mjs",
30
23
  "homepage": "https://xylabs.com",
@@ -37,8 +30,8 @@
37
30
  "esm"
38
31
  ],
39
32
  "devDependencies": {
40
- "@xylabs/ts-scripts-yarn3": "^3.15.14",
41
- "@xylabs/tsconfig": "^3.15.14",
33
+ "@xylabs/ts-scripts-yarn3": "^4.0.0-rc.15",
34
+ "@xylabs/tsconfig": "^4.0.0-rc.15",
42
35
  "typescript": "^5.5.4"
43
36
  },
44
37
  "engines": {
@@ -52,6 +45,6 @@
52
45
  "url": "https://github.com/xylabs/sdk-js.git"
53
46
  },
54
47
  "sideEffects": false,
55
- "version": "3.6.12",
48
+ "version": "4.0.0",
56
49
  "type": "module"
57
50
  }
package/xy.config.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
+ const config: XyTsupConfig = {
3
+ compile: {
4
+ browser: {},
5
+ neutral: {
6
+ src: true,
7
+ },
8
+ node: {},
9
+ },
10
+ }
11
+
12
+ export default config
@@ -1,60 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- createProfiler: () => createProfiler,
24
- profile: () => profile,
25
- profileReport: () => profileReport
26
- });
27
- module.exports = __toCommonJS(src_exports);
28
-
29
- // src/profiler.ts
30
- var createProfiler = () => {
31
- return {};
32
- };
33
- var profile = (profiler, name) => {
34
- const timeData = profiler[name] ?? [];
35
- timeData.push(Date.now());
36
- profiler[name] = timeData;
37
- };
38
- var profileReport = (profiler) => {
39
- let lowest = Date.now();
40
- let highest = 0;
41
- const results = Object.entries(profiler).reduce((prev, [name, readings]) => {
42
- const start = readings.at(0);
43
- if (start) {
44
- if (start < lowest) {
45
- lowest = start;
46
- }
47
- const end = readings.at(-1) ?? Date.now();
48
- if (end > highest) {
49
- highest = end;
50
- }
51
- prev[name] = end - start;
52
- }
53
- return prev;
54
- }, {});
55
- if (highest) {
56
- results["-all-"] = highest - lowest;
57
- }
58
- return results;
59
- };
60
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/profiler.ts"],"sourcesContent":["export * from './profiler.ts'\n","export type Profiler = Record<string, number[]>\n\nexport const createProfiler = (): Profiler => {\n return {}\n}\n\nexport const profile = (profiler: Profiler, name: string) => {\n const timeData = profiler[name] ?? []\n timeData.push(Date.now())\n profiler[name] = timeData\n}\n\nexport const profileReport = (profiler: Profiler) => {\n let lowest = Date.now()\n let highest = 0\n // eslint-disable-next-line unicorn/no-array-reduce\n const results = Object.entries(profiler).reduce<Record<string, number>>((prev, [name, readings]) => {\n const start = readings.at(0)\n if (start) {\n if (start < lowest) {\n lowest = start\n }\n const end = readings.at(-1) ?? Date.now()\n if (end > highest) {\n highest = end\n }\n prev[name] = end - start\n }\n return prev\n }, {})\n if (highest) {\n results['-all-'] = highest - lowest\n }\n return results\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,iBAAiB,MAAgB;AAC5C,SAAO,CAAC;AACV;AAEO,IAAM,UAAU,CAAC,UAAoB,SAAiB;AAC3D,QAAM,WAAW,SAAS,IAAI,KAAK,CAAC;AACpC,WAAS,KAAK,KAAK,IAAI,CAAC;AACxB,WAAS,IAAI,IAAI;AACnB;AAEO,IAAM,gBAAgB,CAAC,aAAuB;AACnD,MAAI,SAAS,KAAK,IAAI;AACtB,MAAI,UAAU;AAEd,QAAM,UAAU,OAAO,QAAQ,QAAQ,EAAE,OAA+B,CAAC,MAAM,CAAC,MAAM,QAAQ,MAAM;AAClG,UAAM,QAAQ,SAAS,GAAG,CAAC;AAC3B,QAAI,OAAO;AACT,UAAI,QAAQ,QAAQ;AAClB,iBAAS;AAAA,MACX;AACA,YAAM,MAAM,SAAS,GAAG,EAAE,KAAK,KAAK,IAAI;AACxC,UAAI,MAAM,SAAS;AACjB,kBAAU;AAAA,MACZ;AACA,WAAK,IAAI,IAAI,MAAM;AAAA,IACrB;AACA,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACL,MAAI,SAAS;AACX,YAAQ,OAAO,IAAI,UAAU;AAAA,EAC/B;AACA,SAAO;AACT;","names":[]}
@@ -1,2 +0,0 @@
1
- export * from './profiler.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './profiler.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './profiler.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -1,37 +0,0 @@
1
- // src/profiler.ts
2
- var createProfiler = () => {
3
- return {};
4
- };
5
- var profile = (profiler, name) => {
6
- const timeData = profiler[name] ?? [];
7
- timeData.push(Date.now());
8
- profiler[name] = timeData;
9
- };
10
- var profileReport = (profiler) => {
11
- let lowest = Date.now();
12
- let highest = 0;
13
- const results = Object.entries(profiler).reduce((prev, [name, readings]) => {
14
- const start = readings.at(0);
15
- if (start) {
16
- if (start < lowest) {
17
- lowest = start;
18
- }
19
- const end = readings.at(-1) ?? Date.now();
20
- if (end > highest) {
21
- highest = end;
22
- }
23
- prev[name] = end - start;
24
- }
25
- return prev;
26
- }, {});
27
- if (highest) {
28
- results["-all-"] = highest - lowest;
29
- }
30
- return results;
31
- };
32
- export {
33
- createProfiler,
34
- profile,
35
- profileReport
36
- };
37
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/profiler.ts"],"sourcesContent":["export type Profiler = Record<string, number[]>\n\nexport const createProfiler = (): Profiler => {\n return {}\n}\n\nexport const profile = (profiler: Profiler, name: string) => {\n const timeData = profiler[name] ?? []\n timeData.push(Date.now())\n profiler[name] = timeData\n}\n\nexport const profileReport = (profiler: Profiler) => {\n let lowest = Date.now()\n let highest = 0\n // eslint-disable-next-line unicorn/no-array-reduce\n const results = Object.entries(profiler).reduce<Record<string, number>>((prev, [name, readings]) => {\n const start = readings.at(0)\n if (start) {\n if (start < lowest) {\n lowest = start\n }\n const end = readings.at(-1) ?? Date.now()\n if (end > highest) {\n highest = end\n }\n prev[name] = end - start\n }\n return prev\n }, {})\n if (highest) {\n results['-all-'] = highest - lowest\n }\n return results\n}\n"],"mappings":";AAEO,IAAM,iBAAiB,MAAgB;AAC5C,SAAO,CAAC;AACV;AAEO,IAAM,UAAU,CAAC,UAAoB,SAAiB;AAC3D,QAAM,WAAW,SAAS,IAAI,KAAK,CAAC;AACpC,WAAS,KAAK,KAAK,IAAI,CAAC;AACxB,WAAS,IAAI,IAAI;AACnB;AAEO,IAAM,gBAAgB,CAAC,aAAuB;AACnD,MAAI,SAAS,KAAK,IAAI;AACtB,MAAI,UAAU;AAEd,QAAM,UAAU,OAAO,QAAQ,QAAQ,EAAE,OAA+B,CAAC,MAAM,CAAC,MAAM,QAAQ,MAAM;AAClG,UAAM,QAAQ,SAAS,GAAG,CAAC;AAC3B,QAAI,OAAO;AACT,UAAI,QAAQ,QAAQ;AAClB,iBAAS;AAAA,MACX;AACA,YAAM,MAAM,SAAS,GAAG,EAAE,KAAK,KAAK,IAAI;AACxC,UAAI,MAAM,SAAS;AACjB,kBAAU;AAAA,MACZ;AACA,WAAK,IAAI,IAAI,MAAM;AAAA,IACrB;AACA,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACL,MAAI,SAAS;AACX,YAAQ,OAAO,IAAI,UAAU;AAAA,EAC/B;AACA,SAAO;AACT;","names":[]}
@@ -1,5 +0,0 @@
1
- export type Profiler = Record<string, number[]>;
2
- export declare const createProfiler: () => Profiler;
3
- export declare const profile: (profiler: Profiler, name: string) => void;
4
- export declare const profileReport: (profiler: Profiler) => Record<string, number>;
5
- //# sourceMappingURL=profiler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAE/C,eAAO,MAAM,cAAc,QAAO,QAEjC,CAAA;AAED,eAAO,MAAM,OAAO,aAAc,QAAQ,QAAQ,MAAM,SAIvD,CAAA;AAED,eAAO,MAAM,aAAa,aAAc,QAAQ,2BAsB/C,CAAA"}
@@ -1,5 +0,0 @@
1
- export type Profiler = Record<string, number[]>;
2
- export declare const createProfiler: () => Profiler;
3
- export declare const profile: (profiler: Profiler, name: string) => void;
4
- export declare const profileReport: (profiler: Profiler) => Record<string, number>;
5
- //# sourceMappingURL=profiler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAE/C,eAAO,MAAM,cAAc,QAAO,QAEjC,CAAA;AAED,eAAO,MAAM,OAAO,aAAc,QAAQ,QAAQ,MAAM,SAIvD,CAAA;AAED,eAAO,MAAM,aAAa,aAAc,QAAQ,2BAsB/C,CAAA"}
@@ -1,5 +0,0 @@
1
- export type Profiler = Record<string, number[]>;
2
- export declare const createProfiler: () => Profiler;
3
- export declare const profile: (profiler: Profiler, name: string) => void;
4
- export declare const profileReport: (profiler: Profiler) => Record<string, number>;
5
- //# sourceMappingURL=profiler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAE/C,eAAO,MAAM,cAAc,QAAO,QAEjC,CAAA;AAED,eAAO,MAAM,OAAO,aAAc,QAAQ,QAAQ,MAAM,SAIvD,CAAA;AAED,eAAO,MAAM,aAAa,aAAc,QAAQ,2BAsB/C,CAAA"}
@@ -1,60 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- createProfiler: () => createProfiler,
24
- profile: () => profile,
25
- profileReport: () => profileReport
26
- });
27
- module.exports = __toCommonJS(src_exports);
28
-
29
- // src/profiler.ts
30
- var createProfiler = () => {
31
- return {};
32
- };
33
- var profile = (profiler, name) => {
34
- const timeData = profiler[name] ?? [];
35
- timeData.push(Date.now());
36
- profiler[name] = timeData;
37
- };
38
- var profileReport = (profiler) => {
39
- let lowest = Date.now();
40
- let highest = 0;
41
- const results = Object.entries(profiler).reduce((prev, [name, readings]) => {
42
- const start = readings.at(0);
43
- if (start) {
44
- if (start < lowest) {
45
- lowest = start;
46
- }
47
- const end = readings.at(-1) ?? Date.now();
48
- if (end > highest) {
49
- highest = end;
50
- }
51
- prev[name] = end - start;
52
- }
53
- return prev;
54
- }, {});
55
- if (highest) {
56
- results["-all-"] = highest - lowest;
57
- }
58
- return results;
59
- };
60
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/profiler.ts"],"sourcesContent":["export * from './profiler.ts'\n","export type Profiler = Record<string, number[]>\n\nexport const createProfiler = (): Profiler => {\n return {}\n}\n\nexport const profile = (profiler: Profiler, name: string) => {\n const timeData = profiler[name] ?? []\n timeData.push(Date.now())\n profiler[name] = timeData\n}\n\nexport const profileReport = (profiler: Profiler) => {\n let lowest = Date.now()\n let highest = 0\n // eslint-disable-next-line unicorn/no-array-reduce\n const results = Object.entries(profiler).reduce<Record<string, number>>((prev, [name, readings]) => {\n const start = readings.at(0)\n if (start) {\n if (start < lowest) {\n lowest = start\n }\n const end = readings.at(-1) ?? Date.now()\n if (end > highest) {\n highest = end\n }\n prev[name] = end - start\n }\n return prev\n }, {})\n if (highest) {\n results['-all-'] = highest - lowest\n }\n return results\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,iBAAiB,MAAgB;AAC5C,SAAO,CAAC;AACV;AAEO,IAAM,UAAU,CAAC,UAAoB,SAAiB;AAC3D,QAAM,WAAW,SAAS,IAAI,KAAK,CAAC;AACpC,WAAS,KAAK,KAAK,IAAI,CAAC;AACxB,WAAS,IAAI,IAAI;AACnB;AAEO,IAAM,gBAAgB,CAAC,aAAuB;AACnD,MAAI,SAAS,KAAK,IAAI;AACtB,MAAI,UAAU;AAEd,QAAM,UAAU,OAAO,QAAQ,QAAQ,EAAE,OAA+B,CAAC,MAAM,CAAC,MAAM,QAAQ,MAAM;AAClG,UAAM,QAAQ,SAAS,GAAG,CAAC;AAC3B,QAAI,OAAO;AACT,UAAI,QAAQ,QAAQ;AAClB,iBAAS;AAAA,MACX;AACA,YAAM,MAAM,SAAS,GAAG,EAAE,KAAK,KAAK,IAAI;AACxC,UAAI,MAAM,SAAS;AACjB,kBAAU;AAAA,MACZ;AACA,WAAK,IAAI,IAAI,MAAM;AAAA,IACrB;AACA,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACL,MAAI,SAAS;AACX,YAAQ,OAAO,IAAI,UAAU;AAAA,EAC/B;AACA,SAAO;AACT;","names":[]}
@@ -1,2 +0,0 @@
1
- export * from './profiler.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './profiler.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -1,5 +0,0 @@
1
- export type Profiler = Record<string, number[]>;
2
- export declare const createProfiler: () => Profiler;
3
- export declare const profile: (profiler: Profiler, name: string) => void;
4
- export declare const profileReport: (profiler: Profiler) => Record<string, number>;
5
- //# sourceMappingURL=profiler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAE/C,eAAO,MAAM,cAAc,QAAO,QAEjC,CAAA;AAED,eAAO,MAAM,OAAO,aAAc,QAAQ,QAAQ,MAAM,SAIvD,CAAA;AAED,eAAO,MAAM,aAAa,aAAc,QAAQ,2BAsB/C,CAAA"}
@@ -1,5 +0,0 @@
1
- export type Profiler = Record<string, number[]>;
2
- export declare const createProfiler: () => Profiler;
3
- export declare const profile: (profiler: Profiler, name: string) => void;
4
- export declare const profileReport: (profiler: Profiler) => Record<string, number>;
5
- //# sourceMappingURL=profiler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAE/C,eAAO,MAAM,cAAc,QAAO,QAEjC,CAAA;AAED,eAAO,MAAM,OAAO,aAAc,QAAQ,QAAQ,MAAM,SAIvD,CAAA;AAED,eAAO,MAAM,aAAa,aAAc,QAAQ,2BAsB/C,CAAA"}
@@ -1,5 +0,0 @@
1
- export type Profiler = Record<string, number[]>;
2
- export declare const createProfiler: () => Profiler;
3
- export declare const profile: (profiler: Profiler, name: string) => void;
4
- export declare const profileReport: (profiler: Profiler) => Record<string, number>;
5
- //# sourceMappingURL=profiler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAE/C,eAAO,MAAM,cAAc,QAAO,QAEjC,CAAA;AAED,eAAO,MAAM,OAAO,aAAc,QAAQ,QAAQ,MAAM,SAIvD,CAAA;AAED,eAAO,MAAM,aAAa,aAAc,QAAQ,2BAsB/C,CAAA"}
@@ -1,66 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- createProfiler: () => createProfiler,
24
- profile: () => profile,
25
- profileReport: () => profileReport
26
- });
27
- module.exports = __toCommonJS(src_exports);
28
-
29
- // src/profiler.ts
30
- var createProfiler = () => {
31
- return {};
32
- };
33
- var profile = (profiler, name) => {
34
- const timeData = profiler[name] ?? [];
35
- timeData.push(Date.now());
36
- profiler[name] = timeData;
37
- };
38
- var profileReport = (profiler) => {
39
- let lowest = Date.now();
40
- let highest = 0;
41
- const results = Object.entries(profiler).reduce((prev, [name, readings]) => {
42
- const start = readings.at(0);
43
- if (start) {
44
- if (start < lowest) {
45
- lowest = start;
46
- }
47
- const end = readings.at(-1) ?? Date.now();
48
- if (end > highest) {
49
- highest = end;
50
- }
51
- prev[name] = end - start;
52
- }
53
- return prev;
54
- }, {});
55
- if (highest) {
56
- results["-all-"] = highest - lowest;
57
- }
58
- return results;
59
- };
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- createProfiler,
63
- profile,
64
- profileReport
65
- });
66
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/profiler.ts"],"sourcesContent":["export * from './profiler.ts'\n","export type Profiler = Record<string, number[]>\n\nexport const createProfiler = (): Profiler => {\n return {}\n}\n\nexport const profile = (profiler: Profiler, name: string) => {\n const timeData = profiler[name] ?? []\n timeData.push(Date.now())\n profiler[name] = timeData\n}\n\nexport const profileReport = (profiler: Profiler) => {\n let lowest = Date.now()\n let highest = 0\n // eslint-disable-next-line unicorn/no-array-reduce\n const results = Object.entries(profiler).reduce<Record<string, number>>((prev, [name, readings]) => {\n const start = readings.at(0)\n if (start) {\n if (start < lowest) {\n lowest = start\n }\n const end = readings.at(-1) ?? Date.now()\n if (end > highest) {\n highest = end\n }\n prev[name] = end - start\n }\n return prev\n }, {})\n if (highest) {\n results['-all-'] = highest - lowest\n }\n return results\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,iBAAiB,MAAgB;AAC5C,SAAO,CAAC;AACV;AAEO,IAAM,UAAU,CAAC,UAAoB,SAAiB;AAC3D,QAAM,WAAW,SAAS,IAAI,KAAK,CAAC;AACpC,WAAS,KAAK,KAAK,IAAI,CAAC;AACxB,WAAS,IAAI,IAAI;AACnB;AAEO,IAAM,gBAAgB,CAAC,aAAuB;AACnD,MAAI,SAAS,KAAK,IAAI;AACtB,MAAI,UAAU;AAEd,QAAM,UAAU,OAAO,QAAQ,QAAQ,EAAE,OAA+B,CAAC,MAAM,CAAC,MAAM,QAAQ,MAAM;AAClG,UAAM,QAAQ,SAAS,GAAG,CAAC;AAC3B,QAAI,OAAO;AACT,UAAI,QAAQ,QAAQ;AAClB,iBAAS;AAAA,MACX;AACA,YAAM,MAAM,SAAS,GAAG,EAAE,KAAK,KAAK,IAAI;AACxC,UAAI,MAAM,SAAS;AACjB,kBAAU;AAAA,MACZ;AACA,WAAK,IAAI,IAAI,MAAM;AAAA,IACrB;AACA,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACL,MAAI,SAAS;AACX,YAAQ,OAAO,IAAI,UAAU;AAAA,EAC/B;AACA,SAAO;AACT;","names":[]}
@@ -1,2 +0,0 @@
1
- export * from './profiler.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './profiler.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './profiler.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -1,37 +0,0 @@
1
- // src/profiler.ts
2
- var createProfiler = () => {
3
- return {};
4
- };
5
- var profile = (profiler, name) => {
6
- const timeData = profiler[name] ?? [];
7
- timeData.push(Date.now());
8
- profiler[name] = timeData;
9
- };
10
- var profileReport = (profiler) => {
11
- let lowest = Date.now();
12
- let highest = 0;
13
- const results = Object.entries(profiler).reduce((prev, [name, readings]) => {
14
- const start = readings.at(0);
15
- if (start) {
16
- if (start < lowest) {
17
- lowest = start;
18
- }
19
- const end = readings.at(-1) ?? Date.now();
20
- if (end > highest) {
21
- highest = end;
22
- }
23
- prev[name] = end - start;
24
- }
25
- return prev;
26
- }, {});
27
- if (highest) {
28
- results["-all-"] = highest - lowest;
29
- }
30
- return results;
31
- };
32
- export {
33
- createProfiler,
34
- profile,
35
- profileReport
36
- };
37
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/profiler.ts"],"sourcesContent":["export type Profiler = Record<string, number[]>\n\nexport const createProfiler = (): Profiler => {\n return {}\n}\n\nexport const profile = (profiler: Profiler, name: string) => {\n const timeData = profiler[name] ?? []\n timeData.push(Date.now())\n profiler[name] = timeData\n}\n\nexport const profileReport = (profiler: Profiler) => {\n let lowest = Date.now()\n let highest = 0\n // eslint-disable-next-line unicorn/no-array-reduce\n const results = Object.entries(profiler).reduce<Record<string, number>>((prev, [name, readings]) => {\n const start = readings.at(0)\n if (start) {\n if (start < lowest) {\n lowest = start\n }\n const end = readings.at(-1) ?? Date.now()\n if (end > highest) {\n highest = end\n }\n prev[name] = end - start\n }\n return prev\n }, {})\n if (highest) {\n results['-all-'] = highest - lowest\n }\n return results\n}\n"],"mappings":";AAEO,IAAM,iBAAiB,MAAgB;AAC5C,SAAO,CAAC;AACV;AAEO,IAAM,UAAU,CAAC,UAAoB,SAAiB;AAC3D,QAAM,WAAW,SAAS,IAAI,KAAK,CAAC;AACpC,WAAS,KAAK,KAAK,IAAI,CAAC;AACxB,WAAS,IAAI,IAAI;AACnB;AAEO,IAAM,gBAAgB,CAAC,aAAuB;AACnD,MAAI,SAAS,KAAK,IAAI;AACtB,MAAI,UAAU;AAEd,QAAM,UAAU,OAAO,QAAQ,QAAQ,EAAE,OAA+B,CAAC,MAAM,CAAC,MAAM,QAAQ,MAAM;AAClG,UAAM,QAAQ,SAAS,GAAG,CAAC;AAC3B,QAAI,OAAO;AACT,UAAI,QAAQ,QAAQ;AAClB,iBAAS;AAAA,MACX;AACA,YAAM,MAAM,SAAS,GAAG,EAAE,KAAK,KAAK,IAAI;AACxC,UAAI,MAAM,SAAS;AACjB,kBAAU;AAAA,MACZ;AACA,WAAK,IAAI,IAAI,MAAM;AAAA,IACrB;AACA,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACL,MAAI,SAAS;AACX,YAAQ,OAAO,IAAI,UAAU;AAAA,EAC/B;AACA,SAAO;AACT;","names":[]}
@@ -1,5 +0,0 @@
1
- export type Profiler = Record<string, number[]>;
2
- export declare const createProfiler: () => Profiler;
3
- export declare const profile: (profiler: Profiler, name: string) => void;
4
- export declare const profileReport: (profiler: Profiler) => Record<string, number>;
5
- //# sourceMappingURL=profiler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAE/C,eAAO,MAAM,cAAc,QAAO,QAEjC,CAAA;AAED,eAAO,MAAM,OAAO,aAAc,QAAQ,QAAQ,MAAM,SAIvD,CAAA;AAED,eAAO,MAAM,aAAa,aAAc,QAAQ,2BAsB/C,CAAA"}
@@ -1,5 +0,0 @@
1
- export type Profiler = Record<string, number[]>;
2
- export declare const createProfiler: () => Profiler;
3
- export declare const profile: (profiler: Profiler, name: string) => void;
4
- export declare const profileReport: (profiler: Profiler) => Record<string, number>;
5
- //# sourceMappingURL=profiler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAE/C,eAAO,MAAM,cAAc,QAAO,QAEjC,CAAA;AAED,eAAO,MAAM,OAAO,aAAc,QAAQ,QAAQ,MAAM,SAIvD,CAAA;AAED,eAAO,MAAM,aAAa,aAAc,QAAQ,2BAsB/C,CAAA"}
@@ -1,5 +0,0 @@
1
- export type Profiler = Record<string, number[]>;
2
- export declare const createProfiler: () => Profiler;
3
- export declare const profile: (profiler: Profiler, name: string) => void;
4
- export declare const profileReport: (profiler: Profiler) => Record<string, number>;
5
- //# sourceMappingURL=profiler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAE/C,eAAO,MAAM,cAAc,QAAO,QAEjC,CAAA;AAED,eAAO,MAAM,OAAO,aAAc,QAAQ,QAAQ,MAAM,SAIvD,CAAA;AAED,eAAO,MAAM,aAAa,aAAc,QAAQ,2BAsB/C,CAAA"}