@alterior/common 3.13.3 → 3.13.4
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/base64.d.ts +6 -6
- package/dist/base64.js +52 -52
- package/dist/base64.js.map +1 -1
- package/dist/base64.test.d.ts +1 -1
- package/dist/cache.d.ts +84 -84
- package/dist/cache.js +148 -148
- package/dist/cache.js.map +1 -1
- package/dist/cache.test.d.ts +1 -1
- package/dist/check-native-async.d.ts +1 -1
- package/dist/check-native-async.js +27 -28
- package/dist/check-native-async.js.map +1 -1
- package/dist/clone.d.ts +23 -23
- package/dist/clone.js +59 -60
- package/dist/clone.js.map +1 -1
- package/dist/clone.test.d.ts +1 -1
- package/dist/coalesce.d.ts +5 -5
- package/dist/coalesce.js +15 -16
- package/dist/coalesce.js.map +1 -1
- package/dist/coalesce.test.d.ts +1 -1
- package/dist/colors.d.ts +62 -62
- package/dist/colors.js +66 -66
- package/dist/console.d.ts +31 -31
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +65 -86
- package/dist/console.js.map +1 -1
- package/dist/constructor.d.ts +6 -6
- package/dist/constructor.js +2 -2
- package/dist/decorators.d.ts +1 -1
- package/dist/decorators.d.ts.map +1 -1
- package/dist/decorators.js +6 -7
- package/dist/decorators.js.map +1 -1
- package/dist/environment.d.ts +11 -11
- package/dist/environment.d.ts.map +1 -1
- package/dist/environment.js +27 -27
- package/dist/environment.js.map +1 -1
- package/dist/errors.d.ts +66 -66
- package/dist/errors.js +133 -133
- package/dist/errors.test.d.ts +1 -1
- package/dist/get-param-names.d.ts +5 -5
- package/dist/get-param-names.js +48 -49
- package/dist/get-param-names.js.map +1 -1
- package/dist/index.d.ts +20 -20
- package/dist/index.js +23 -23
- package/dist/is-constructor.d.ts +12 -12
- package/dist/is-constructor.js +28 -29
- package/dist/is-constructor.js.map +1 -1
- package/dist/is-constructor.test.d.ts +1 -1
- package/dist/lazy-promise.d.ts +14 -14
- package/dist/lazy-promise.js +32 -32
- package/dist/lazy-promise.js.map +1 -1
- package/dist/lazy-subject.d.ts +22 -22
- package/dist/lazy-subject.js +22 -23
- package/dist/lazy-subject.js.map +1 -1
- package/dist/locks.d.ts +23 -23
- package/dist/locks.js +76 -76
- package/dist/locks.js.map +1 -1
- package/dist/locks.test.d.ts +1 -1
- package/dist/locks.test.js.map +1 -1
- package/dist/padding.d.ts +22 -22
- package/dist/padding.js +42 -43
- package/dist/padding.js.map +1 -1
- package/dist/presentation.d.ts +49 -49
- package/dist/presentation.d.ts.map +1 -1
- package/dist/presentation.js +132 -132
- package/dist/presentation.js.map +1 -1
- package/dist/presentation.test.d.ts +1 -1
- package/dist/presentation.test.js.map +1 -1
- package/dist/serializer.d.ts +8 -8
- package/dist/serializer.js +23 -24
- package/dist/serializer.js.map +1 -1
- package/dist/test.d.ts +2 -2
- package/dist/time.d.ts +9 -9
- package/dist/time.js +22 -22
- package/dist/time.js.map +1 -1
- package/dist/timeout.d.ts +13 -13
- package/dist/timeout.js +27 -28
- package/dist/timeout.js.map +1 -1
- package/dist/zones.d.ts +46 -46
- package/dist/zones.js +139 -139
- package/dist/zones.js.map +1 -1
- package/dist.esm/base64.d.ts +6 -6
- package/dist.esm/base64.js +48 -48
- package/dist.esm/base64.js.map +1 -1
- package/dist.esm/base64.test.d.ts +1 -1
- package/dist.esm/cache.d.ts +84 -84
- package/dist.esm/cache.js +144 -144
- package/dist.esm/cache.js.map +1 -1
- package/dist.esm/cache.test.d.ts +1 -1
- package/dist.esm/check-native-async.d.ts +1 -1
- package/dist.esm/check-native-async.js +24 -24
- package/dist.esm/check-native-async.js.map +1 -1
- package/dist.esm/clone.d.ts +23 -23
- package/dist.esm/clone.js +53 -53
- package/dist.esm/clone.js.map +1 -1
- package/dist.esm/clone.test.d.ts +1 -1
- package/dist.esm/coalesce.d.ts +5 -5
- package/dist.esm/coalesce.js +12 -12
- package/dist.esm/coalesce.js.map +1 -1
- package/dist.esm/coalesce.test.d.ts +1 -1
- package/dist.esm/colors.d.ts +62 -62
- package/dist.esm/colors.js +63 -63
- package/dist.esm/console.d.ts +31 -31
- package/dist.esm/console.d.ts.map +1 -1
- package/dist.esm/console.js +60 -80
- package/dist.esm/console.js.map +1 -1
- package/dist.esm/constructor.d.ts +6 -6
- package/dist.esm/constructor.js +1 -1
- package/dist.esm/decorators.d.ts +1 -1
- package/dist.esm/decorators.d.ts.map +1 -1
- package/dist.esm/decorators.js +3 -3
- package/dist.esm/environment.d.ts +11 -11
- package/dist.esm/environment.d.ts.map +1 -1
- package/dist.esm/environment.js +24 -24
- package/dist.esm/environment.js.map +1 -1
- package/dist.esm/errors.d.ts +66 -66
- package/dist.esm/errors.js +115 -115
- package/dist.esm/errors.test.d.ts +1 -1
- package/dist.esm/get-param-names.d.ts +5 -5
- package/dist.esm/get-param-names.js +45 -45
- package/dist.esm/get-param-names.js.map +1 -1
- package/dist.esm/index.d.ts +20 -20
- package/dist.esm/index.js +20 -20
- package/dist.esm/is-constructor.d.ts +12 -12
- package/dist.esm/is-constructor.js +24 -24
- package/dist.esm/is-constructor.js.map +1 -1
- package/dist.esm/is-constructor.test.d.ts +1 -1
- package/dist.esm/lazy-promise.d.ts +14 -14
- package/dist.esm/lazy-promise.js +28 -28
- package/dist.esm/lazy-promise.js.map +1 -1
- package/dist.esm/lazy-subject.d.ts +22 -22
- package/dist.esm/lazy-subject.js +19 -19
- package/dist.esm/locks.d.ts +23 -23
- package/dist.esm/locks.js +71 -71
- package/dist.esm/locks.js.map +1 -1
- package/dist.esm/locks.test.d.ts +1 -1
- package/dist.esm/locks.test.js.map +1 -1
- package/dist.esm/padding.d.ts +22 -22
- package/dist.esm/padding.js +37 -37
- package/dist.esm/presentation.d.ts +49 -49
- package/dist.esm/presentation.d.ts.map +1 -1
- package/dist.esm/presentation.js +126 -126
- package/dist.esm/presentation.js.map +1 -1
- package/dist.esm/presentation.test.d.ts +1 -1
- package/dist.esm/presentation.test.js.map +1 -1
- package/dist.esm/serializer.d.ts +8 -8
- package/dist.esm/serializer.js +20 -20
- package/dist.esm/test.d.ts +2 -2
- package/dist.esm/time.d.ts +9 -9
- package/dist.esm/time.js +19 -19
- package/dist.esm/time.js.map +1 -1
- package/dist.esm/timeout.d.ts +13 -13
- package/dist.esm/timeout.js +23 -23
- package/dist.esm/tsconfig.esm.tsbuildinfo +1 -0
- package/dist.esm/zones.d.ts +46 -46
- package/dist.esm/zones.js +135 -135
- package/dist.esm/zones.js.map +1 -1
- package/package.json +10 -7
- package/src/console.ts +2 -22
- package/src/environment.ts +2 -0
- package/tsconfig.esm.json +0 -3
- package/tsconfig.json +0 -2
- package/tsconfig.tsbuildinfo +1 -3791
package/dist.esm/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export * from './zones';
|
|
2
|
-
export * from './clone';
|
|
3
|
-
export * from './coalesce';
|
|
4
|
-
export * from './colors';
|
|
5
|
-
export * from './console';
|
|
6
|
-
export * from './environment';
|
|
7
|
-
export * from './errors';
|
|
8
|
-
export * from './timeout';
|
|
9
|
-
export * from './base64';
|
|
10
|
-
export * from './cache';
|
|
11
|
-
export * from './serializer';
|
|
12
|
-
export * from './lazy-promise';
|
|
13
|
-
export * from './locks';
|
|
14
|
-
export * from './presentation';
|
|
15
|
-
export * from './time';
|
|
16
|
-
export * from './get-param-names';
|
|
17
|
-
export * from './lazy-subject';
|
|
18
|
-
export * from './check-native-async';
|
|
19
|
-
export * from './is-constructor';
|
|
20
|
-
export * from './padding';
|
|
1
|
+
export * from './zones';
|
|
2
|
+
export * from './clone';
|
|
3
|
+
export * from './coalesce';
|
|
4
|
+
export * from './colors';
|
|
5
|
+
export * from './console';
|
|
6
|
+
export * from './environment';
|
|
7
|
+
export * from './errors';
|
|
8
|
+
export * from './timeout';
|
|
9
|
+
export * from './base64';
|
|
10
|
+
export * from './cache';
|
|
11
|
+
export * from './serializer';
|
|
12
|
+
export * from './lazy-promise';
|
|
13
|
+
export * from './locks';
|
|
14
|
+
export * from './presentation';
|
|
15
|
+
export * from './time';
|
|
16
|
+
export * from './get-param-names';
|
|
17
|
+
export * from './lazy-subject';
|
|
18
|
+
export * from './check-native-async';
|
|
19
|
+
export * from './is-constructor';
|
|
20
|
+
export * from './padding';
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if the given function is constructable. Note that this is not the same as a *class*. In Ecmascript, normal
|
|
3
|
-
* functions are also constructable. Use isClass() if you want to check if a function is a class.
|
|
4
|
-
*
|
|
5
|
-
* @see https://stackoverflow.com/a/46759625
|
|
6
|
-
*/
|
|
7
|
-
export declare function isConstructor(f: Function): boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Check if the given function is a class. Note that this only works for Ecmascript standard classes, the older
|
|
10
|
-
* prototype style constructor functions will return false here.
|
|
11
|
-
*/
|
|
12
|
-
export declare function isClass(f: Function): boolean;
|
|
1
|
+
/**
|
|
2
|
+
* Check if the given function is constructable. Note that this is not the same as a *class*. In Ecmascript, normal
|
|
3
|
+
* functions are also constructable. Use isClass() if you want to check if a function is a class.
|
|
4
|
+
*
|
|
5
|
+
* @see https://stackoverflow.com/a/46759625
|
|
6
|
+
*/
|
|
7
|
+
export declare function isConstructor(f: Function): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Check if the given function is a class. Note that this only works for Ecmascript standard classes, the older
|
|
10
|
+
* prototype style constructor functions will return false here.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isClass(f: Function): boolean;
|
|
13
13
|
//# sourceMappingURL=is-constructor.d.ts.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if the given function is constructable. Note that this is not the same as a *class*. In Ecmascript, normal
|
|
3
|
-
* functions are also constructable. Use isClass() if you want to check if a function is a class.
|
|
4
|
-
*
|
|
5
|
-
* @see https://stackoverflow.com/a/46759625
|
|
6
|
-
*/
|
|
7
|
-
export function isConstructor(f) {
|
|
8
|
-
if (f === Symbol)
|
|
9
|
-
return false;
|
|
10
|
-
try {
|
|
11
|
-
Reflect.construct(String, [], f);
|
|
12
|
-
}
|
|
13
|
-
catch (e) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Check if the given function is a class. Note that this only works for Ecmascript standard classes, the older
|
|
20
|
-
* prototype style constructor functions will return false here.
|
|
21
|
-
*/
|
|
22
|
-
export function isClass(f) {
|
|
23
|
-
return f.toString().startsWith('class ');
|
|
24
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Check if the given function is constructable. Note that this is not the same as a *class*. In Ecmascript, normal
|
|
3
|
+
* functions are also constructable. Use isClass() if you want to check if a function is a class.
|
|
4
|
+
*
|
|
5
|
+
* @see https://stackoverflow.com/a/46759625
|
|
6
|
+
*/
|
|
7
|
+
export function isConstructor(f) {
|
|
8
|
+
if (f === Symbol)
|
|
9
|
+
return false;
|
|
10
|
+
try {
|
|
11
|
+
Reflect.construct(String, [], f);
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Check if the given function is a class. Note that this only works for Ecmascript standard classes, the older
|
|
20
|
+
* prototype style constructor functions will return false here.
|
|
21
|
+
*/
|
|
22
|
+
export function isClass(f) {
|
|
23
|
+
return f.toString().startsWith('class ');
|
|
24
|
+
}
|
|
25
25
|
//# sourceMappingURL=is-constructor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-constructor.js","sourceRoot":"","sources":["../src/is-constructor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,CAAW;IACrC,IAAI,CAAC,KAAK,MAAM;QACZ,OAAO,KAAK,CAAC;IAEjB,IAAI;
|
|
1
|
+
{"version":3,"file":"is-constructor.js","sourceRoot":"","sources":["../src/is-constructor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,CAAW;IACrC,IAAI,CAAC,KAAK,MAAM;QACZ,OAAO,KAAK,CAAC;IAEjB,IAAI,CAAC;QACD,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,CAAW;IAC/B,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=is-constructor.test.d.ts.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A promise that lets you wait until someone actually requests the result of the promise to kick off
|
|
3
|
-
* the action being promised. This lets you return the promise before you start executing the async action.
|
|
4
|
-
*/
|
|
5
|
-
export declare class LazyPromise<T> extends Promise<T> {
|
|
6
|
-
private fulfiller;
|
|
7
|
-
constructor(fulfiller: () => Promise<T>);
|
|
8
|
-
private _resolve;
|
|
9
|
-
private _reject;
|
|
10
|
-
fulfill(): void;
|
|
11
|
-
private realPromise;
|
|
12
|
-
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
|
|
13
|
-
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
|
|
14
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* A promise that lets you wait until someone actually requests the result of the promise to kick off
|
|
3
|
+
* the action being promised. This lets you return the promise before you start executing the async action.
|
|
4
|
+
*/
|
|
5
|
+
export declare class LazyPromise<T> extends Promise<T> {
|
|
6
|
+
private fulfiller;
|
|
7
|
+
constructor(fulfiller: () => Promise<T>);
|
|
8
|
+
private _resolve;
|
|
9
|
+
private _reject;
|
|
10
|
+
fulfill(): void;
|
|
11
|
+
private realPromise;
|
|
12
|
+
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
|
|
13
|
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
|
|
14
|
+
}
|
|
15
15
|
//# sourceMappingURL=lazy-promise.d.ts.map
|
package/dist.esm/lazy-promise.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A promise that lets you wait until someone actually requests the result of the promise to kick off
|
|
3
|
-
* the action being promised. This lets you return the promise before you start executing the async action.
|
|
4
|
-
*/
|
|
5
|
-
export class LazyPromise extends Promise {
|
|
6
|
-
constructor(fulfiller) {
|
|
7
|
-
super((resolve, reject) => {
|
|
8
|
-
this._resolve = resolve;
|
|
9
|
-
this._reject = reject;
|
|
10
|
-
});
|
|
11
|
-
this.fulfiller = fulfiller;
|
|
12
|
-
}
|
|
13
|
-
fulfill() {
|
|
14
|
-
if (!this.realPromise) {
|
|
15
|
-
this.realPromise = this.fulfiller()
|
|
16
|
-
.then(v => this._resolve(v))
|
|
17
|
-
.catch(e => this._reject(e));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
then(onfulfilled, onrejected) {
|
|
21
|
-
this.fulfill();
|
|
22
|
-
return super.then(onfulfilled, onrejected);
|
|
23
|
-
}
|
|
24
|
-
catch(onrejected) {
|
|
25
|
-
this.fulfill();
|
|
26
|
-
return super.catch(onrejected);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* A promise that lets you wait until someone actually requests the result of the promise to kick off
|
|
3
|
+
* the action being promised. This lets you return the promise before you start executing the async action.
|
|
4
|
+
*/
|
|
5
|
+
export class LazyPromise extends Promise {
|
|
6
|
+
constructor(fulfiller) {
|
|
7
|
+
super((resolve, reject) => {
|
|
8
|
+
this._resolve = resolve;
|
|
9
|
+
this._reject = reject;
|
|
10
|
+
});
|
|
11
|
+
this.fulfiller = fulfiller;
|
|
12
|
+
}
|
|
13
|
+
fulfill() {
|
|
14
|
+
if (!this.realPromise) {
|
|
15
|
+
this.realPromise = this.fulfiller()
|
|
16
|
+
.then(v => this._resolve(v))
|
|
17
|
+
.catch(e => this._reject(e));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
then(onfulfilled, onrejected) {
|
|
21
|
+
this.fulfill();
|
|
22
|
+
return super.then(onfulfilled, onrejected);
|
|
23
|
+
}
|
|
24
|
+
catch(onrejected) {
|
|
25
|
+
this.fulfill();
|
|
26
|
+
return super.catch(onrejected);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
29
|
//# sourceMappingURL=lazy-promise.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-promise.js","sourceRoot":"","sources":["../src/lazy-promise.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,MAAM,OAAO,WAAe,SAAQ,OAAU;IAC1C,YACY,SAA4B;QAEpC,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAC1B,CAAC,CAAC,CAAC;QALK,cAAS,GAAT,SAAS,CAAmB;IAOxC,CAAC;IAKD,OAAO;QACH,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"lazy-promise.js","sourceRoot":"","sources":["../src/lazy-promise.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,MAAM,OAAO,WAAe,SAAQ,OAAU;IAC1C,YACY,SAA4B;QAEpC,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAC1B,CAAC,CAAC,CAAC;QALK,cAAS,GAAT,SAAS,CAAmB;IAOxC,CAAC;IAKD,OAAO;QACH,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACpB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE;iBAC9B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;iBAC3B,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAC/B;QACL,CAAC;IACL,CAAC;IAID,IAAI,CAAiC,WAAiF,EAAE,UAAmF;QACvM,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAkB,UAAiF;QACpG,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC;CACJ"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Subject, Observable } from 'rxjs';
|
|
2
|
-
/**
|
|
3
|
-
* Options for the lazySubject() utility
|
|
4
|
-
*/
|
|
5
|
-
export interface LazySubjectOptions<T> {
|
|
6
|
-
/**
|
|
7
|
-
* Function that is called when the observable is subscribed to after
|
|
8
|
-
* having no subscribers
|
|
9
|
-
*/
|
|
10
|
-
start: (subject: Subject<T>) => void;
|
|
11
|
-
/**
|
|
12
|
-
* Function that is called when the observable moves from having subscribers
|
|
13
|
-
* to having no subscribers.
|
|
14
|
-
*/
|
|
15
|
-
stop: () => void;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Utility for creating a subject observable which can run arbitrary code when the first
|
|
19
|
-
* subscribe() happens and when the last unsubscribe() happens.
|
|
20
|
-
* @param options
|
|
21
|
-
*/
|
|
22
|
-
export declare function lazySubject<T>(options: LazySubjectOptions<T>): Observable<T>;
|
|
1
|
+
import { Subject, Observable } from 'rxjs';
|
|
2
|
+
/**
|
|
3
|
+
* Options for the lazySubject() utility
|
|
4
|
+
*/
|
|
5
|
+
export interface LazySubjectOptions<T> {
|
|
6
|
+
/**
|
|
7
|
+
* Function that is called when the observable is subscribed to after
|
|
8
|
+
* having no subscribers
|
|
9
|
+
*/
|
|
10
|
+
start: (subject: Subject<T>) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Function that is called when the observable moves from having subscribers
|
|
13
|
+
* to having no subscribers.
|
|
14
|
+
*/
|
|
15
|
+
stop: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Utility for creating a subject observable which can run arbitrary code when the first
|
|
19
|
+
* subscribe() happens and when the last unsubscribe() happens.
|
|
20
|
+
* @param options
|
|
21
|
+
*/
|
|
22
|
+
export declare function lazySubject<T>(options: LazySubjectOptions<T>): Observable<T>;
|
|
23
23
|
//# sourceMappingURL=lazy-subject.d.ts.map
|
package/dist.esm/lazy-subject.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Subject, Observable } from 'rxjs';
|
|
2
|
-
import { publish } from 'rxjs/operators';
|
|
3
|
-
/**
|
|
4
|
-
* Utility for creating a subject observable which can run arbitrary code when the first
|
|
5
|
-
* subscribe() happens and when the last unsubscribe() happens.
|
|
6
|
-
* @param options
|
|
7
|
-
*/
|
|
8
|
-
export function lazySubject(options) {
|
|
9
|
-
let obs = new Observable(observer => {
|
|
10
|
-
let subject = new Subject();
|
|
11
|
-
let subscription = subject.subscribe(observer);
|
|
12
|
-
options.start(subject);
|
|
13
|
-
return () => {
|
|
14
|
-
subscription.unsubscribe();
|
|
15
|
-
options.stop();
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
return obs.pipe(publish()).refCount();
|
|
19
|
-
}
|
|
1
|
+
import { Subject, Observable } from 'rxjs';
|
|
2
|
+
import { publish } from 'rxjs/operators';
|
|
3
|
+
/**
|
|
4
|
+
* Utility for creating a subject observable which can run arbitrary code when the first
|
|
5
|
+
* subscribe() happens and when the last unsubscribe() happens.
|
|
6
|
+
* @param options
|
|
7
|
+
*/
|
|
8
|
+
export function lazySubject(options) {
|
|
9
|
+
let obs = new Observable(observer => {
|
|
10
|
+
let subject = new Subject();
|
|
11
|
+
let subscription = subject.subscribe(observer);
|
|
12
|
+
options.start(subject);
|
|
13
|
+
return () => {
|
|
14
|
+
subscription.unsubscribe();
|
|
15
|
+
options.stop();
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
return obs.pipe(publish()).refCount();
|
|
19
|
+
}
|
|
20
20
|
//# sourceMappingURL=lazy-subject.js.map
|
package/dist.esm/locks.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provides a mechanism for ensuring that multiple function calls do not overlap, even if they are asynchronous.
|
|
3
|
-
* NOTE: This does not include macrotasks (ie setTimeout/setInterval/etc). If you require that, see ZoneLock.
|
|
4
|
-
*/
|
|
5
|
-
export declare class Lock {
|
|
6
|
-
constructor();
|
|
7
|
-
private _ready;
|
|
8
|
-
private static _namedLocks;
|
|
9
|
-
static forToken<T extends Lock>(this: {
|
|
10
|
-
new (): T;
|
|
11
|
-
}, token: any): T;
|
|
12
|
-
protected executeCallback(cb: any): Promise<any>;
|
|
13
|
-
run(cb: Function): Promise<any>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Provides a mechanism for ensuring that multiple function calls do not overlap, even if they are asynchronous
|
|
17
|
-
* or they spin off macrotasks (ie setTimeout/setInterval/etc). Zone.js is used to accomplish this. For a lighter
|
|
18
|
-
* lock that does not track macrotasks see Lock.
|
|
19
|
-
*/
|
|
20
|
-
export declare class ZoneLock extends Lock {
|
|
21
|
-
constructor();
|
|
22
|
-
protected executeCallback(cb: any): Promise<unknown>;
|
|
23
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Provides a mechanism for ensuring that multiple function calls do not overlap, even if they are asynchronous.
|
|
3
|
+
* NOTE: This does not include macrotasks (ie setTimeout/setInterval/etc). If you require that, see ZoneLock.
|
|
4
|
+
*/
|
|
5
|
+
export declare class Lock {
|
|
6
|
+
constructor();
|
|
7
|
+
private _ready;
|
|
8
|
+
private static _namedLocks;
|
|
9
|
+
static forToken<T extends Lock>(this: {
|
|
10
|
+
new (): T;
|
|
11
|
+
}, token: any): T;
|
|
12
|
+
protected executeCallback(cb: any): Promise<any>;
|
|
13
|
+
run(cb: Function): Promise<any>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Provides a mechanism for ensuring that multiple function calls do not overlap, even if they are asynchronous
|
|
17
|
+
* or they spin off macrotasks (ie setTimeout/setInterval/etc). Zone.js is used to accomplish this. For a lighter
|
|
18
|
+
* lock that does not track macrotasks see Lock.
|
|
19
|
+
*/
|
|
20
|
+
export declare class ZoneLock extends Lock {
|
|
21
|
+
constructor();
|
|
22
|
+
protected executeCallback(cb: any): Promise<unknown>;
|
|
23
|
+
}
|
|
24
24
|
//# sourceMappingURL=locks.d.ts.map
|
package/dist.esm/locks.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { __awaiter } from "tslib";
|
|
2
|
-
import { AsyncZone } from "./zones";
|
|
3
|
-
/**
|
|
4
|
-
* Provides a mechanism for ensuring that multiple function calls do not overlap, even if they are asynchronous.
|
|
5
|
-
* NOTE: This does not include macrotasks (ie setTimeout/setInterval/etc). If you require that, see ZoneLock.
|
|
6
|
-
*/
|
|
7
|
-
export class Lock {
|
|
8
|
-
constructor() {
|
|
9
|
-
}
|
|
10
|
-
static forToken(token) {
|
|
11
|
-
let prop = Object.getOwnPropertyDescriptor(this, '_namedLocks');
|
|
12
|
-
let map;
|
|
13
|
-
if (!prop) {
|
|
14
|
-
map = new Map();
|
|
15
|
-
Object.defineProperty(this, '_namedLocks', {
|
|
16
|
-
enumerable: false,
|
|
17
|
-
value: map
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
map = prop.value;
|
|
22
|
-
}
|
|
23
|
-
let lock = map.get(token);
|
|
24
|
-
if (!lock) {
|
|
25
|
-
lock = new this();
|
|
26
|
-
map.set(token, lock);
|
|
27
|
-
}
|
|
28
|
-
return lock;
|
|
29
|
-
}
|
|
30
|
-
executeCallback(cb) {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
return yield cb();
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
run(cb) {
|
|
36
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
let ready = this._ready;
|
|
38
|
-
let value = undefined;
|
|
39
|
-
let error = undefined;
|
|
40
|
-
this._ready = new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
yield ready;
|
|
42
|
-
try {
|
|
43
|
-
value = yield this.executeCallback(cb);
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
error = e;
|
|
47
|
-
}
|
|
48
|
-
resolve();
|
|
49
|
-
}));
|
|
50
|
-
yield this._ready;
|
|
51
|
-
if (error !== undefined)
|
|
52
|
-
throw error;
|
|
53
|
-
return value;
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Provides a mechanism for ensuring that multiple function calls do not overlap, even if they are asynchronous
|
|
59
|
-
* or they spin off macrotasks (ie setTimeout/setInterval/etc). Zone.js is used to accomplish this. For a lighter
|
|
60
|
-
* lock that does not track macrotasks see Lock.
|
|
61
|
-
*/
|
|
62
|
-
export class ZoneLock extends Lock {
|
|
63
|
-
constructor() {
|
|
64
|
-
super();
|
|
65
|
-
}
|
|
66
|
-
executeCallback(cb) {
|
|
67
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
return yield AsyncZone.run(cb);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { AsyncZone } from "./zones";
|
|
3
|
+
/**
|
|
4
|
+
* Provides a mechanism for ensuring that multiple function calls do not overlap, even if they are asynchronous.
|
|
5
|
+
* NOTE: This does not include macrotasks (ie setTimeout/setInterval/etc). If you require that, see ZoneLock.
|
|
6
|
+
*/
|
|
7
|
+
export class Lock {
|
|
8
|
+
constructor() {
|
|
9
|
+
}
|
|
10
|
+
static forToken(token) {
|
|
11
|
+
let prop = Object.getOwnPropertyDescriptor(this, '_namedLocks');
|
|
12
|
+
let map;
|
|
13
|
+
if (!prop) {
|
|
14
|
+
map = new Map();
|
|
15
|
+
Object.defineProperty(this, '_namedLocks', {
|
|
16
|
+
enumerable: false,
|
|
17
|
+
value: map
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
map = prop.value;
|
|
22
|
+
}
|
|
23
|
+
let lock = map.get(token);
|
|
24
|
+
if (!lock) {
|
|
25
|
+
lock = new this();
|
|
26
|
+
map.set(token, lock);
|
|
27
|
+
}
|
|
28
|
+
return lock;
|
|
29
|
+
}
|
|
30
|
+
executeCallback(cb) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
return yield cb();
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
run(cb) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
let ready = this._ready;
|
|
38
|
+
let value = undefined;
|
|
39
|
+
let error = undefined;
|
|
40
|
+
this._ready = new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
yield ready;
|
|
42
|
+
try {
|
|
43
|
+
value = yield this.executeCallback(cb);
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
error = e;
|
|
47
|
+
}
|
|
48
|
+
resolve();
|
|
49
|
+
}));
|
|
50
|
+
yield this._ready;
|
|
51
|
+
if (error !== undefined)
|
|
52
|
+
throw error;
|
|
53
|
+
return value;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Provides a mechanism for ensuring that multiple function calls do not overlap, even if they are asynchronous
|
|
59
|
+
* or they spin off macrotasks (ie setTimeout/setInterval/etc). Zone.js is used to accomplish this. For a lighter
|
|
60
|
+
* lock that does not track macrotasks see Lock.
|
|
61
|
+
*/
|
|
62
|
+
export class ZoneLock extends Lock {
|
|
63
|
+
constructor() {
|
|
64
|
+
super();
|
|
65
|
+
}
|
|
66
|
+
executeCallback(cb) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return yield AsyncZone.run(cb);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
72
|
//# sourceMappingURL=locks.js.map
|
package/dist.esm/locks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locks.js","sourceRoot":"","sources":["../src/locks.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC;;;GAGG;AACH,MAAM,OAAO,IAAI;IACb;IACA,CAAC;IAKD,MAAM,CAAC,QAAQ,CAAuC,KAAW;QAE7D,IAAI,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAChE,IAAI,GAAiB,CAAC;QAEtB,IAAI,CAAC,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"locks.js","sourceRoot":"","sources":["../src/locks.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC;;;GAGG;AACH,MAAM,OAAO,IAAI;IACb;IACA,CAA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,MAAM,IAAI,CAAC,MAAM,CAAC;YAElB,IAAI,KAAK,KAAK,SAAS;gBACnB,MAAM,KAAK,CAAC;YAEhB,OAAO,KAAK,CAAC;QACjB,CAAC;KAAA;CACJ;AAED;;;;GAIG;AACH,MAAM,OAAO,QAAS,SAAQ,IAAI;IAC9B;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;IAEe,eAAe,CAAC,EAAE;;YAC9B,OAAO,MAAM,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnC,CAAC;KAAA;CACJ"}
|
package/dist.esm/locks.test.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=locks.test.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locks.test.js","sourceRoot":"","sources":["../src/locks.test.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,KAAK,CAAC,QAAQ,CAAC,EAAE;IACb,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QAClB,EAAE,CAAC,8BAA8B,EAAE,GAAS,EAAE;YAC1C,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,IAAI,GAAG,OAAO,EAAE,EAAE,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"locks.test.js","sourceRoot":"","sources":["../src/locks.test.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EA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O,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACxB,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAC1C,CAAC;QACL,CAAC,CAAA,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/dist.esm/padding.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pad the given string until its at least `length` characters long by adding spaces to the end.
|
|
3
|
-
*
|
|
4
|
-
* @param str
|
|
5
|
-
* @param length
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare function rightPad(str: string, length: number): string;
|
|
9
|
-
/**
|
|
10
|
-
* Pad the given string until its at least `length` characters long by adding spaces to the beginning.
|
|
11
|
-
* @param str
|
|
12
|
-
* @param length
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
export declare function leftPad(str: string, length: number): string;
|
|
16
|
-
/**
|
|
17
|
-
* Pad the given number (creating a string) until its at least `length` digits long by adding zeros to the beginning.
|
|
18
|
-
* @param number
|
|
19
|
-
* @param digits
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
export declare function zeroPad(number: any, digits?: number): string;
|
|
1
|
+
/**
|
|
2
|
+
* Pad the given string until its at least `length` characters long by adding spaces to the end.
|
|
3
|
+
*
|
|
4
|
+
* @param str
|
|
5
|
+
* @param length
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function rightPad(str: string, length: number): string;
|
|
9
|
+
/**
|
|
10
|
+
* Pad the given string until its at least `length` characters long by adding spaces to the beginning.
|
|
11
|
+
* @param str
|
|
12
|
+
* @param length
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare function leftPad(str: string, length: number): string;
|
|
16
|
+
/**
|
|
17
|
+
* Pad the given number (creating a string) until its at least `length` digits long by adding zeros to the beginning.
|
|
18
|
+
* @param number
|
|
19
|
+
* @param digits
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function zeroPad(number: any, digits?: number): string;
|
|
23
23
|
//# sourceMappingURL=padding.d.ts.map
|