@markuplint/shared 4.4.9 → 4.4.11-dev.350

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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.4.10](https://github.com/markuplint/markuplint/compare/@markuplint/shared@4.4.9...@markuplint/shared@4.4.10) (2024-11-17)
7
+
8
+ **Note:** Version bump only for package @markuplint/shared
9
+
6
10
  ## [4.4.9](https://github.com/markuplint/markuplint/compare/@markuplint/shared@4.4.8...@markuplint/shared@4.4.9) (2024-10-28)
7
11
 
8
12
  **Note:** Version bump only for package @markuplint/shared
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/shared",
3
- "version": "4.4.9",
3
+ "version": "4.4.11-dev.350+16e148e6e",
4
4
  "description": "Shared functions for Markuplint",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -20,11 +20,12 @@
20
20
  "entryPoint": "./src/index.ts"
21
21
  },
22
22
  "scripts": {
23
- "build": "tsc",
23
+ "build": "tsc --project tsconfig.build.json",
24
+ "dev": "tsc --watch --project tsconfig.build.json",
24
25
  "clean": "tsc --build --clean"
25
26
  },
26
27
  "dependencies": {
27
- "html-entities": "2.5.2"
28
+ "html-entities": "2.6.0"
28
29
  },
29
- "gitHead": "60a8a7149bd4441e89972ca21b90033afb05b89e"
30
+ "gitHead": "16e148e6ec2abac673c5ea1e42bbb666d421f357"
30
31
  }
package/lib/debug.d.ts DELETED
@@ -1,8 +0,0 @@
1
- declare class PerformanceTimer {
2
- #private;
3
- push(name?: string): "" | undefined;
4
- log(): void;
5
- clear(): void;
6
- }
7
- export declare const timer: PerformanceTimer;
8
- export {};
package/lib/debug.js DELETED
@@ -1,63 +0,0 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7
- if (kind === "m") throw new TypeError("Private method is not writable");
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
- };
12
- var _PerformanceTimer_logs, _PerformanceTimer_counter;
13
- import debug from 'debug';
14
- const timeLog = debug('ml-time');
15
- class PerformanceTimer {
16
- constructor() {
17
- _PerformanceTimer_logs.set(this, []);
18
- _PerformanceTimer_counter.set(this, -1);
19
- }
20
- push(name) {
21
- var _a;
22
- if (!timeLog.enabled) {
23
- return '';
24
- }
25
- __classPrivateFieldSet(this, _PerformanceTimer_counter, (_a = __classPrivateFieldGet(this, _PerformanceTimer_counter, "f"), _a++, _a), "f");
26
- const now = performance.now();
27
- const last = __classPrivateFieldGet(this, _PerformanceTimer_logs, "f").at(-1);
28
- if (last && Number.isNaN(last[2])) {
29
- last[2] = now;
30
- }
31
- name = name || `#${__classPrivateFieldGet(this, _PerformanceTimer_counter, "f")}`;
32
- __classPrivateFieldGet(this, _PerformanceTimer_logs, "f").push([name, now, Number.NaN]);
33
- }
34
- log() {
35
- if (!timeLog.enabled) {
36
- return;
37
- }
38
- this.push('end');
39
- __classPrivateFieldGet(this, _PerformanceTimer_logs, "f").pop();
40
- const map = new Map();
41
- for (const content of __classPrivateFieldGet(this, _PerformanceTimer_logs, "f")) {
42
- const diff = content[2] - content[1];
43
- const name = content[0];
44
- if (map.has(name)) {
45
- const [total, count] = map.get(name);
46
- map.set(name, [total + diff, count + 1]);
47
- }
48
- else {
49
- map.set(name, [diff, 1]);
50
- }
51
- }
52
- for (const [name, [total, count]] of map) {
53
- const avg = total / count;
54
- timeLog.extend(name)('%dms (avg: %dms, count: %d)', total.toExponential(3), avg.toExponential(3), count);
55
- }
56
- }
57
- clear() {
58
- __classPrivateFieldSet(this, _PerformanceTimer_logs, [], "f");
59
- __classPrivateFieldSet(this, _PerformanceTimer_counter, -1, "f");
60
- }
61
- }
62
- _PerformanceTimer_logs = new WeakMap(), _PerformanceTimer_counter = new WeakMap();
63
- export const timer = new PerformanceTimer();