@idlebox/common 1.3.21 → 1.3.22
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/lib/cjs/__create_index.generated.cjs +39 -25
- package/lib/cjs/__create_index.generated.cjs.map +1 -1
- package/lib/cjs/__create_index.generated.d.cts +49 -16
- package/lib/cjs/path/pathArray.cjs +80 -19
- package/lib/cjs/path/pathArray.cjs.map +1 -1
- package/lib/cjs/platform/os.cjs +47 -37
- package/lib/cjs/platform/os.cjs.map +1 -1
- package/lib/esm/__create_index.generated.d.mts +49 -16
- package/lib/esm/__create_index.generated.mjs +15 -8
- package/lib/esm/__create_index.generated.mjs.map +1 -1
- package/lib/esm/path/pathArray.mjs +77 -17
- package/lib/esm/path/pathArray.mjs.map +1 -1
- package/lib/esm/platform/os.mjs +46 -36
- package/lib/esm/platform/os.mjs.map +1 -1
- package/package.json +1 -1
- package/src/path/pathArray.ts +95 -16
- package/src/platform/os.ts +49 -37
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
/* eslint-disable */
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.globalSingleton = exports.globalSingletonDelete = exports.globalSingletonStrong = exports.x = exports.ensureGlobalObject = exports.globalObject = exports.AsyncDisposable = exports.isDisposedError = exports.DisposedError = exports.addDisposableEventListener = exports.toDisposable = exports.Emitter = exports.DelayCallbackList = exports.CallbackList = exports.AsyncCallbackList = exports.assertFunctionHasName = exports.nameFunction = exports.functionName = exports.convertCatchedError = exports.getErrorFrame = exports.tryInspect = exports.assertSerializable = exports.getTypeOf = exports.isSerializable = exports.SerializableKind = exports.isScalar = exports.fromTimeStamp = exports.getTimeStamp = exports.humanDate = exports.pad2 = exports.nextYear = exports.nextMonth = exports.nextWeek = exports.nextDay = exports.nextHour = exports.nextMinute = exports.nextSecond = exports.isDateInvalid = exports.oneWeek = exports.oneDay = exports.oneHour = exports.oneMinute = exports.oneSecond = exports.sortByString = exports.normalizeArray = exports.uniqueFilter = exports.arrayUniqueReference = exports.arrayUnique = exports.isArraySame = exports.arrayDiff = void 0;
|
|
7
|
-
exports.
|
|
8
|
-
exports.humanSpeed = exports.humanSize = exports.humanSizeSI = exports.escapeRegExp = exports.concatStringType = exports.
|
|
7
|
+
exports.ucfirst = exports.camelCase = exports.normalizePath = exports.isAbsolute = exports.isObjectSameRecursive = exports.isObjectSame = exports.objectPath = exports.initOnRead = exports.definePublicConstant = exports.throwNull = exports.assertNotNull = exports.ExtendMap = exports.CustomSet = exports.RegexpFinder = exports.WrappedConsole = exports.ColorKind = exports.is32Bit = exports.sepList = exports.is64Bit = exports.isWeb = exports.isNative = exports.isLinux = exports.isMacintosh = exports.isWindows = exports.isElectronMain = exports.isElectronRenderer = exports.isElectronSandbox = exports.isElectron = exports.hasGlobal = exports.hasWindow = exports.hasProcess = exports.timeoutPromise = exports.sleep = exports.timeout = exports.isTimeoutError = exports.TimeoutError = exports.CancellationTokenSource = exports.DeferredPromise = exports.isCanceledError = exports.CanceledError = exports.MemorizedEmitter = exports.unsubscribableToDisposable = exports.Disposable = exports.DisposableOnce = exports.LifecycleObject = exports.disposeGlobal = exports.ensureDisposeGlobal = exports.registerGlobalLifecycle = exports.deleteSymbol = exports.createSymbol = void 0;
|
|
8
|
+
exports.humanSpeed = exports.humanSize = exports.humanSizeSI = exports.escapeRegExp = exports.concatStringType = exports.memo = exports.memorizeValueSymbol = exports.init = exports.bindThis = exports.singleton = exports.SingletonType = exports.singletonSymbol = exports.hookClass = exports.hookClassSymbol = exports.TimeoutPromisePool = exports.PromisePool = exports.promiseBool = exports.finishAllPromise = exports.awaitIterator = exports.PathArray = exports.PathArrayPosix = exports.PathArrayWindows = exports.linux_case_hyphen = exports.linux_case = exports.lcfirst = void 0;
|
|
9
9
|
var arrayDiff_js_1 = require("./array/arrayDiff.cjs");
|
|
10
10
|
Object.defineProperty(exports, "arrayDiff", { enumerable: true, get: function () { return arrayDiff_js_1.arrayDiff; } });
|
|
11
11
|
/* array/arraySame.ts */
|
|
@@ -201,25 +201,35 @@ Object.defineProperty(exports, "timeoutPromise", { enumerable: true, get: functi
|
|
|
201
201
|
/* platform/os.ts */
|
|
202
202
|
// Identifiers
|
|
203
203
|
var os_js_1 = require("./platform/os.cjs");
|
|
204
|
-
Object.defineProperty(exports, "
|
|
204
|
+
Object.defineProperty(exports, "hasProcess", { enumerable: true, get: function () { return os_js_1.hasProcess; } });
|
|
205
205
|
var os_js_2 = require("./platform/os.cjs");
|
|
206
|
-
Object.defineProperty(exports, "
|
|
206
|
+
Object.defineProperty(exports, "hasWindow", { enumerable: true, get: function () { return os_js_2.hasWindow; } });
|
|
207
207
|
var os_js_3 = require("./platform/os.cjs");
|
|
208
|
-
Object.defineProperty(exports, "
|
|
208
|
+
Object.defineProperty(exports, "hasGlobal", { enumerable: true, get: function () { return os_js_3.hasGlobal; } });
|
|
209
209
|
var os_js_4 = require("./platform/os.cjs");
|
|
210
|
-
Object.defineProperty(exports, "
|
|
210
|
+
Object.defineProperty(exports, "isElectron", { enumerable: true, get: function () { return os_js_4.isElectron; } });
|
|
211
211
|
var os_js_5 = require("./platform/os.cjs");
|
|
212
|
-
Object.defineProperty(exports, "
|
|
212
|
+
Object.defineProperty(exports, "isElectronSandbox", { enumerable: true, get: function () { return os_js_5.isElectronSandbox; } });
|
|
213
213
|
var os_js_6 = require("./platform/os.cjs");
|
|
214
|
-
Object.defineProperty(exports, "
|
|
214
|
+
Object.defineProperty(exports, "isElectronRenderer", { enumerable: true, get: function () { return os_js_6.isElectronRenderer; } });
|
|
215
215
|
var os_js_7 = require("./platform/os.cjs");
|
|
216
|
-
Object.defineProperty(exports, "
|
|
216
|
+
Object.defineProperty(exports, "isElectronMain", { enumerable: true, get: function () { return os_js_7.isElectronMain; } });
|
|
217
217
|
var os_js_8 = require("./platform/os.cjs");
|
|
218
|
-
Object.defineProperty(exports, "
|
|
218
|
+
Object.defineProperty(exports, "isWindows", { enumerable: true, get: function () { return os_js_8.isWindows; } });
|
|
219
219
|
var os_js_9 = require("./platform/os.cjs");
|
|
220
|
-
Object.defineProperty(exports, "
|
|
220
|
+
Object.defineProperty(exports, "isMacintosh", { enumerable: true, get: function () { return os_js_9.isMacintosh; } });
|
|
221
221
|
var os_js_10 = require("./platform/os.cjs");
|
|
222
|
-
Object.defineProperty(exports, "
|
|
222
|
+
Object.defineProperty(exports, "isLinux", { enumerable: true, get: function () { return os_js_10.isLinux; } });
|
|
223
|
+
var os_js_11 = require("./platform/os.cjs");
|
|
224
|
+
Object.defineProperty(exports, "isNative", { enumerable: true, get: function () { return os_js_11.isNative; } });
|
|
225
|
+
var os_js_12 = require("./platform/os.cjs");
|
|
226
|
+
Object.defineProperty(exports, "isWeb", { enumerable: true, get: function () { return os_js_12.isWeb; } });
|
|
227
|
+
var os_js_13 = require("./platform/os.cjs");
|
|
228
|
+
Object.defineProperty(exports, "is64Bit", { enumerable: true, get: function () { return os_js_13.is64Bit; } });
|
|
229
|
+
var os_js_14 = require("./platform/os.cjs");
|
|
230
|
+
Object.defineProperty(exports, "sepList", { enumerable: true, get: function () { return os_js_14.sepList; } });
|
|
231
|
+
var os_js_15 = require("./platform/os.cjs");
|
|
232
|
+
Object.defineProperty(exports, "is32Bit", { enumerable: true, get: function () { return os_js_15.is32Bit; } });
|
|
223
233
|
/* log/logger.ts */
|
|
224
234
|
// Identifiers
|
|
225
235
|
var logger_js_1 = require("./log/logger.cjs");
|
|
@@ -262,10 +272,26 @@ Object.defineProperty(exports, "isAbsolute", { enumerable: true, get: function (
|
|
|
262
272
|
// Identifiers
|
|
263
273
|
var normalizePath_js_1 = require("./path/normalizePath.cjs");
|
|
264
274
|
Object.defineProperty(exports, "normalizePath", { enumerable: true, get: function () { return normalizePath_js_1.normalizePath; } });
|
|
275
|
+
/* string/castCase.ts */
|
|
276
|
+
// Identifiers
|
|
277
|
+
var castCase_js_1 = require("./string/castCase.cjs");
|
|
278
|
+
Object.defineProperty(exports, "camelCase", { enumerable: true, get: function () { return castCase_js_1.camelCase; } });
|
|
279
|
+
var castCase_js_2 = require("./string/castCase.cjs");
|
|
280
|
+
Object.defineProperty(exports, "ucfirst", { enumerable: true, get: function () { return castCase_js_2.ucfirst; } });
|
|
281
|
+
var castCase_js_3 = require("./string/castCase.cjs");
|
|
282
|
+
Object.defineProperty(exports, "lcfirst", { enumerable: true, get: function () { return castCase_js_3.lcfirst; } });
|
|
283
|
+
var castCase_js_4 = require("./string/castCase.cjs");
|
|
284
|
+
Object.defineProperty(exports, "linux_case", { enumerable: true, get: function () { return castCase_js_4.linux_case; } });
|
|
285
|
+
var castCase_js_5 = require("./string/castCase.cjs");
|
|
286
|
+
Object.defineProperty(exports, "linux_case_hyphen", { enumerable: true, get: function () { return castCase_js_5.linux_case_hyphen; } });
|
|
265
287
|
/* path/pathArray.ts */
|
|
266
288
|
// Identifiers
|
|
267
289
|
var pathArray_js_1 = require("./path/pathArray.cjs");
|
|
268
|
-
Object.defineProperty(exports, "
|
|
290
|
+
Object.defineProperty(exports, "PathArrayWindows", { enumerable: true, get: function () { return pathArray_js_1.PathArrayWindows; } });
|
|
291
|
+
var pathArray_js_2 = require("./path/pathArray.cjs");
|
|
292
|
+
Object.defineProperty(exports, "PathArrayPosix", { enumerable: true, get: function () { return pathArray_js_2.PathArrayPosix; } });
|
|
293
|
+
var pathArray_js_3 = require("./path/pathArray.cjs");
|
|
294
|
+
Object.defineProperty(exports, "PathArray", { enumerable: true, get: function () { return pathArray_js_3.PathArray; } });
|
|
269
295
|
/* promise/awaitIterator.ts */
|
|
270
296
|
// Identifiers
|
|
271
297
|
var awaitIterator_js_1 = require("./promise/awaitIterator.cjs");
|
|
@@ -312,18 +338,6 @@ var memorize_js_1 = require("./reflection/methods/memorize.cjs");
|
|
|
312
338
|
Object.defineProperty(exports, "memorizeValueSymbol", { enumerable: true, get: function () { return memorize_js_1.memorizeValueSymbol; } });
|
|
313
339
|
var memorize_js_2 = require("./reflection/methods/memorize.cjs");
|
|
314
340
|
Object.defineProperty(exports, "memo", { enumerable: true, get: function () { return memorize_js_2.memo; } });
|
|
315
|
-
/* string/castCase.ts */
|
|
316
|
-
// Identifiers
|
|
317
|
-
var castCase_js_1 = require("./string/castCase.cjs");
|
|
318
|
-
Object.defineProperty(exports, "camelCase", { enumerable: true, get: function () { return castCase_js_1.camelCase; } });
|
|
319
|
-
var castCase_js_2 = require("./string/castCase.cjs");
|
|
320
|
-
Object.defineProperty(exports, "ucfirst", { enumerable: true, get: function () { return castCase_js_2.ucfirst; } });
|
|
321
|
-
var castCase_js_3 = require("./string/castCase.cjs");
|
|
322
|
-
Object.defineProperty(exports, "lcfirst", { enumerable: true, get: function () { return castCase_js_3.lcfirst; } });
|
|
323
|
-
var castCase_js_4 = require("./string/castCase.cjs");
|
|
324
|
-
Object.defineProperty(exports, "linux_case", { enumerable: true, get: function () { return castCase_js_4.linux_case; } });
|
|
325
|
-
var castCase_js_5 = require("./string/castCase.cjs");
|
|
326
|
-
Object.defineProperty(exports, "linux_case_hyphen", { enumerable: true, get: function () { return castCase_js_5.linux_case_hyphen; } });
|
|
327
341
|
/* string/concatType.generated.ts */
|
|
328
342
|
// Identifiers
|
|
329
343
|
var concatType_generated_js_1 = require("./string/concatType.generated.cjs");
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
"../../src/__create_index.generated.ts"
|
|
7
7
|
],
|
|
8
8
|
"names": [],
|
|
9
|
-
"mappings": ";AAAA,wBAAwB;AACxB,aAAa;AACb,oBAAoB;;;;;AAKnB,sDAA+C;AAAvC,yGAAA,SAAS,OAAA;AAClB,wBAAwB;AACvB,cAAc;AACd,sDAAiD;AAAzC,2GAAA,WAAW,OAAA;AACpB,0BAA0B;AACzB,cAAc;AACd,0DAAmD;AAA3C,6GAAA,WAAW,OAAA;AACnB,0DAA4D;AAApD,sHAAA,oBAAoB,OAAA;AAE5B,0DAAoD;AAA5C,8GAAA,YAAY,OAAA;AACrB,6BAA6B;AAC5B,cAAc;AACd,gEAAyD;AAAjD,mHAAA,cA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ACd,yDAAmD;AAA3C,4GAAA,WAAW,OAAA;AACnB,yDAAiD;AAAzC,0GAAA,SAAS,OAAA;AACjB,yDAAkD;AAA1C,2GAAA,UAAU,OAAA"
|
|
10
10
|
}
|
|
@@ -521,6 +521,12 @@ export declare function globalSingletonStrong<T>(symbol: symbol | string, constr
|
|
|
521
521
|
*/
|
|
522
522
|
export declare function globalSingletonStrong<T>(symbol: symbol | string): T | undefined;
|
|
523
523
|
|
|
524
|
+
export declare const hasGlobal: boolean;
|
|
525
|
+
|
|
526
|
+
export declare const hasProcess: boolean;
|
|
527
|
+
|
|
528
|
+
export declare const hasWindow: boolean;
|
|
529
|
+
|
|
524
530
|
export declare function hookClass<TC extends IConstructorOf<T>, T>(target: TC): IHooks<T, TC>;
|
|
525
531
|
|
|
526
532
|
export declare const hookClassSymbol: unique symbol;
|
|
@@ -721,6 +727,10 @@ export declare interface IProgressHolder<T, PT> {
|
|
|
721
727
|
progress(fn: ProgressCallback<PT>): Promise<T> & IProgressHolder<T, PT>;
|
|
722
728
|
}
|
|
723
729
|
|
|
730
|
+
export declare const is32Bit: boolean;
|
|
731
|
+
|
|
732
|
+
export declare let is64Bit: boolean;
|
|
733
|
+
|
|
724
734
|
/**
|
|
725
735
|
* return true if a path is absolute:
|
|
726
736
|
* - /xxxx
|
|
@@ -747,17 +757,19 @@ export declare function isDateInvalid(date: Date): boolean;
|
|
|
747
757
|
|
|
748
758
|
export declare function isDisposedError(error: any): boolean;
|
|
749
759
|
|
|
750
|
-
export declare
|
|
760
|
+
export declare let isElectron: boolean;
|
|
761
|
+
|
|
762
|
+
export declare let isElectronMain: boolean;
|
|
751
763
|
|
|
752
|
-
export declare
|
|
764
|
+
export declare let isElectronRenderer: boolean;
|
|
753
765
|
|
|
754
|
-
export declare
|
|
766
|
+
export declare let isElectronSandbox: boolean;
|
|
755
767
|
|
|
756
|
-
export declare
|
|
768
|
+
export declare let isLinux: boolean;
|
|
757
769
|
|
|
758
|
-
export declare
|
|
770
|
+
export declare let isMacintosh: boolean;
|
|
759
771
|
|
|
760
|
-
export declare
|
|
772
|
+
export declare let isNative: boolean;
|
|
761
773
|
|
|
762
774
|
/**
|
|
763
775
|
* Should ensure a and b is none-null before call this
|
|
@@ -778,9 +790,9 @@ export declare function isSerializable(value: any): SerializableKind;
|
|
|
778
790
|
/** @public */
|
|
779
791
|
export declare function isTimeoutError(error: Error): error is TimeoutError;
|
|
780
792
|
|
|
781
|
-
export declare
|
|
793
|
+
export declare let isWeb: boolean;
|
|
782
794
|
|
|
783
|
-
export declare
|
|
795
|
+
export declare let isWindows: boolean;
|
|
784
796
|
|
|
785
797
|
export declare interface IUniqueIdFactory<T> {
|
|
786
798
|
(item: T): string;
|
|
@@ -908,22 +920,45 @@ export declare const oneWeek = 604800000;
|
|
|
908
920
|
*/
|
|
909
921
|
export declare function pad2(s: number): string;
|
|
910
922
|
|
|
923
|
+
export declare const PathArray: typeof PathArrayAbstract;
|
|
924
|
+
|
|
911
925
|
/**
|
|
912
|
-
* Work on "PATH"-like values
|
|
926
|
+
* Work on "PATH"-like values, but always use / insteadof \
|
|
913
927
|
*/
|
|
914
|
-
|
|
928
|
+
declare abstract class PathArrayAbstract extends Set<string> {
|
|
915
929
|
private readonly sep;
|
|
916
|
-
constructor(init: string, sep
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
has(path: string): boolean;
|
|
930
|
+
constructor(init: string, sep?: ':' | ';');
|
|
931
|
+
abstract normalize(path: string): string;
|
|
932
|
+
split(pathArrStr: string): string[];
|
|
920
933
|
toString(): string;
|
|
934
|
+
/** @deprecated @use values() */
|
|
935
|
+
keys(): IterableIterator<string>;
|
|
936
|
+
/** @deprecated @use values() */
|
|
937
|
+
entries(): IterableIterator<[string, string]>;
|
|
938
|
+
[Symbol.iterator](): IterableIterator<string>;
|
|
921
939
|
/**
|
|
922
940
|
* @returns an array with `part` append to every element
|
|
923
941
|
*/
|
|
924
942
|
join(part: string): string[];
|
|
925
943
|
}
|
|
926
944
|
|
|
945
|
+
export declare class PathArrayPosix extends PathArrayAbstract {
|
|
946
|
+
normalize(path: string): string;
|
|
947
|
+
add(paths: string): this;
|
|
948
|
+
delete(paths: string): boolean;
|
|
949
|
+
has(path: string): boolean;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
export declare class PathArrayWindows extends PathArrayAbstract {
|
|
953
|
+
private readonly caseMap;
|
|
954
|
+
normalize(path: string): string;
|
|
955
|
+
clear(): void;
|
|
956
|
+
add(paths: string): this;
|
|
957
|
+
delete(paths: string): boolean;
|
|
958
|
+
has(path: string): boolean;
|
|
959
|
+
values(): IterableIterator<string>;
|
|
960
|
+
}
|
|
961
|
+
|
|
927
962
|
declare type Person = StructString<{
|
|
928
963
|
name: string;
|
|
929
964
|
email: string;
|
|
@@ -1073,8 +1108,6 @@ export declare function unsubscribableToDisposable(subscription: Unsubscribable)
|
|
|
1073
1108
|
dispose: () => void;
|
|
1074
1109
|
};
|
|
1075
1110
|
|
|
1076
|
-
export declare const userAgent: string;
|
|
1077
|
-
|
|
1078
1111
|
export declare type ValueCallback<T = any> = (value: T | Promise<T>) => void;
|
|
1079
1112
|
|
|
1080
1113
|
export declare abstract class WrappedConsole {
|
|
@@ -1,45 +1,106 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PathArray = void 0;
|
|
3
|
+
exports.PathArray = exports.PathArrayPosix = exports.PathArrayWindows = void 0;
|
|
4
|
+
const os_1 = require("../platform/os.cjs");
|
|
5
|
+
const castCase_1 = require("../string/castCase.cjs");
|
|
4
6
|
const normalizePath_1 = require("./normalizePath.cjs");
|
|
7
|
+
const isAbsolute = /^[a-z]:[/\\]/i;
|
|
5
8
|
/**
|
|
6
|
-
* Work on "PATH"-like values
|
|
9
|
+
* Work on "PATH"-like values, but always use / insteadof \
|
|
7
10
|
*/
|
|
8
|
-
class
|
|
11
|
+
class PathArrayAbstract extends Set {
|
|
9
12
|
sep;
|
|
10
|
-
constructor(init, sep) {
|
|
13
|
+
constructor(init, sep = os_1.isWindows ? ';' : ':') {
|
|
11
14
|
super();
|
|
12
15
|
this.sep = sep;
|
|
13
16
|
if (init)
|
|
14
17
|
this.add(init);
|
|
15
18
|
}
|
|
19
|
+
split(pathArrStr) {
|
|
20
|
+
return pathArrStr.split(this.sep);
|
|
21
|
+
}
|
|
22
|
+
toString() {
|
|
23
|
+
return [...this.values()].join(this.sep);
|
|
24
|
+
}
|
|
25
|
+
/** @deprecated @use values() */
|
|
26
|
+
keys() {
|
|
27
|
+
throw new Error('not impl');
|
|
28
|
+
}
|
|
29
|
+
/** @deprecated @use values() */
|
|
30
|
+
entries() {
|
|
31
|
+
throw new Error('not impl');
|
|
32
|
+
}
|
|
33
|
+
[Symbol.iterator]() {
|
|
34
|
+
return this.values();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @returns an array with `part` append to every element
|
|
38
|
+
*/
|
|
39
|
+
join(part) {
|
|
40
|
+
return [...this.values()].map((p) => (0, normalizePath_1.normalizePath)(p + '/' + part));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
class PathArrayWindows extends PathArrayAbstract {
|
|
44
|
+
caseMap = new Map();
|
|
45
|
+
normalize(path) {
|
|
46
|
+
path = (0, normalizePath_1.normalizePath)(path);
|
|
47
|
+
if (isAbsolute.test(path)) {
|
|
48
|
+
path = (0, castCase_1.ucfirst)(path);
|
|
49
|
+
}
|
|
50
|
+
return path;
|
|
51
|
+
}
|
|
52
|
+
clear() {
|
|
53
|
+
super.clear();
|
|
54
|
+
this.caseMap.clear();
|
|
55
|
+
}
|
|
16
56
|
add(paths) {
|
|
17
|
-
for (const p of
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
57
|
+
for (const p of this.split(paths)) {
|
|
58
|
+
const rpath = this.normalize(p);
|
|
59
|
+
const lcase = rpath.toLowerCase();
|
|
60
|
+
this.caseMap.set(lcase, rpath);
|
|
61
|
+
super.add(lcase);
|
|
21
62
|
}
|
|
22
63
|
return this;
|
|
23
64
|
}
|
|
24
65
|
delete(paths) {
|
|
25
66
|
let anyRet = false;
|
|
26
|
-
for (const p of
|
|
27
|
-
|
|
67
|
+
for (const p of this.split(paths)) {
|
|
68
|
+
const rpath = this.normalize(p);
|
|
69
|
+
const lcase = rpath.toLowerCase();
|
|
70
|
+
this.caseMap.delete(lcase);
|
|
71
|
+
anyRet = anyRet || super.delete(lcase);
|
|
28
72
|
}
|
|
29
73
|
return anyRet;
|
|
30
74
|
}
|
|
31
75
|
has(path) {
|
|
32
|
-
return super.has(
|
|
76
|
+
return super.has(this.normalize(path).toLowerCase());
|
|
33
77
|
}
|
|
34
|
-
|
|
35
|
-
return
|
|
78
|
+
values() {
|
|
79
|
+
return this.caseMap.values();
|
|
36
80
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return
|
|
81
|
+
}
|
|
82
|
+
exports.PathArrayWindows = PathArrayWindows;
|
|
83
|
+
class PathArrayPosix extends PathArrayAbstract {
|
|
84
|
+
normalize(path) {
|
|
85
|
+
return (0, normalizePath_1.normalizePath)(path);
|
|
86
|
+
}
|
|
87
|
+
add(paths) {
|
|
88
|
+
for (const p of this.split(paths)) {
|
|
89
|
+
super.add(this.normalize(p));
|
|
90
|
+
}
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
delete(paths) {
|
|
94
|
+
let anyRet = false;
|
|
95
|
+
for (const p of this.split(paths)) {
|
|
96
|
+
anyRet = anyRet || super.delete(this.normalize(p));
|
|
97
|
+
}
|
|
98
|
+
return anyRet;
|
|
99
|
+
}
|
|
100
|
+
has(path) {
|
|
101
|
+
return super.has(this.normalize(path));
|
|
42
102
|
}
|
|
43
103
|
}
|
|
44
|
-
exports.
|
|
104
|
+
exports.PathArrayPosix = PathArrayPosix;
|
|
105
|
+
exports.PathArray = os_1.isWindows ? PathArrayWindows : PathArrayPosix;
|
|
45
106
|
//# sourceMappingURL=path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
|
3
|
-
exports.sepList = exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.isElectron =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_userAgent = navigator.userAgent;
|
|
17
|
-
_isWindows = _userAgent.indexOf('Windows') >= 0;
|
|
18
|
-
_isMacintosh = _userAgent.indexOf('Macintosh') >= 0;
|
|
19
|
-
_isLinux = _userAgent.indexOf('Linux') >= 0;
|
|
20
|
-
_isWeb = true;
|
|
21
|
-
}
|
|
22
|
-
else if (typeof process === 'object') {
|
|
23
|
-
_userAgent = `nodejs(${process.versions.node})`;
|
|
24
|
-
if (process.versions.electron) {
|
|
25
|
-
_userAgent += ` electron(${process.versions.electron})`;
|
|
26
|
-
if (exports.isElectronRenderer) {
|
|
27
|
-
_userAgent += ' ' + navigator.userAgent;
|
|
3
|
+
exports.is32Bit = exports.sepList = exports.is64Bit = exports.isWeb = exports.isNative = exports.isLinux = exports.isMacintosh = exports.isWindows = exports.isElectronMain = exports.isElectronRenderer = exports.isElectronSandbox = exports.isElectron = exports.hasGlobal = exports.hasWindow = exports.hasProcess = void 0;
|
|
4
|
+
exports.hasProcess = typeof process !== 'undefined' && typeof process.pid === 'number';
|
|
5
|
+
exports.hasWindow = typeof window !== 'undefined' && globalThis === window;
|
|
6
|
+
exports.hasGlobal = typeof global !== 'undefined' && globalThis === global;
|
|
7
|
+
exports.isElectron = false, exports.isElectronSandbox = false, exports.isElectronRenderer = false, exports.isElectronMain = false;
|
|
8
|
+
if (exports.hasProcess) {
|
|
9
|
+
if (typeof process.versions?.electron !== 'undefined') {
|
|
10
|
+
exports.isElectron = true;
|
|
11
|
+
if (process.type === 'renderer') {
|
|
12
|
+
exports.isElectronRenderer = true;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
exports.isElectronMain = true;
|
|
28
16
|
}
|
|
29
17
|
}
|
|
30
|
-
_isWindows = process.platform === 'win32';
|
|
31
|
-
_isMacintosh = process.platform === 'darwin';
|
|
32
|
-
_isLinux = process.platform === 'linux';
|
|
33
|
-
_isNative = true;
|
|
34
18
|
}
|
|
35
|
-
else {
|
|
36
|
-
|
|
19
|
+
else if (exports.hasWindow) {
|
|
20
|
+
if (window.navigator.userAgent.includes(' Electron/')) {
|
|
21
|
+
exports.isElectron = true;
|
|
22
|
+
exports.isElectronRenderer = true;
|
|
23
|
+
exports.isElectronSandbox = true;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.isWindows = false;
|
|
27
|
+
exports.isMacintosh = false;
|
|
28
|
+
exports.isLinux = false;
|
|
29
|
+
exports.isNative = false;
|
|
30
|
+
exports.isWeb = false;
|
|
31
|
+
exports.is64Bit = false;
|
|
32
|
+
if (exports.hasWindow && !exports.hasProcess) {
|
|
33
|
+
const userAgent = navigator.userAgent;
|
|
34
|
+
exports.isWindows = userAgent.includes('Windows NT');
|
|
35
|
+
exports.isMacintosh = userAgent.includes('Macintosh');
|
|
36
|
+
exports.isLinux = userAgent.includes('Linux');
|
|
37
|
+
exports.isWeb = true;
|
|
38
|
+
exports.is64Bit = userAgent.includes('x64');
|
|
39
|
+
}
|
|
40
|
+
else if (exports.hasProcess) {
|
|
41
|
+
exports.isNative = true;
|
|
42
|
+
exports.is64Bit = process.arch === 'x64';
|
|
43
|
+
if (process.platform === 'linux') {
|
|
44
|
+
exports.isLinux = true;
|
|
45
|
+
}
|
|
46
|
+
else if (process.platform === 'darwin') {
|
|
47
|
+
exports.isMacintosh = true;
|
|
48
|
+
}
|
|
49
|
+
else if (process.platform === 'win32') {
|
|
50
|
+
exports.isWindows = true;
|
|
51
|
+
}
|
|
37
52
|
}
|
|
38
|
-
exports.isWindows = _isWindows;
|
|
39
|
-
exports.isMacintosh = _isMacintosh;
|
|
40
|
-
exports.isLinux = _isLinux;
|
|
41
|
-
exports.isNative = _isNative;
|
|
42
|
-
exports.isWeb = _isWeb;
|
|
43
|
-
exports.userAgent = _userAgent;
|
|
44
53
|
exports.sepList = exports.isWindows ? ';' : ':';
|
|
54
|
+
exports.is32Bit = !exports.is64Bit;
|
|
45
55
|
//# sourceMappingURL=os.cjs.map
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
"../../../src/platform/os.ts"
|
|
7
7
|
],
|
|
8
8
|
"names": [],
|
|
9
|
-
"mappings": ";;;
|
|
9
|
+
"mappings": ";;;AAKa,QAAA,UAAU,GAAG,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,CAAC;AAC/E,QAAA,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,UAAU,KAAK,MAAM,CAAC;AACnE,QAAA,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,UAAU,KAAK,MAAM,CAAC;AAErE,QAAA,UAAU,GAAG,KAAK,EAC5B,QAAA,iBAAiB,GAAG,KAAK,EACzB,QAAA,kBAAkB,GAAG,KAAK,EAC1B,QAAA,cAAc,GAAG,KAAK,CAAC;AACxB,IAAI,kBAAU,EAAE;IACf,IAAI,OAAO,OAAO,CAAC,QAAQ,EAAE,QAAQ,KAAK,WAAW,EAAE;QACtD,kBAAU,GAAG,IAAI,CAAC;QAClB,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE;YAChC,0BAAkB,GAAG,IAAI,CAAC;SAC1B;aAAM;YACN,sBAAc,GAAG,IAAI,CAAC;SACtB;KACD;CACD;KAAM,IAAI,iBAAS,EAAE;IACrB,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;QACtD,kBAAU,GAAG,IAAI,CAAC;QAClB,0BAAkB,GAAG,IAAI,CAAC;QAC1B,yBAAiB,GAAG,IAAI,CAAC;KACzB;CACD;AAEU,QAAA,SAAS,GAAG,KAAK,CAAC;AAClB,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,OAAO,GAAG,KAAK,CAAC;AAChB,QAAA,QAAQ,GAAG,KAAK,CAAC;AACjB,QAAA,KAAK,GAAG,KAAK,CAAC;AACd,QAAA,OAAO,GAAG,KAAK,CAAC;AAE3B,IAAI,iBAAS,IAAI,CAAC,kBAAU,EAAE;IAC7B,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;IACtC,iBAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC7C,mBAAW,GAAG,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9C,eAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACtC,aAAK,GAAG,IAAI,CAAC;IACb,eAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;CACpC;KAAM,IAAI,kBAAU,EAAE;IACtB,gBAAQ,GAAG,IAAI,CAAC;IAChB,eAAO,GAAG,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC;IACjC,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QACjC,eAAO,GAAG,IAAI,CAAC;KACf;SAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE;QACzC,mBAAW,GAAG,IAAI,CAAC;KACnB;SAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QACxC,iBAAS,GAAG,IAAI,CAAC;KACjB;CACD;AAEY,QAAA,OAAO,GAAG,iBAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AAChC,QAAA,OAAO,GAAG,CAAC,eAAO,CAAC"
|
|
10
10
|
}
|
|
@@ -521,6 +521,12 @@ export declare function globalSingletonStrong<T>(symbol: symbol | string, constr
|
|
|
521
521
|
*/
|
|
522
522
|
export declare function globalSingletonStrong<T>(symbol: symbol | string): T | undefined;
|
|
523
523
|
|
|
524
|
+
export declare const hasGlobal: boolean;
|
|
525
|
+
|
|
526
|
+
export declare const hasProcess: boolean;
|
|
527
|
+
|
|
528
|
+
export declare const hasWindow: boolean;
|
|
529
|
+
|
|
524
530
|
export declare function hookClass<TC extends IConstructorOf<T>, T>(target: TC): IHooks<T, TC>;
|
|
525
531
|
|
|
526
532
|
export declare const hookClassSymbol: unique symbol;
|
|
@@ -721,6 +727,10 @@ export declare interface IProgressHolder<T, PT> {
|
|
|
721
727
|
progress(fn: ProgressCallback<PT>): Promise<T> & IProgressHolder<T, PT>;
|
|
722
728
|
}
|
|
723
729
|
|
|
730
|
+
export declare const is32Bit: boolean;
|
|
731
|
+
|
|
732
|
+
export declare let is64Bit: boolean;
|
|
733
|
+
|
|
724
734
|
/**
|
|
725
735
|
* return true if a path is absolute:
|
|
726
736
|
* - /xxxx
|
|
@@ -747,17 +757,19 @@ export declare function isDateInvalid(date: Date): boolean;
|
|
|
747
757
|
|
|
748
758
|
export declare function isDisposedError(error: any): boolean;
|
|
749
759
|
|
|
750
|
-
export declare
|
|
760
|
+
export declare let isElectron: boolean;
|
|
761
|
+
|
|
762
|
+
export declare let isElectronMain: boolean;
|
|
751
763
|
|
|
752
|
-
export declare
|
|
764
|
+
export declare let isElectronRenderer: boolean;
|
|
753
765
|
|
|
754
|
-
export declare
|
|
766
|
+
export declare let isElectronSandbox: boolean;
|
|
755
767
|
|
|
756
|
-
export declare
|
|
768
|
+
export declare let isLinux: boolean;
|
|
757
769
|
|
|
758
|
-
export declare
|
|
770
|
+
export declare let isMacintosh: boolean;
|
|
759
771
|
|
|
760
|
-
export declare
|
|
772
|
+
export declare let isNative: boolean;
|
|
761
773
|
|
|
762
774
|
/**
|
|
763
775
|
* Should ensure a and b is none-null before call this
|
|
@@ -778,9 +790,9 @@ export declare function isSerializable(value: any): SerializableKind;
|
|
|
778
790
|
/** @public */
|
|
779
791
|
export declare function isTimeoutError(error: Error): error is TimeoutError;
|
|
780
792
|
|
|
781
|
-
export declare
|
|
793
|
+
export declare let isWeb: boolean;
|
|
782
794
|
|
|
783
|
-
export declare
|
|
795
|
+
export declare let isWindows: boolean;
|
|
784
796
|
|
|
785
797
|
export declare interface IUniqueIdFactory<T> {
|
|
786
798
|
(item: T): string;
|
|
@@ -908,22 +920,45 @@ export declare const oneWeek = 604800000;
|
|
|
908
920
|
*/
|
|
909
921
|
export declare function pad2(s: number): string;
|
|
910
922
|
|
|
923
|
+
export declare const PathArray: typeof PathArrayAbstract;
|
|
924
|
+
|
|
911
925
|
/**
|
|
912
|
-
* Work on "PATH"-like values
|
|
926
|
+
* Work on "PATH"-like values, but always use / insteadof \
|
|
913
927
|
*/
|
|
914
|
-
|
|
928
|
+
declare abstract class PathArrayAbstract extends Set<string> {
|
|
915
929
|
private readonly sep;
|
|
916
|
-
constructor(init: string, sep
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
has(path: string): boolean;
|
|
930
|
+
constructor(init: string, sep?: ':' | ';');
|
|
931
|
+
abstract normalize(path: string): string;
|
|
932
|
+
split(pathArrStr: string): string[];
|
|
920
933
|
toString(): string;
|
|
934
|
+
/** @deprecated @use values() */
|
|
935
|
+
keys(): IterableIterator<string>;
|
|
936
|
+
/** @deprecated @use values() */
|
|
937
|
+
entries(): IterableIterator<[string, string]>;
|
|
938
|
+
[Symbol.iterator](): IterableIterator<string>;
|
|
921
939
|
/**
|
|
922
940
|
* @returns an array with `part` append to every element
|
|
923
941
|
*/
|
|
924
942
|
join(part: string): string[];
|
|
925
943
|
}
|
|
926
944
|
|
|
945
|
+
export declare class PathArrayPosix extends PathArrayAbstract {
|
|
946
|
+
normalize(path: string): string;
|
|
947
|
+
add(paths: string): this;
|
|
948
|
+
delete(paths: string): boolean;
|
|
949
|
+
has(path: string): boolean;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
export declare class PathArrayWindows extends PathArrayAbstract {
|
|
953
|
+
private readonly caseMap;
|
|
954
|
+
normalize(path: string): string;
|
|
955
|
+
clear(): void;
|
|
956
|
+
add(paths: string): this;
|
|
957
|
+
delete(paths: string): boolean;
|
|
958
|
+
has(path: string): boolean;
|
|
959
|
+
values(): IterableIterator<string>;
|
|
960
|
+
}
|
|
961
|
+
|
|
927
962
|
declare type Person = StructString<{
|
|
928
963
|
name: string;
|
|
929
964
|
email: string;
|
|
@@ -1073,8 +1108,6 @@ export declare function unsubscribableToDisposable(subscription: Unsubscribable)
|
|
|
1073
1108
|
dispose: () => void;
|
|
1074
1109
|
};
|
|
1075
1110
|
|
|
1076
|
-
export declare const userAgent: string;
|
|
1077
|
-
|
|
1078
1111
|
export declare type ValueCallback<T = any> = (value: T | Promise<T>) => void;
|
|
1079
1112
|
|
|
1080
1113
|
export declare abstract class WrappedConsole {
|
|
@@ -126,7 +126,11 @@ export { sleep } from "./lifecycle/timeout/timeout.mjs";
|
|
|
126
126
|
export { timeoutPromise } from "./lifecycle/timeout/timeout.mjs";
|
|
127
127
|
/* platform/os.ts */
|
|
128
128
|
// Identifiers
|
|
129
|
+
export { hasProcess } from "./platform/os.mjs";
|
|
130
|
+
export { hasWindow } from "./platform/os.mjs";
|
|
131
|
+
export { hasGlobal } from "./platform/os.mjs";
|
|
129
132
|
export { isElectron } from "./platform/os.mjs";
|
|
133
|
+
export { isElectronSandbox } from "./platform/os.mjs";
|
|
130
134
|
export { isElectronRenderer } from "./platform/os.mjs";
|
|
131
135
|
export { isElectronMain } from "./platform/os.mjs";
|
|
132
136
|
export { isWindows } from "./platform/os.mjs";
|
|
@@ -134,8 +138,9 @@ export { isMacintosh } from "./platform/os.mjs";
|
|
|
134
138
|
export { isLinux } from "./platform/os.mjs";
|
|
135
139
|
export { isNative } from "./platform/os.mjs";
|
|
136
140
|
export { isWeb } from "./platform/os.mjs";
|
|
137
|
-
export {
|
|
141
|
+
export { is64Bit } from "./platform/os.mjs";
|
|
138
142
|
export { sepList } from "./platform/os.mjs";
|
|
143
|
+
export { is32Bit } from "./platform/os.mjs";
|
|
139
144
|
/* log/logger.ts */
|
|
140
145
|
// Identifiers
|
|
141
146
|
export { ColorKind } from "./log/logger.mjs";
|
|
@@ -164,8 +169,17 @@ export { isAbsolute } from "./path/isAbsolute.mjs";
|
|
|
164
169
|
/* path/normalizePath.ts */
|
|
165
170
|
// Identifiers
|
|
166
171
|
export { normalizePath } from "./path/normalizePath.mjs";
|
|
172
|
+
/* string/castCase.ts */
|
|
173
|
+
// Identifiers
|
|
174
|
+
export { camelCase } from "./string/castCase.mjs";
|
|
175
|
+
export { ucfirst } from "./string/castCase.mjs";
|
|
176
|
+
export { lcfirst } from "./string/castCase.mjs";
|
|
177
|
+
export { linux_case } from "./string/castCase.mjs";
|
|
178
|
+
export { linux_case_hyphen } from "./string/castCase.mjs";
|
|
167
179
|
/* path/pathArray.ts */
|
|
168
180
|
// Identifiers
|
|
181
|
+
export { PathArrayWindows } from "./path/pathArray.mjs";
|
|
182
|
+
export { PathArrayPosix } from "./path/pathArray.mjs";
|
|
169
183
|
export { PathArray } from "./path/pathArray.mjs";
|
|
170
184
|
/* promise/awaitIterator.ts */
|
|
171
185
|
// Identifiers
|
|
@@ -199,13 +213,6 @@ export { init } from "./reflection/methods/initOnRead.mjs";
|
|
|
199
213
|
// Identifiers
|
|
200
214
|
export { memorizeValueSymbol } from "./reflection/methods/memorize.mjs";
|
|
201
215
|
export { memo } from "./reflection/methods/memorize.mjs";
|
|
202
|
-
/* string/castCase.ts */
|
|
203
|
-
// Identifiers
|
|
204
|
-
export { camelCase } from "./string/castCase.mjs";
|
|
205
|
-
export { ucfirst } from "./string/castCase.mjs";
|
|
206
|
-
export { lcfirst } from "./string/castCase.mjs";
|
|
207
|
-
export { linux_case } from "./string/castCase.mjs";
|
|
208
|
-
export { linux_case_hyphen } from "./string/castCase.mjs";
|
|
209
216
|
/* string/concatType.generated.ts */
|
|
210
217
|
// Identifiers
|
|
211
218
|
export { concatStringType } from "./string/concatType.generated.mjs";
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
"../../src/__create_index.generated.ts"
|
|
7
7
|
],
|
|
8
8
|
"names": [],
|
|
9
|
-
"mappings": "A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AC,gBAAgB,EAAC,0CAAyC;AACnE,4BAA4B;AAC3B,cAAc;AACd,OAAO,EAAC,YAAY,EAAC,kCAAiC;AACvD,0BAA0B;AACzB,cAAc;AACd,OAAO,EAAC,WAAW,EAAC,gCAA+B;AACnD,OAAO,EAAC,SAAS,EAAC,gCAA+B;AACjD,OAAO,EAAC,UAAU,EAAC,gCAA+B"
|
|
10
10
|
}
|
|
@@ -1,41 +1,101 @@
|
|
|
1
|
+
import { isWindows } from "../platform/os.mjs";
|
|
2
|
+
import { ucfirst } from "../string/castCase.mjs";
|
|
1
3
|
import { normalizePath } from "./normalizePath.mjs";
|
|
4
|
+
const isAbsolute = /^[a-z]:[/\\]/i;
|
|
2
5
|
/**
|
|
3
|
-
* Work on "PATH"-like values
|
|
6
|
+
* Work on "PATH"-like values, but always use / insteadof \
|
|
4
7
|
*/
|
|
5
|
-
|
|
8
|
+
class PathArrayAbstract extends Set {
|
|
6
9
|
sep;
|
|
7
|
-
constructor(init, sep) {
|
|
10
|
+
constructor(init, sep = isWindows ? ';' : ':') {
|
|
8
11
|
super();
|
|
9
12
|
this.sep = sep;
|
|
10
13
|
if (init)
|
|
11
14
|
this.add(init);
|
|
12
15
|
}
|
|
16
|
+
split(pathArrStr) {
|
|
17
|
+
return pathArrStr.split(this.sep);
|
|
18
|
+
}
|
|
19
|
+
toString() {
|
|
20
|
+
return [...this.values()].join(this.sep);
|
|
21
|
+
}
|
|
22
|
+
/** @deprecated @use values() */
|
|
23
|
+
keys() {
|
|
24
|
+
throw new Error('not impl');
|
|
25
|
+
}
|
|
26
|
+
/** @deprecated @use values() */
|
|
27
|
+
entries() {
|
|
28
|
+
throw new Error('not impl');
|
|
29
|
+
}
|
|
30
|
+
[Symbol.iterator]() {
|
|
31
|
+
return this.values();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @returns an array with `part` append to every element
|
|
35
|
+
*/
|
|
36
|
+
join(part) {
|
|
37
|
+
return [...this.values()].map((p) => normalizePath(p + '/' + part));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export class PathArrayWindows extends PathArrayAbstract {
|
|
41
|
+
caseMap = new Map();
|
|
42
|
+
normalize(path) {
|
|
43
|
+
path = normalizePath(path);
|
|
44
|
+
if (isAbsolute.test(path)) {
|
|
45
|
+
path = ucfirst(path);
|
|
46
|
+
}
|
|
47
|
+
return path;
|
|
48
|
+
}
|
|
49
|
+
clear() {
|
|
50
|
+
super.clear();
|
|
51
|
+
this.caseMap.clear();
|
|
52
|
+
}
|
|
13
53
|
add(paths) {
|
|
14
|
-
for (const p of
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
54
|
+
for (const p of this.split(paths)) {
|
|
55
|
+
const rpath = this.normalize(p);
|
|
56
|
+
const lcase = rpath.toLowerCase();
|
|
57
|
+
this.caseMap.set(lcase, rpath);
|
|
58
|
+
super.add(lcase);
|
|
18
59
|
}
|
|
19
60
|
return this;
|
|
20
61
|
}
|
|
21
62
|
delete(paths) {
|
|
22
63
|
let anyRet = false;
|
|
23
|
-
for (const p of
|
|
24
|
-
|
|
64
|
+
for (const p of this.split(paths)) {
|
|
65
|
+
const rpath = this.normalize(p);
|
|
66
|
+
const lcase = rpath.toLowerCase();
|
|
67
|
+
this.caseMap.delete(lcase);
|
|
68
|
+
anyRet = anyRet || super.delete(lcase);
|
|
25
69
|
}
|
|
26
70
|
return anyRet;
|
|
27
71
|
}
|
|
28
72
|
has(path) {
|
|
29
|
-
return super.has(
|
|
73
|
+
return super.has(this.normalize(path).toLowerCase());
|
|
30
74
|
}
|
|
31
|
-
|
|
32
|
-
return
|
|
75
|
+
values() {
|
|
76
|
+
return this.caseMap.values();
|
|
33
77
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
78
|
+
}
|
|
79
|
+
export class PathArrayPosix extends PathArrayAbstract {
|
|
80
|
+
normalize(path) {
|
|
81
|
+
return normalizePath(path);
|
|
82
|
+
}
|
|
83
|
+
add(paths) {
|
|
84
|
+
for (const p of this.split(paths)) {
|
|
85
|
+
super.add(this.normalize(p));
|
|
86
|
+
}
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
89
|
+
delete(paths) {
|
|
90
|
+
let anyRet = false;
|
|
91
|
+
for (const p of this.split(paths)) {
|
|
92
|
+
anyRet = anyRet || super.delete(this.normalize(p));
|
|
93
|
+
}
|
|
94
|
+
return anyRet;
|
|
95
|
+
}
|
|
96
|
+
has(path) {
|
|
97
|
+
return super.has(this.normalize(path));
|
|
39
98
|
}
|
|
40
99
|
}
|
|
100
|
+
export const PathArray = isWindows ? PathArrayWindows : PathArrayPosix;
|
|
41
101
|
//# sourceMappingURL=pathArray.mjs.map
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
"../../../src/path/pathArray.ts"
|
|
7
7
|
],
|
|
8
8
|
"names": [],
|
|
9
|
-
"mappings": "AAAA,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAEhD;;GAEG;AACH,
|
|
9
|
+
"mappings": "AAAA,OAAO,EAAE,SAAS,EAAE,2BAAuB;AAC3C,OAAO,EAAE,OAAO,EAAE,+BAA2B;AAC7C,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAEhD,MAAM,UAAU,GAAG,eAAe,CAAC;AAEnC;;GAEG;AACH,MAAe,iBAAkB,SAAQ,GAAW;IAGjC;IAFlB,YACC,IAAY,EACK,MAAiB,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;QAEvD,KAAK,EAAE,CAAC;QAFS,QAAG,GAAH,GAAG,CAAmC;QAGvD,IAAI,IAAI;YAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAID,KAAK,CAAC,UAAkB;QACvB,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAEQ,QAAQ;QAChB,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAA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M,GAAG,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;SACnD;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IAEQ,GAAG,CAAC,IAAY;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,CAAC;CACD;AAED,MAAM,CAAC,MAAM,SAAS,GAA6B,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,CAAC"
|
|
10
10
|
}
|
package/lib/esm/platform/os.mjs
CHANGED
|
@@ -1,42 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
let
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
_userAgent = navigator.userAgent;
|
|
14
|
-
_isWindows = _userAgent.indexOf('Windows') >= 0;
|
|
15
|
-
_isMacintosh = _userAgent.indexOf('Macintosh') >= 0;
|
|
16
|
-
_isLinux = _userAgent.indexOf('Linux') >= 0;
|
|
17
|
-
_isWeb = true;
|
|
18
|
-
}
|
|
19
|
-
else if (typeof process === 'object') {
|
|
20
|
-
_userAgent = `nodejs(${process.versions.node})`;
|
|
21
|
-
if (process.versions.electron) {
|
|
22
|
-
_userAgent += ` electron(${process.versions.electron})`;
|
|
23
|
-
if (isElectronRenderer) {
|
|
24
|
-
_userAgent += ' ' + navigator.userAgent;
|
|
1
|
+
export const hasProcess = typeof process !== 'undefined' && typeof process.pid === 'number';
|
|
2
|
+
export const hasWindow = typeof window !== 'undefined' && globalThis === window;
|
|
3
|
+
export const hasGlobal = typeof global !== 'undefined' && globalThis === global;
|
|
4
|
+
export let isElectron = false, isElectronSandbox = false, isElectronRenderer = false, isElectronMain = false;
|
|
5
|
+
if (hasProcess) {
|
|
6
|
+
if (typeof process.versions?.electron !== 'undefined') {
|
|
7
|
+
isElectron = true;
|
|
8
|
+
if (process.type === 'renderer') {
|
|
9
|
+
isElectronRenderer = true;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
isElectronMain = true;
|
|
25
13
|
}
|
|
26
14
|
}
|
|
27
|
-
_isWindows = process.platform === 'win32';
|
|
28
|
-
_isMacintosh = process.platform === 'darwin';
|
|
29
|
-
_isLinux = process.platform === 'linux';
|
|
30
|
-
_isNative = true;
|
|
31
15
|
}
|
|
32
|
-
else {
|
|
33
|
-
|
|
16
|
+
else if (hasWindow) {
|
|
17
|
+
if (window.navigator.userAgent.includes(' Electron/')) {
|
|
18
|
+
isElectron = true;
|
|
19
|
+
isElectronRenderer = true;
|
|
20
|
+
isElectronSandbox = true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export let isWindows = false;
|
|
24
|
+
export let isMacintosh = false;
|
|
25
|
+
export let isLinux = false;
|
|
26
|
+
export let isNative = false;
|
|
27
|
+
export let isWeb = false;
|
|
28
|
+
export let is64Bit = false;
|
|
29
|
+
if (hasWindow && !hasProcess) {
|
|
30
|
+
const userAgent = navigator.userAgent;
|
|
31
|
+
isWindows = userAgent.includes('Windows NT');
|
|
32
|
+
isMacintosh = userAgent.includes('Macintosh');
|
|
33
|
+
isLinux = userAgent.includes('Linux');
|
|
34
|
+
isWeb = true;
|
|
35
|
+
is64Bit = userAgent.includes('x64');
|
|
36
|
+
}
|
|
37
|
+
else if (hasProcess) {
|
|
38
|
+
isNative = true;
|
|
39
|
+
is64Bit = process.arch === 'x64';
|
|
40
|
+
if (process.platform === 'linux') {
|
|
41
|
+
isLinux = true;
|
|
42
|
+
}
|
|
43
|
+
else if (process.platform === 'darwin') {
|
|
44
|
+
isMacintosh = true;
|
|
45
|
+
}
|
|
46
|
+
else if (process.platform === 'win32') {
|
|
47
|
+
isWindows = true;
|
|
48
|
+
}
|
|
34
49
|
}
|
|
35
|
-
export const isWindows = _isWindows;
|
|
36
|
-
export const isMacintosh = _isMacintosh;
|
|
37
|
-
export const isLinux = _isLinux;
|
|
38
|
-
export const isNative = _isNative;
|
|
39
|
-
export const isWeb = _isWeb;
|
|
40
|
-
export const userAgent = _userAgent;
|
|
41
50
|
export const sepList = isWindows ? ';' : ':';
|
|
51
|
+
export const is32Bit = !is64Bit;
|
|
42
52
|
//# sourceMappingURL=os.mjs.map
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
"../../../src/platform/os.ts"
|
|
7
7
|
],
|
|
8
8
|
"names": [],
|
|
9
|
-
"mappings": "
|
|
9
|
+
"mappings": "AAKA,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,CAAC;AAC5F,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,UAAU,KAAK,MAAM,CAAC;AAChF,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,UAAU,KAAK,MAAM,CAAC;AAEhF,MAAM,CAAC,IAAI,UAAU,GAAG,KAAK,EAC5B,iBAAiB,GAAG,KAAK,EACzB,kBAAkB,GAAG,KAAK,EAC1B,cAAc,GAAG,KAAK,CAAC;AACxB,IAAI,UAAU,EAAE;IACf,IAAI,OAAO,OAAO,CAAC,QAAQ,EAAE,QAAQ,KAAK,WAAW,EAAE;QACtD,UAAU,GAAG,IAAI,CAAC;QAClB,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE;YAChC,kBAAkB,GAAG,IAAI,CAAC;SAC1B;aAAM;YACN,cAAc,GAAG,IAAI,CAAC;SACtB;KACD;CACD;KAAM,IAAI,SAAS,EAAE;IACrB,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;QACtD,UAAU,GAAG,IAAI,CAAC;QAClB,kBAAkB,GAAG,IAAI,CAAC;QAC1B,iBA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10
|
}
|
package/package.json
CHANGED
package/src/path/pathArray.ts
CHANGED
|
@@ -1,42 +1,121 @@
|
|
|
1
|
+
import { isWindows } from '../platform/os';
|
|
2
|
+
import { ucfirst } from '../string/castCase';
|
|
1
3
|
import { normalizePath } from './normalizePath';
|
|
2
4
|
|
|
5
|
+
const isAbsolute = /^[a-z]:[/\\]/i;
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
|
-
* Work on "PATH"-like values
|
|
8
|
+
* Work on "PATH"-like values, but always use / insteadof \
|
|
5
9
|
*/
|
|
6
|
-
|
|
7
|
-
constructor(
|
|
10
|
+
abstract class PathArrayAbstract extends Set<string> {
|
|
11
|
+
constructor(
|
|
12
|
+
init: string,
|
|
13
|
+
private readonly sep: ':' | ';' = isWindows ? ';' : ':'
|
|
14
|
+
) {
|
|
8
15
|
super();
|
|
9
16
|
if (init) this.add(init);
|
|
10
17
|
}
|
|
11
18
|
|
|
19
|
+
abstract normalize(path: string): string;
|
|
20
|
+
|
|
21
|
+
split(pathArrStr: string) {
|
|
22
|
+
return pathArrStr.split(this.sep);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override toString() {
|
|
26
|
+
return [...this.values()].join(this.sep);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** @deprecated @use values() */
|
|
30
|
+
override keys(): IterableIterator<string> {
|
|
31
|
+
throw new Error('not impl');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** @deprecated @use values() */
|
|
35
|
+
override entries(): IterableIterator<[string, string]> {
|
|
36
|
+
throw new Error('not impl');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[Symbol.iterator]() {
|
|
40
|
+
return this.values();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @returns an array with `part` append to every element
|
|
45
|
+
*/
|
|
46
|
+
join(part: string) {
|
|
47
|
+
return [...this.values()].map((p) => normalizePath(p + '/' + part));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export class PathArrayWindows extends PathArrayAbstract {
|
|
52
|
+
private readonly caseMap = new Map<string, string>();
|
|
53
|
+
|
|
54
|
+
normalize(path: string) {
|
|
55
|
+
path = normalizePath(path);
|
|
56
|
+
if (isAbsolute.test(path)) {
|
|
57
|
+
path = ucfirst(path);
|
|
58
|
+
}
|
|
59
|
+
return path;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
override clear(): void {
|
|
63
|
+
super.clear();
|
|
64
|
+
this.caseMap.clear();
|
|
65
|
+
}
|
|
66
|
+
|
|
12
67
|
override add(paths: string) {
|
|
13
|
-
for (const p of
|
|
14
|
-
|
|
15
|
-
|
|
68
|
+
for (const p of this.split(paths)) {
|
|
69
|
+
const rpath = this.normalize(p);
|
|
70
|
+
const lcase = rpath.toLowerCase();
|
|
71
|
+
this.caseMap.set(lcase, rpath);
|
|
72
|
+
super.add(lcase);
|
|
16
73
|
}
|
|
17
74
|
return this;
|
|
18
75
|
}
|
|
19
76
|
|
|
20
77
|
override delete(paths: string) {
|
|
21
78
|
let anyRet = false;
|
|
22
|
-
for (const p of
|
|
23
|
-
|
|
79
|
+
for (const p of this.split(paths)) {
|
|
80
|
+
const rpath = this.normalize(p);
|
|
81
|
+
const lcase = rpath.toLowerCase();
|
|
82
|
+
this.caseMap.delete(lcase);
|
|
83
|
+
anyRet = anyRet || super.delete(lcase);
|
|
24
84
|
}
|
|
25
85
|
return anyRet;
|
|
26
86
|
}
|
|
27
87
|
|
|
28
88
|
override has(path: string): boolean {
|
|
29
|
-
return super.has(
|
|
89
|
+
return super.has(this.normalize(path).toLowerCase());
|
|
30
90
|
}
|
|
31
91
|
|
|
32
|
-
override
|
|
33
|
-
return
|
|
92
|
+
override values() {
|
|
93
|
+
return this.caseMap.values();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export class PathArrayPosix extends PathArrayAbstract {
|
|
97
|
+
normalize(path: string) {
|
|
98
|
+
return normalizePath(path);
|
|
34
99
|
}
|
|
35
100
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return
|
|
101
|
+
override add(paths: string) {
|
|
102
|
+
for (const p of this.split(paths)) {
|
|
103
|
+
super.add(this.normalize(p));
|
|
104
|
+
}
|
|
105
|
+
return this;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
override delete(paths: string) {
|
|
109
|
+
let anyRet = false;
|
|
110
|
+
for (const p of this.split(paths)) {
|
|
111
|
+
anyRet = anyRet || super.delete(this.normalize(p));
|
|
112
|
+
}
|
|
113
|
+
return anyRet;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
override has(path: string): boolean {
|
|
117
|
+
return super.has(this.normalize(path));
|
|
41
118
|
}
|
|
42
119
|
}
|
|
120
|
+
|
|
121
|
+
export const PathArray: typeof PathArrayAbstract = isWindows ? PathArrayWindows : PathArrayPosix;
|
package/src/platform/os.ts
CHANGED
|
@@ -1,46 +1,58 @@
|
|
|
1
1
|
declare const process: any;
|
|
2
2
|
declare const navigator: any;
|
|
3
|
+
declare const window: any;
|
|
4
|
+
declare const global: any;
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let _isNative = false;
|
|
8
|
-
let _isWeb = false;
|
|
9
|
-
let _userAgent: string;
|
|
6
|
+
export const hasProcess = typeof process !== 'undefined' && typeof process.pid === 'number';
|
|
7
|
+
export const hasWindow = typeof window !== 'undefined' && globalThis === window;
|
|
8
|
+
export const hasGlobal = typeof global !== 'undefined' && globalThis === global;
|
|
10
9
|
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_isLinux = _userAgent.indexOf('Linux') >= 0;
|
|
23
|
-
_isWeb = true;
|
|
24
|
-
} else if (typeof process === 'object') {
|
|
25
|
-
_userAgent = `nodejs(${process.versions.node})`;
|
|
26
|
-
if (process.versions.electron) {
|
|
27
|
-
_userAgent += ` electron(${process.versions.electron})`;
|
|
28
|
-
if (isElectronRenderer) {
|
|
29
|
-
_userAgent += ' ' + navigator.userAgent;
|
|
10
|
+
export let isElectron = false,
|
|
11
|
+
isElectronSandbox = false,
|
|
12
|
+
isElectronRenderer = false,
|
|
13
|
+
isElectronMain = false;
|
|
14
|
+
if (hasProcess) {
|
|
15
|
+
if (typeof process.versions?.electron !== 'undefined') {
|
|
16
|
+
isElectron = true;
|
|
17
|
+
if (process.type === 'renderer') {
|
|
18
|
+
isElectronRenderer = true;
|
|
19
|
+
} else {
|
|
20
|
+
isElectronMain = true;
|
|
30
21
|
}
|
|
31
22
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
} else if (hasWindow) {
|
|
24
|
+
if (window.navigator.userAgent.includes(' Electron/')) {
|
|
25
|
+
isElectron = true;
|
|
26
|
+
isElectronRenderer = true;
|
|
27
|
+
isElectronSandbox = true;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export let isWindows = false;
|
|
32
|
+
export let isMacintosh = false;
|
|
33
|
+
export let isLinux = false;
|
|
34
|
+
export let isNative = false;
|
|
35
|
+
export let isWeb = false;
|
|
36
|
+
export let is64Bit = false;
|
|
37
|
+
|
|
38
|
+
if (hasWindow && !hasProcess) {
|
|
39
|
+
const userAgent = navigator.userAgent;
|
|
40
|
+
isWindows = userAgent.includes('Windows NT');
|
|
41
|
+
isMacintosh = userAgent.includes('Macintosh');
|
|
42
|
+
isLinux = userAgent.includes('Linux');
|
|
43
|
+
isWeb = true;
|
|
44
|
+
is64Bit = userAgent.includes('x64');
|
|
45
|
+
} else if (hasProcess) {
|
|
46
|
+
isNative = true;
|
|
47
|
+
is64Bit = process.arch === 'x64';
|
|
48
|
+
if (process.platform === 'linux') {
|
|
49
|
+
isLinux = true;
|
|
50
|
+
} else if (process.platform === 'darwin') {
|
|
51
|
+
isMacintosh = true;
|
|
52
|
+
} else if (process.platform === 'win32') {
|
|
53
|
+
isWindows = true;
|
|
54
|
+
}
|
|
38
55
|
}
|
|
39
56
|
|
|
40
|
-
export const isWindows = _isWindows;
|
|
41
|
-
export const isMacintosh = _isMacintosh;
|
|
42
|
-
export const isLinux = _isLinux;
|
|
43
|
-
export const isNative = _isNative;
|
|
44
|
-
export const isWeb = _isWeb;
|
|
45
|
-
export const userAgent = _userAgent;
|
|
46
57
|
export const sepList = isWindows ? ';' : ':';
|
|
58
|
+
export const is32Bit = !is64Bit;
|