@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.
- package/dist/neutral/index.d.ts +6 -2
- package/package.json +5 -12
- package/xy.config.ts +12 -0
- package/dist/browser/index.cjs +0 -60
- package/dist/browser/index.cjs.map +0 -1
- package/dist/browser/index.d.cts +0 -2
- package/dist/browser/index.d.cts.map +0 -1
- package/dist/browser/index.d.mts +0 -2
- package/dist/browser/index.d.mts.map +0 -1
- package/dist/browser/index.d.ts +0 -2
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.mjs +0 -37
- package/dist/browser/index.mjs.map +0 -1
- package/dist/browser/profiler.d.cts +0 -5
- package/dist/browser/profiler.d.cts.map +0 -1
- package/dist/browser/profiler.d.mts +0 -5
- package/dist/browser/profiler.d.mts.map +0 -1
- package/dist/browser/profiler.d.ts +0 -5
- package/dist/browser/profiler.d.ts.map +0 -1
- package/dist/neutral/index.cjs +0 -60
- package/dist/neutral/index.cjs.map +0 -1
- package/dist/neutral/index.d.cts +0 -2
- package/dist/neutral/index.d.cts.map +0 -1
- package/dist/neutral/index.d.mts +0 -2
- package/dist/neutral/index.d.mts.map +0 -1
- package/dist/neutral/index.d.ts.map +0 -1
- package/dist/neutral/profiler.d.cts +0 -5
- package/dist/neutral/profiler.d.cts.map +0 -1
- package/dist/neutral/profiler.d.mts +0 -5
- package/dist/neutral/profiler.d.mts.map +0 -1
- package/dist/neutral/profiler.d.ts +0 -5
- package/dist/neutral/profiler.d.ts.map +0 -1
- package/dist/node/index.cjs +0 -66
- package/dist/node/index.cjs.map +0 -1
- package/dist/node/index.d.cts +0 -2
- package/dist/node/index.d.cts.map +0 -1
- package/dist/node/index.d.mts +0 -2
- package/dist/node/index.d.mts.map +0 -1
- package/dist/node/index.d.ts +0 -2
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/index.mjs +0 -37
- package/dist/node/index.mjs.map +0 -1
- package/dist/node/profiler.d.cts +0 -5
- package/dist/node/profiler.d.cts.map +0 -1
- package/dist/node/profiler.d.mts +0 -5
- package/dist/node/profiler.d.mts.map +0 -1
- package/dist/node/profiler.d.ts +0 -5
- package/dist/node/profiler.d.ts.map +0 -1
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
"
|
|
17
|
-
|
|
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": "^
|
|
41
|
-
"@xylabs/tsconfig": "^
|
|
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": "
|
|
48
|
+
"version": "4.0.0",
|
|
56
49
|
"type": "module"
|
|
57
50
|
}
|
package/xy.config.ts
ADDED
package/dist/browser/index.cjs
DELETED
|
@@ -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":[]}
|
package/dist/browser/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
package/dist/browser/index.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
package/dist/browser/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
package/dist/browser/index.mjs
DELETED
|
@@ -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"}
|
package/dist/neutral/index.cjs
DELETED
|
@@ -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":[]}
|
package/dist/neutral/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
package/dist/neutral/index.d.mts
DELETED
|
@@ -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"}
|
package/dist/node/index.cjs
DELETED
|
@@ -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
|
package/dist/node/index.cjs.map
DELETED
|
@@ -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":[]}
|
package/dist/node/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
package/dist/node/index.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
package/dist/node/index.d.ts
DELETED
package/dist/node/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
package/dist/node/index.mjs
DELETED
|
@@ -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
|
package/dist/node/index.mjs.map
DELETED
|
@@ -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":[]}
|
package/dist/node/profiler.d.cts
DELETED
|
@@ -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"}
|
package/dist/node/profiler.d.mts
DELETED
|
@@ -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"}
|
package/dist/node/profiler.d.ts
DELETED
|
@@ -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"}
|