@nu-art/ts-common 0.201.32 → 0.201.34
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/core/module.d.ts +1 -1
- package/core/module.js +1 -1
- package/package.json +1 -1
- package/utils/tools.d.ts +4 -0
- package/validator/validators.js +1 -1
package/core/module.d.ts
CHANGED
|
@@ -11,9 +11,9 @@ type _FinalConfig<Config = any> = Config & {
|
|
|
11
11
|
};
|
|
12
12
|
export declare abstract class Module<Config = any, FinalConfig extends _FinalConfig<Config> = _FinalConfig<Config>> extends Logger {
|
|
13
13
|
private name;
|
|
14
|
+
readonly config: FinalConfig;
|
|
14
15
|
protected readonly manager: ModuleManager;
|
|
15
16
|
protected readonly initiated = false;
|
|
16
|
-
protected readonly config: FinalConfig;
|
|
17
17
|
protected readonly configValidator?: ValidatorTypeResolver<FinalConfig>;
|
|
18
18
|
protected timeoutMap: {
|
|
19
19
|
[k: string]: number;
|
package/core/module.js
CHANGED
|
@@ -26,8 +26,8 @@ class Module extends Logger_1.Logger {
|
|
|
26
26
|
// noinspection TypeScriptAbstractClassConstructorCanBeMadeProtected
|
|
27
27
|
constructor(tag) {
|
|
28
28
|
super(tag);
|
|
29
|
-
this.initiated = false;
|
|
30
29
|
this.config = {};
|
|
30
|
+
this.initiated = false;
|
|
31
31
|
this.timeoutMap = {};
|
|
32
32
|
this.runAsync = (label, toCall) => {
|
|
33
33
|
setTimeout(() => {
|
package/package.json
CHANGED
package/utils/tools.d.ts
CHANGED
|
@@ -14,3 +14,7 @@ export declare const resolveContent: <T extends unknown = any>(content: Resolvab
|
|
|
14
14
|
export declare const resolveFunctionOrValue: <T extends unknown = any>(content: ResolvableContent<T>) => T;
|
|
15
15
|
export declare function exists<T extends any = any>(item: T | undefined | null): item is T;
|
|
16
16
|
export declare const logicalXOR: (a: boolean, b: boolean) => boolean;
|
|
17
|
+
export type KeyBinder<K extends string, Type> = {
|
|
18
|
+
Key: K;
|
|
19
|
+
Type: Type;
|
|
20
|
+
};
|
package/validator/validators.js
CHANGED
|
@@ -16,7 +16,7 @@ exports.tsValidateOptional = (0, validator_core_1.tsValidateExists)(false);
|
|
|
16
16
|
exports.dbIdLength = 32;
|
|
17
17
|
const tsValidateId = (length, mandatory = true) => (0, type_validators_1.tsValidateRegexp)(new RegExp(`^[0-9a-f]{${length}}$`), mandatory);
|
|
18
18
|
exports.tsValidateId = tsValidateId;
|
|
19
|
-
exports.tsValidateEmail = (0, type_validators_1.tsValidateRegexp)(/[a-z0-9]
|
|
19
|
+
exports.tsValidateEmail = (0, type_validators_1.tsValidateRegexp)(/[a-z0-9](?:\.?[a-z0-9!#$%&'*+/=?^_`{|}~\-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?/);
|
|
20
20
|
const tsValidateBucketUrl = (mandatory) => (0, type_validators_1.tsValidateRegexp)(/gs?:\/\/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/, mandatory);
|
|
21
21
|
exports.tsValidateBucketUrl = tsValidateBucketUrl;
|
|
22
22
|
const tsValidateGeneralUrl = (mandatory) => (0, type_validators_1.tsValidateRegexp)(/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/, mandatory);
|