eternal-timer 1.5.0 → 2.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/README.md +37 -21
- package/dist/cjs/index.cjs +173 -155
- package/dist/cjs/index.d.ts +70 -42
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/searchRoot.js.map +1 -1
- package/dist/esm/index.d.ts +70 -42
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +171 -151
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/searchRoot.js.map +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/package.json +12 -4
- package/src/index.ts +0 -190
- package/src/searchRoot.ts +0 -17
- /package/dist/cjs/{searchRoot.js → searchRoot.cjs} +0 -0
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,48 +1,76 @@
|
|
|
1
1
|
export type Timer = {
|
|
2
2
|
id: string;
|
|
3
|
-
start:
|
|
4
|
-
stop:
|
|
3
|
+
start: number;
|
|
4
|
+
stop: number;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @description
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* // newTimer will be id of the timer
|
|
7
|
+
* TimersManager
|
|
8
|
+
* @description
|
|
9
|
+
* Manages timers stored in a file.
|
|
10
|
+
* Each timer is stored as: `id start stop`.
|
|
11
|
+
*
|
|
12
|
+
* - Timers are persisted in a file
|
|
13
|
+
* - Expired timers are detected by polling
|
|
15
14
|
*/
|
|
16
|
-
export declare
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
15
|
+
export declare class TimersManager {
|
|
16
|
+
private readonly timerfiledir;
|
|
17
|
+
/**
|
|
18
|
+
* constructor
|
|
19
|
+
* @param timerfiledir(string, optional)
|
|
20
|
+
* If omitted, `.timers` under the project root is used.
|
|
21
|
+
*/
|
|
22
|
+
constructor(timerfiledir?: string);
|
|
23
|
+
/**
|
|
24
|
+
* createFile
|
|
25
|
+
* @description create `.timers` file
|
|
26
|
+
* @returns void
|
|
27
|
+
* @throws If file operation fails
|
|
28
|
+
*/
|
|
29
|
+
private createFile;
|
|
30
|
+
/**
|
|
31
|
+
* createTimer
|
|
32
|
+
* @description Creates a new timer.
|
|
33
|
+
* @param length Timer duration in milliseconds
|
|
34
|
+
* @returns Promise that resolves to the timer ID (UUID)
|
|
35
|
+
* @throws If length is invalid(e.g. length < 0) or file operation fails
|
|
36
|
+
* @example
|
|
37
|
+
* const manager = new TimersManager();
|
|
38
|
+
* const newTimer = await manager.createTimer(5000);
|
|
39
|
+
* // newTimer will be id of the timer
|
|
40
|
+
*/
|
|
41
|
+
createTimer(length: number): Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* removeTimer
|
|
44
|
+
* @description Removes a timer by ID.
|
|
45
|
+
* @param id ID of the timer to remove
|
|
46
|
+
* @returns void
|
|
47
|
+
* @throws If file operation fails
|
|
48
|
+
* @example
|
|
49
|
+
* await manager.removeTimer(id);
|
|
50
|
+
*/
|
|
51
|
+
removeTimer(id: string): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* @description Starts monitoring expired timers asynchronously and returns immediately. The callback is invoked asynchronously when a timer expires.
|
|
54
|
+
* The callback is awaited before continuing.
|
|
55
|
+
* @param callback Function invoked when an expired timer is detected (called asynchronously)
|
|
56
|
+
* @param interval (number, optional): Check interval in milliseconds (default: 50ms)
|
|
57
|
+
* @throws If file operation fails
|
|
58
|
+
* @example
|
|
59
|
+
* manager.checkTimers((timer) => {
|
|
60
|
+
* console.log(`A timer was stopped: ${timer.id}`);
|
|
61
|
+
* });
|
|
62
|
+
*/
|
|
63
|
+
checkTimers(callback: (timer: Timer) => Promise<void>, interval?: number): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* showTimers
|
|
66
|
+
* @description Retrieves all active timers.
|
|
67
|
+
* @returns Array of `Timer` objects
|
|
68
|
+
* @throws If file operation fails
|
|
69
|
+
* @example
|
|
70
|
+
* const timers = await manager.showTimers();
|
|
71
|
+
* console.log(JSON.stringify(timers))
|
|
72
|
+
*/
|
|
73
|
+
showTimers(): Promise<Timer[]>;
|
|
74
|
+
private checkTimerfileSyntax;
|
|
75
|
+
}
|
|
48
76
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,KAAK,GAAG;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAA;CACf,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,KAAK,GAAG;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;;;;GAQG;AACH,qBAAa,aAAa;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC;;;;OAIM;gBAEL,YAAY,CAAC,EAAE,MAAM;IAMtB;;;;;OAKM;YACQ,UAAU;IAQxB;;;;;;;;;;OAUM;IACO,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAqBzD;;;;;;;;OAQM;IACO,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BnD;;;;;;;;;;OAUM;IACO,WAAW,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAE,MAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAkCzG;;;;;;;;OAQM;IACO,UAAU,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAsB7B,oBAAoB;CAiBlC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -2,177 +2,197 @@ import fs from "fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import searchRoot from "./searchRoot.js";
|
|
4
4
|
import { v4 as uuidv4 } from "uuid";
|
|
5
|
-
// search root folder of project
|
|
6
|
-
const rootdir = searchRoot();
|
|
7
|
-
const timerfiledir = path.join(rootdir, ".timers");
|
|
8
5
|
/**
|
|
9
|
-
*
|
|
10
|
-
* @description
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
6
|
+
* TimersManager
|
|
7
|
+
* @description
|
|
8
|
+
* Manages timers stored in a file.
|
|
9
|
+
* Each timer is stored as: `id start stop`.
|
|
10
|
+
*
|
|
11
|
+
* - Timers are persisted in a file
|
|
12
|
+
* - Expired timers are detected by polling
|
|
15
13
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
export class TimersManager {
|
|
15
|
+
timerfiledir;
|
|
16
|
+
/**
|
|
17
|
+
* constructor
|
|
18
|
+
* @param timerfiledir(string, optional)
|
|
19
|
+
* If omitted, `.timers` under the project root is used.
|
|
20
|
+
*/
|
|
21
|
+
constructor(timerfiledir) {
|
|
22
|
+
this.timerfiledir =
|
|
23
|
+
timerfiledir ?? path.join(searchRoot(), ".timers");
|
|
21
24
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export async function createTimer(length) {
|
|
35
|
-
try {
|
|
36
|
-
await createFile();
|
|
37
|
-
if (length < 0) {
|
|
38
|
-
throw new Error(`Invailed length: ${length}`);
|
|
25
|
+
/**
|
|
26
|
+
* createFile
|
|
27
|
+
* @description create `.timers` file
|
|
28
|
+
* @returns void
|
|
29
|
+
* @throws If file operation fails
|
|
30
|
+
*/
|
|
31
|
+
async createFile() {
|
|
32
|
+
try {
|
|
33
|
+
await fs.promises.access(this.timerfiledir);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
await fs.promises.writeFile(this.timerfiledir, "");
|
|
39
37
|
}
|
|
40
|
-
length = Math.trunc(length);
|
|
41
|
-
// uuid, start, end
|
|
42
|
-
const id = uuidv4();
|
|
43
|
-
const now = Date.now();
|
|
44
|
-
const newTimerData = `${id} ${now.toString()} ${(now + length).toString()}`;
|
|
45
|
-
await fs.promises.appendFile(timerfiledir, newTimerData + "\n");
|
|
46
|
-
return id;
|
|
47
|
-
}
|
|
48
|
-
catch (e) {
|
|
49
|
-
throw new Error(`Error when creating timer: ${e}`);
|
|
50
38
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
for (const timerData of timersData) {
|
|
68
|
-
if (!timerData.trim()) {
|
|
69
|
-
found = true;
|
|
70
|
-
continue;
|
|
39
|
+
/**
|
|
40
|
+
* createTimer
|
|
41
|
+
* @description Creates a new timer.
|
|
42
|
+
* @param length Timer duration in milliseconds
|
|
43
|
+
* @returns Promise that resolves to the timer ID (UUID)
|
|
44
|
+
* @throws If length is invalid(e.g. length < 0) or file operation fails
|
|
45
|
+
* @example
|
|
46
|
+
* const manager = new TimersManager();
|
|
47
|
+
* const newTimer = await manager.createTimer(5000);
|
|
48
|
+
* // newTimer will be id of the timer
|
|
49
|
+
*/
|
|
50
|
+
async createTimer(length) {
|
|
51
|
+
try {
|
|
52
|
+
await this.createFile();
|
|
53
|
+
if (length < 0) {
|
|
54
|
+
throw new Error(`Invailed length: ${length}`);
|
|
71
55
|
}
|
|
72
|
-
|
|
73
|
-
|
|
56
|
+
length = Math.trunc(length);
|
|
57
|
+
// uuid, start, end
|
|
58
|
+
const id = uuidv4();
|
|
59
|
+
const now = Date.now();
|
|
60
|
+
const newTimerData = `${id} ${now.toString()} ${(now + length).toString()}`;
|
|
61
|
+
await fs.promises.appendFile(this.timerfiledir, newTimerData + "\n");
|
|
62
|
+
return id;
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
throw new Error(`Error when creating timer: ${e}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* removeTimer
|
|
70
|
+
* @description Removes a timer by ID.
|
|
71
|
+
* @param id ID of the timer to remove
|
|
72
|
+
* @returns void
|
|
73
|
+
* @throws If file operation fails
|
|
74
|
+
* @example
|
|
75
|
+
* await manager.removeTimer(id);
|
|
76
|
+
*/
|
|
77
|
+
async removeTimer(id) {
|
|
78
|
+
try {
|
|
79
|
+
const timersRaw = fs.readFileSync(this.timerfiledir, "utf-8");
|
|
80
|
+
const timersData = timersRaw.split(/\r?\n/);
|
|
81
|
+
let newTimersData = "";
|
|
82
|
+
let found = false;
|
|
83
|
+
for (const timerData of timersData) {
|
|
84
|
+
if (!timerData.trim())
|
|
85
|
+
continue;
|
|
86
|
+
const [timerId] = timerData.split(" ");
|
|
87
|
+
if (timerId === id) {
|
|
88
|
+
found = true;
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
74
91
|
newTimersData += timerData + "\n";
|
|
75
92
|
}
|
|
93
|
+
if (!found) {
|
|
94
|
+
throw new Error(`Timer with id ${id} not found`);
|
|
95
|
+
}
|
|
96
|
+
await fs.promises.writeFile(this.timerfiledir, newTimersData, "utf-8");
|
|
97
|
+
return;
|
|
76
98
|
}
|
|
77
|
-
|
|
78
|
-
throw new Error(`
|
|
99
|
+
catch (e) {
|
|
100
|
+
throw new Error(`Error when removing timer: ${e}`);
|
|
79
101
|
}
|
|
80
|
-
await fs.promises.writeFile(timerfiledir, newTimersData, "utf-8");
|
|
81
|
-
return;
|
|
82
102
|
}
|
|
83
|
-
|
|
84
|
-
|
|
103
|
+
/**
|
|
104
|
+
* @description Starts monitoring expired timers asynchronously and returns immediately. The callback is invoked asynchronously when a timer expires.
|
|
105
|
+
* The callback is awaited before continuing.
|
|
106
|
+
* @param callback Function invoked when an expired timer is detected (called asynchronously)
|
|
107
|
+
* @param interval (number, optional): Check interval in milliseconds (default: 50ms)
|
|
108
|
+
* @throws If file operation fails
|
|
109
|
+
* @example
|
|
110
|
+
* manager.checkTimers((timer) => {
|
|
111
|
+
* console.log(`A timer was stopped: ${timer.id}`);
|
|
112
|
+
* });
|
|
113
|
+
*/
|
|
114
|
+
async checkTimers(callback, interval = 50) {
|
|
115
|
+
try {
|
|
116
|
+
await this.createFile();
|
|
117
|
+
setInterval(async () => {
|
|
118
|
+
const timersDataRaw = await fs.promises.readFile(this.timerfiledir, "utf-8");
|
|
119
|
+
const timersData = timersDataRaw.split(/\r?\n/);
|
|
120
|
+
const timersSet = new Set();
|
|
121
|
+
await this.checkTimerfileSyntax(timersDataRaw);
|
|
122
|
+
for (const timerData of timersData) {
|
|
123
|
+
if (!timerData.trim())
|
|
124
|
+
continue;
|
|
125
|
+
const [id, startStr, stopStr] = timerData.split(" ");
|
|
126
|
+
timersSet.add({
|
|
127
|
+
id: id,
|
|
128
|
+
start: Number(startStr),
|
|
129
|
+
stop: Number(stopStr),
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
const now = Date.now();
|
|
133
|
+
for (const timer of timersSet) {
|
|
134
|
+
if (Number(timer.stop) <= now) {
|
|
135
|
+
await this.removeTimer(timer.id);
|
|
136
|
+
await callback(timer);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}, interval);
|
|
140
|
+
}
|
|
141
|
+
catch (e) {
|
|
142
|
+
throw new Error(`Error when checking alarm: ${e}`);
|
|
143
|
+
}
|
|
85
144
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const timersDataRaw = fs.readFileSync(timerfiledir, "utf-8");
|
|
102
|
-
const timersData = timersDataRaw.split(/\r?\n/);
|
|
103
|
-
const timersSet = new Set();
|
|
104
|
-
checkTimerfileSyntax(timersDataRaw);
|
|
145
|
+
/**
|
|
146
|
+
* showTimers
|
|
147
|
+
* @description Retrieves all active timers.
|
|
148
|
+
* @returns Array of `Timer` objects
|
|
149
|
+
* @throws If file operation fails
|
|
150
|
+
* @example
|
|
151
|
+
* const timers = await manager.showTimers();
|
|
152
|
+
* console.log(JSON.stringify(timers))
|
|
153
|
+
*/
|
|
154
|
+
async showTimers() {
|
|
155
|
+
try {
|
|
156
|
+
await this.createFile();
|
|
157
|
+
const timersRaw = fs.readFileSync(this.timerfiledir, "utf-8");
|
|
158
|
+
const timersData = timersRaw.split(/\r?\n/);
|
|
159
|
+
const timersJSON = [];
|
|
105
160
|
for (const timerData of timersData) {
|
|
161
|
+
const splitedTimerData = timerData.split(" ");
|
|
106
162
|
if (!timerData.trim())
|
|
107
163
|
continue;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
stop: stopStr
|
|
164
|
+
timersJSON.push({
|
|
165
|
+
id: splitedTimerData[0],
|
|
166
|
+
start: Number(splitedTimerData[1]),
|
|
167
|
+
stop: Number(splitedTimerData[2]),
|
|
113
168
|
});
|
|
114
169
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}, interval);
|
|
123
|
-
}
|
|
124
|
-
catch (e) {
|
|
125
|
-
throw new Error(`Error when checking alarm: ${e}`);
|
|
170
|
+
return timersJSON;
|
|
171
|
+
}
|
|
172
|
+
catch (e) {
|
|
173
|
+
throw new Error(`Error when showing timers: ${e}`);
|
|
174
|
+
}
|
|
126
175
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
* console.log(JSON.stringify(timers))
|
|
136
|
-
*/
|
|
137
|
-
export async function showTimers() {
|
|
138
|
-
try {
|
|
139
|
-
await createFile();
|
|
140
|
-
const timersRaw = fs.readFileSync(timerfiledir, "utf-8");
|
|
141
|
-
const timersData = timersRaw.split(/\r?\n/);
|
|
142
|
-
let timersJSON = [];
|
|
176
|
+
async checkTimerfileSyntax(fileData) {
|
|
177
|
+
const throwing = () => {
|
|
178
|
+
throw new Error(`Timer file's syntax is wrong`);
|
|
179
|
+
};
|
|
180
|
+
const timersData = fileData
|
|
181
|
+
.split('\n')
|
|
182
|
+
.map(l => l.trim())
|
|
183
|
+
.filter(l => l !== "");
|
|
143
184
|
for (const timerData of timersData) {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
185
|
+
const timerArray = timerData.split(/\s+/);
|
|
186
|
+
if (timerArray.length !== 3)
|
|
187
|
+
throwing();
|
|
188
|
+
if (timerArray[0]?.length !== 36)
|
|
189
|
+
throwing();
|
|
190
|
+
if (timerArray[1].trim() === "")
|
|
191
|
+
throwing();
|
|
192
|
+
if (timerArray[2].trim() === "")
|
|
193
|
+
throwing();
|
|
150
194
|
}
|
|
151
|
-
return
|
|
152
|
-
}
|
|
153
|
-
catch (e) {
|
|
154
|
-
throw new Error(`Error when showing timers: ${e}`);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
async function checkTimerfileSyntax(fileData) {
|
|
158
|
-
const throwing = () => {
|
|
159
|
-
throw new Error(`Timer file's syntax is wrong`);
|
|
160
|
-
};
|
|
161
|
-
const timersData = fileData
|
|
162
|
-
.split('\n')
|
|
163
|
-
.map(l => l.trim())
|
|
164
|
-
.filter(l => l !== "");
|
|
165
|
-
for (const timerData of timersData) {
|
|
166
|
-
const timerArray = timerData.split(/\s+/);
|
|
167
|
-
if (timerArray.length !== 3)
|
|
168
|
-
throwing();
|
|
169
|
-
if (timerArray[0]?.length !== 36)
|
|
170
|
-
throwing();
|
|
171
|
-
if (timerArray[1].trim() === "")
|
|
172
|
-
throwing();
|
|
173
|
-
if (timerArray[2].trim() === "")
|
|
174
|
-
throwing();
|
|
195
|
+
return;
|
|
175
196
|
}
|
|
176
|
-
return;
|
|
177
197
|
}
|
|
178
198
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAQpC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;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SAAS,IAAI,UAAU,EAAE,CAAC;YACpC,MAAM,UAAU,GAAa,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACpD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;gBAAE,QAAQ,EAAE,CAAC;YACxC,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,EAAE;gBAAE,QAAQ,EAAE,CAAC;YAC7C,IAAI,UAAU,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,KAAK,EAAE;gBAAE,QAAQ,EAAE,CAAC;YAC7C,IAAI,UAAU,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,KAAK,EAAE;gBAAE,QAAQ,EAAE,CAAC;QAC9C,CAAC;QACD,OAAO;IACR,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchRoot.js","sourceRoot":"","sources":["../../src/searchRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU;
|
|
1
|
+
{"version":3,"file":"searchRoot.js","sourceRoot":"","sources":["../../src/searchRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU;IACjC,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QACvD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;IACd,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
|