@leyyo/common 1.0.1 → 1.0.2
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/assertion/common-assertion-impl.d.ts +3 -4
- package/dist/assertion/common-assertion-impl.js +9 -8
- package/dist/assertion/index-types.d.ts +6 -22
- package/dist/assertion/index.d.ts +0 -1
- package/dist/assertion/index.js +0 -1
- package/dist/error/common-error-impl.d.ts +6 -4
- package/dist/error/common-error-impl.js +8 -4
- package/dist/error/index-types.d.ts +5 -52
- package/dist/error/index.d.ts +0 -5
- package/dist/error/index.js +0 -5
- package/dist/{error → exception}/assertion-exception.d.ts +1 -1
- package/dist/{error → exception}/caused-exception.d.ts +1 -1
- package/dist/{error → exception}/developer-exception.d.ts +1 -1
- package/dist/{error → exception}/exception.d.ts +4 -3
- package/dist/{error → exception}/exception.js +4 -4
- package/dist/exception/index-types.d.ts +30 -0
- package/dist/exception/index.d.ts +6 -0
- package/dist/exception/index.js +22 -0
- package/dist/fqn/common-fqn-impl.d.ts +11 -0
- package/dist/fqn/common-fqn-impl.js +47 -0
- package/dist/fqn/index-types.d.ts +6 -0
- package/dist/fqn/index-types.js +2 -0
- package/dist/fqn/index.d.ts +2 -0
- package/dist/{callback → fqn}/index.js +1 -1
- package/dist/hook/common-hook-impl.d.ts +30 -0
- package/dist/hook/common-hook-impl.js +111 -0
- package/dist/hook/index-types.d.ts +56 -0
- package/dist/hook/index-types.js +2 -0
- package/dist/hook/index.d.ts +2 -0
- package/dist/hook/index.js +18 -0
- package/dist/index.d.ts +11 -5
- package/dist/index.js +19 -6
- package/dist/is/common-is-impl.js +6 -6
- package/dist/is/index-types.d.ts +2 -3
- package/dist/leyyo/index-types.d.ts +4 -2
- package/dist/leyyo/leyyo-impl.d.ts +4 -2
- package/dist/leyyo/leyyo-impl.js +37 -29
- package/dist/literal/country-code.d.ts +8 -0
- package/dist/literal/country-code.js +17 -0
- package/dist/literal/environment.d.ts +8 -0
- package/dist/literal/environment.js +7 -0
- package/dist/literal/http-method.d.ts +8 -0
- package/dist/literal/http-method.js +7 -0
- package/dist/literal/http-place.d.ts +8 -0
- package/dist/literal/http-place.js +7 -0
- package/dist/literal/index-types.d.ts +6 -0
- package/dist/literal/index-types.js +2 -0
- package/dist/literal/index.d.ts +14 -0
- package/dist/literal/index.js +30 -0
- package/dist/literal/key-value.d.ts +4 -0
- package/dist/literal/key-value.js +7 -0
- package/dist/literal/language-code.d.ts +8 -0
- package/dist/literal/language-code.js +12 -0
- package/dist/literal/locale-code.d.ts +10 -0
- package/dist/literal/locale-code.js +17 -0
- package/dist/literal/primitive.d.ts +8 -0
- package/dist/literal/primitive.js +7 -0
- package/dist/literal/real-value.d.ts +8 -0
- package/dist/literal/real-value.js +7 -0
- package/dist/literal/severity.d.ts +8 -0
- package/dist/literal/severity.js +7 -0
- package/dist/literal/storage-type.d.ts +8 -0
- package/dist/literal/storage-type.js +7 -0
- package/dist/literal/weak-false.d.ts +8 -0
- package/dist/literal/weak-false.js +7 -0
- package/dist/literal/weak-true.d.ts +8 -0
- package/dist/literal/weak-true.js +7 -0
- package/dist/log/common-log-impl.d.ts +3 -2
- package/dist/log/common-log-impl.js +6 -6
- package/dist/log/index-types.d.ts +2 -52
- package/dist/log/index-types.js +0 -1
- package/dist/log/index.d.ts +1 -1
- package/dist/log/index.js +1 -1
- package/dist/log/logger-impl.d.ts +3 -3
- package/dist/log/logger-impl.js +5 -5
- package/dist/{assertion → shared}/assert.js +1 -0
- package/dist/{aliases.d.ts → shared/index-aliases.d.ts} +1 -1
- package/dist/shared/index-types.d.ts +141 -0
- package/dist/shared/index-types.js +3 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/index.js +21 -0
- package/dist/storage/common-storage-impl.d.ts +3 -3
- package/dist/storage/common-storage-impl.js +3 -3
- package/dist/storage/index-types.d.ts +3 -13
- package/dist/storage/index.d.ts +0 -1
- package/dist/storage/index.js +0 -1
- package/dist/to/common-to-impl.d.ts +3 -3
- package/dist/to/common-to-impl.js +11 -11
- package/dist/to/index-types.d.ts +1 -30
- package/package.json +1 -1
- package/dist/callback/common-callback-impl.d.ts +0 -31
- package/dist/callback/common-callback-impl.js +0 -134
- package/dist/callback/index-types.d.ts +0 -73
- package/dist/callback/index.d.ts +0 -2
- package/dist/literals.d.ts +0 -106
- package/dist/literals.js +0 -81
- package/dist/{error → exception}/assertion-exception.js +0 -0
- package/dist/{error → exception}/caused-exception.js +0 -0
- package/dist/{error → exception}/developer-exception.js +0 -0
- package/dist/{callback → exception}/index-types.js +0 -0
- package/dist/{error → exception}/multiple-exception.d.ts +1 -1
- package/dist/{error → exception}/multiple-exception.js +0 -0
- package/dist/{assertion → shared}/assert.d.ts +1 -1
- /package/dist/{aliases.js → shared/index-aliases.js} +0 -0
- /package/dist/{constants.d.ts → shared/index-constants.d.ts} +0 -0
- /package/dist/{constants.js → shared/index-constants.js} +0 -0
- /package/dist/{storage → shared}/list.d.ts +0 -0
- /package/dist/{storage → shared}/list.js +0 -0
package/dist/to/index-types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Dict, InitLike, KeyValue, OneOrMore, ShiftMain, ShiftSecure } from "../
|
|
2
|
-
import { AssertionOpt } from "../assertion";
|
|
1
|
+
import { Dict, InitLike, KeyValue, OneOrMore, ShiftMain, ShiftSecure, ToTypeArrayOpt, ToTypeEnumOpt, ToTypeObjectOpt, ToTypeOpt } from "../shared";
|
|
3
2
|
export interface CommonTo extends ShiftSecure<CommonToSecure> {
|
|
4
3
|
runFn<T = unknown>(fn: Function, value: Function, opt?: ToTypeOpt): T;
|
|
5
4
|
raiseInvalidValue<T = unknown>(value: unknown, expected: OneOrMore<string>, opt?: ToTypeOpt, params?: Dict): T;
|
|
@@ -19,31 +18,3 @@ export interface CommonTo extends ShiftSecure<CommonToSecure> {
|
|
|
19
18
|
}
|
|
20
19
|
export interface CommonToSecure extends ShiftMain<CommonTo>, InitLike {
|
|
21
20
|
}
|
|
22
|
-
export interface ToTypeOpt extends AssertionOpt {
|
|
23
|
-
silent?: true;
|
|
24
|
-
children?: unknown;
|
|
25
|
-
}
|
|
26
|
-
export type ToTypeFnLambda<T = unknown, O extends ToTypeOpt = ToTypeOpt> = (value: unknown, opt?: O) => T;
|
|
27
|
-
export interface ToTypeChildOpt<T = unknown> extends ToTypeOpt {
|
|
28
|
-
fn?: ToTypeFnLambda<T>;
|
|
29
|
-
}
|
|
30
|
-
export interface ToTypeArrayChildOpt<V extends ToTypeChildOpt = ToTypeChildOpt> extends Dict<ToTypeChildOpt> {
|
|
31
|
-
value?: V;
|
|
32
|
-
}
|
|
33
|
-
export interface ToTypeArrayOpt<V extends ToTypeChildOpt = ToTypeChildOpt> extends ToTypeOpt {
|
|
34
|
-
children?: ToTypeArrayChildOpt<V>;
|
|
35
|
-
}
|
|
36
|
-
export interface ToTypeDictChildOpt<K extends ToTypeChildOpt = ToTypeChildOpt, V extends ToTypeChildOpt = ToTypeChildOpt> extends Record<string, ToTypeChildOpt> {
|
|
37
|
-
key?: K;
|
|
38
|
-
value?: V;
|
|
39
|
-
}
|
|
40
|
-
export interface ToTypeObjectOpt<K extends ToTypeChildOpt = ToTypeChildOpt, V extends ToTypeChildOpt = ToTypeChildOpt> extends ToTypeOpt {
|
|
41
|
-
children?: ToTypeDictChildOpt<K, V>;
|
|
42
|
-
}
|
|
43
|
-
export interface ToTypeEnumOpt<E extends KeyValue = KeyValue> extends ToTypeOpt {
|
|
44
|
-
map: EnumerationMap<E> | EnumerationArray<E>;
|
|
45
|
-
alt?: EnumerationAlt<E>;
|
|
46
|
-
}
|
|
47
|
-
export type EnumerationMap<E extends KeyValue = KeyValue> = Dict<E>;
|
|
48
|
-
export type EnumerationAlt<E extends KeyValue = KeyValue> = Dict<E>;
|
|
49
|
-
export type EnumerationArray<E extends KeyValue = KeyValue> = Array<E>;
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Arr } from "../aliases";
|
|
2
|
-
import { CallbackWhenDefinedLambda, CommonCallback, CommonCallbackDefined, CommonCallbackSecure } from "./index-types";
|
|
3
|
-
import { Leyyo } from "../leyyo";
|
|
4
|
-
export declare class CommonCallbackImpl implements CommonCallback, CommonCallbackSecure {
|
|
5
|
-
private _waitingForCallbacks;
|
|
6
|
-
private _attachedCallbacks;
|
|
7
|
-
private _waitingForProviders;
|
|
8
|
-
private _definedProviders;
|
|
9
|
-
fqnName(value: any): string;
|
|
10
|
-
/**
|
|
11
|
-
* Default constructor
|
|
12
|
-
*
|
|
13
|
-
* Responsibilities
|
|
14
|
-
* - Create repositories => ie: callbacks
|
|
15
|
-
* - Trigger clear pending operation
|
|
16
|
-
* */
|
|
17
|
-
constructor();
|
|
18
|
-
$init(leyyo: Leyyo): void;
|
|
19
|
-
/**
|
|
20
|
-
* Clear jobs in the queue which named as pending
|
|
21
|
-
*
|
|
22
|
-
* Because the expected callback may not be defined
|
|
23
|
-
* */
|
|
24
|
-
private _clearPending;
|
|
25
|
-
get $secure(): CommonCallbackSecure;
|
|
26
|
-
attachCallback(name: string, fn: Function): void;
|
|
27
|
-
queueForCallback(name: string, ...args: Arr): boolean;
|
|
28
|
-
get $back(): CommonCallback;
|
|
29
|
-
whenProviderDefined<T extends CommonCallbackDefined = CommonCallbackDefined>(name: string, consumer: Function, callback: CallbackWhenDefinedLambda<T>): void;
|
|
30
|
-
defineProvider<T extends CommonCallbackDefined = CommonCallbackDefined>(name: string, producer: Function, instance: T): void;
|
|
31
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommonCallbackImpl = void 0;
|
|
4
|
-
const constants_1 = require("../constants");
|
|
5
|
-
const error_1 = require("../error");
|
|
6
|
-
const internal_1 = require("../internal");
|
|
7
|
-
class CommonCallbackImpl {
|
|
8
|
-
fqnName(value) {
|
|
9
|
-
switch (typeof value) {
|
|
10
|
-
case "function":
|
|
11
|
-
return value.name;
|
|
12
|
-
case "object":
|
|
13
|
-
return value.constructor.name;
|
|
14
|
-
case "string":
|
|
15
|
-
return value;
|
|
16
|
-
default:
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Default constructor
|
|
22
|
-
*
|
|
23
|
-
* Responsibilities
|
|
24
|
-
* - Create repositories => ie: callbacks
|
|
25
|
-
* - Trigger clear pending operation
|
|
26
|
-
* */
|
|
27
|
-
constructor() {
|
|
28
|
-
// clear after 1 minute
|
|
29
|
-
setTimeout(() => this._clearPending(), 60000);
|
|
30
|
-
}
|
|
31
|
-
$init(leyyo) {
|
|
32
|
-
this._waitingForCallbacks = leyyo.storage.newMap(`${internal_1.FQN_PCK}/waitingForCallbacks`);
|
|
33
|
-
this._attachedCallbacks = leyyo.storage.newMap(`${internal_1.FQN_PCK}/attachedCallbacks`);
|
|
34
|
-
this._waitingForProviders = leyyo.storage.newMap(`${internal_1.FQN_PCK}/waitingForProviders`);
|
|
35
|
-
this._definedProviders = leyyo.storage.newMap(`${internal_1.FQN_PCK}/definedProviders`);
|
|
36
|
-
// define itself temporarily for fqn name
|
|
37
|
-
this.defineProvider(constants_1.LY_ATTACHED_FQN, CommonCallbackImpl, {
|
|
38
|
-
proper: false,
|
|
39
|
-
name: this.fqnName,
|
|
40
|
-
});
|
|
41
|
-
// when new fqn provider is defined, replace temporary name method
|
|
42
|
-
this.whenProviderDefined(constants_1.LY_ATTACHED_FQN, CommonCallbackImpl, (ins) => {
|
|
43
|
-
if (typeof ins.name === 'function') {
|
|
44
|
-
this.fqnName = ins.name;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Clear jobs in the queue which named as pending
|
|
50
|
-
*
|
|
51
|
-
* Because the expected callback may not be defined
|
|
52
|
-
* */
|
|
53
|
-
_clearPending() {
|
|
54
|
-
for (const [name,] of this._waitingForCallbacks.entries()) {
|
|
55
|
-
const rec = this._attachedCallbacks.get(name);
|
|
56
|
-
if (rec && !rec.initialization) {
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
this._waitingForCallbacks.delete(name);
|
|
60
|
-
console.log(`callback.cleared.pending => {name: ${name}}`);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
get $secure() {
|
|
64
|
-
return this;
|
|
65
|
-
}
|
|
66
|
-
attachCallback(name, fn) {
|
|
67
|
-
if (!name || typeof name !== 'string') {
|
|
68
|
-
throw new Error(`callback.invalid.name => {type: ${typeof name}}`);
|
|
69
|
-
}
|
|
70
|
-
// callback attached
|
|
71
|
-
this._attachedCallbacks.set(name, { fn });
|
|
72
|
-
// check waiting records, to be called
|
|
73
|
-
if (this._waitingForCallbacks.has(name)) {
|
|
74
|
-
this._waitingForCallbacks.get(name).forEach(item => {
|
|
75
|
-
fn(...item);
|
|
76
|
-
});
|
|
77
|
-
this._waitingForCallbacks.delete(name);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
queueForCallback(name, ...args) {
|
|
81
|
-
if (!name || typeof name !== 'string') {
|
|
82
|
-
throw new Error(`callback.invalid.name => {type: ${typeof name}}`);
|
|
83
|
-
}
|
|
84
|
-
// callback already exists
|
|
85
|
-
if (this._attachedCallbacks.has(name)) {
|
|
86
|
-
const rec = this._attachedCallbacks.get(name);
|
|
87
|
-
rec.fn(...args);
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
// callback does not exist yet, so wait to be attached
|
|
91
|
-
if (this._waitingForCallbacks.has(name)) {
|
|
92
|
-
this._waitingForCallbacks.get(name).push(args);
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
this._waitingForCallbacks.set(name, [args]);
|
|
96
|
-
}
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
get $back() {
|
|
100
|
-
return undefined;
|
|
101
|
-
}
|
|
102
|
-
whenProviderDefined(name, consumer, callback) {
|
|
103
|
-
if (!name || typeof name !== 'string') {
|
|
104
|
-
throw new error_1.DeveloperException(`callback.invalid.name`, { type: typeof name });
|
|
105
|
-
}
|
|
106
|
-
if (!this._waitingForProviders.has(name)) {
|
|
107
|
-
this._waitingForProviders.set(name, []);
|
|
108
|
-
}
|
|
109
|
-
if (this._definedProviders.has(name)) {
|
|
110
|
-
const ins = this._definedProviders.get(name);
|
|
111
|
-
if (ins.producer !== consumer) {
|
|
112
|
-
callback(ins);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
this._waitingForProviders.get(name).push({ consumer, callback });
|
|
116
|
-
}
|
|
117
|
-
defineProvider(name, producer, instance) {
|
|
118
|
-
if (!name || typeof name !== 'string') {
|
|
119
|
-
throw new error_1.DeveloperException(`callback.invalid.name`, { type: typeof name });
|
|
120
|
-
}
|
|
121
|
-
const ins = Object.assign(Object.assign({}, instance), { producer });
|
|
122
|
-
this._definedProviders.set(name, ins);
|
|
123
|
-
if (instance.proper) {
|
|
124
|
-
if (this._waitingForProviders.has(name)) {
|
|
125
|
-
this._waitingForProviders.get(name).forEach(item => {
|
|
126
|
-
if (item.consumer !== producer) {
|
|
127
|
-
item.callback(instance);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
exports.CommonCallbackImpl = CommonCallbackImpl;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { Arr, InitLike, ShiftMain, ShiftSecure } from "../aliases";
|
|
2
|
-
/**
|
|
3
|
-
* Callback repository, it collects all jobs and fire them when callback is defined
|
|
4
|
-
* */
|
|
5
|
-
export interface CommonCallback extends ShiftSecure<CommonCallbackSecure> {
|
|
6
|
-
/**
|
|
7
|
-
* Attach a callback
|
|
8
|
-
*
|
|
9
|
-
* @param {string} name
|
|
10
|
-
* @param {Function} fn
|
|
11
|
-
*
|
|
12
|
-
* Notes:
|
|
13
|
-
* - name should be regular string
|
|
14
|
-
* - After attached, it should call all waiting calls in the queue
|
|
15
|
-
* */
|
|
16
|
-
attachCallback(name: string, fn: Function): void;
|
|
17
|
-
/**
|
|
18
|
-
* Add a call into queue, which to be executed by appropriate callback
|
|
19
|
-
*
|
|
20
|
-
* @param {string} name
|
|
21
|
-
* @param {Array<any>} args
|
|
22
|
-
* @returns {boolean} - callback exists?
|
|
23
|
-
*
|
|
24
|
-
* Notes:
|
|
25
|
-
* - name should be regular string
|
|
26
|
-
* */
|
|
27
|
-
queueForCallback(name: string, ...args: Arr): boolean;
|
|
28
|
-
fqnName(value: any): string;
|
|
29
|
-
/**
|
|
30
|
-
* Informs when callback is changed
|
|
31
|
-
*
|
|
32
|
-
* @param {string} name
|
|
33
|
-
* @param {Function} consumer
|
|
34
|
-
* @param {CallbackWhenDefinedLambda} callback
|
|
35
|
-
*
|
|
36
|
-
* Notes:
|
|
37
|
-
* - name should be regular string
|
|
38
|
-
* - callback should be regular function
|
|
39
|
-
* - name should not be already defined
|
|
40
|
-
* */
|
|
41
|
-
whenProviderDefined<T extends CommonCallbackDefined = CommonCallbackDefined>(name: string, consumer: Function, callback: CallbackWhenDefinedLambda<T>): void;
|
|
42
|
-
/**
|
|
43
|
-
* Defines a provider to replace temporary providers
|
|
44
|
-
*
|
|
45
|
-
* @param {string} name
|
|
46
|
-
* @param {Function} producer
|
|
47
|
-
* @param {Object} instance
|
|
48
|
-
*
|
|
49
|
-
* Notes:
|
|
50
|
-
* - name should be regular string
|
|
51
|
-
* */
|
|
52
|
-
defineProvider<T extends CommonCallbackDefined = CommonCallbackDefined>(name: string, producer: Function, instance: T): void;
|
|
53
|
-
}
|
|
54
|
-
export interface CommonCallbackSecure extends ShiftMain<CommonCallback>, InitLike {
|
|
55
|
-
}
|
|
56
|
-
export interface CallbackRec {
|
|
57
|
-
initialization?: true;
|
|
58
|
-
fn: Function;
|
|
59
|
-
}
|
|
60
|
-
export interface CommonCallbackDefinedInternal extends CommonCallbackDefined {
|
|
61
|
-
producer: Function;
|
|
62
|
-
}
|
|
63
|
-
export interface CommonCallbackDefined {
|
|
64
|
-
proper: boolean;
|
|
65
|
-
}
|
|
66
|
-
export interface CommonCallbackDefinedItem {
|
|
67
|
-
consumer: Function;
|
|
68
|
-
callback: CallbackWhenDefinedLambda;
|
|
69
|
-
}
|
|
70
|
-
export interface CommonFqnCb extends CommonCallbackDefined {
|
|
71
|
-
name(value: any): string;
|
|
72
|
-
}
|
|
73
|
-
export type CallbackWhenDefinedLambda<T extends CommonCallbackDefined = CommonCallbackDefined> = (instance: T) => void;
|
package/dist/callback/index.d.ts
DELETED
package/dist/literals.d.ts
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Weak True items
|
|
3
|
-
* */
|
|
4
|
-
export declare const StorageTypeItems: readonly ["array", "list", "map", "set"];
|
|
5
|
-
/**
|
|
6
|
-
* Storage type literal, as an enum
|
|
7
|
-
* */
|
|
8
|
-
export type StorageType = typeof StorageTypeItems[number];
|
|
9
|
-
/**
|
|
10
|
-
* Weak True items
|
|
11
|
-
* */
|
|
12
|
-
export declare const PrimitiveItems: readonly ["string", "number", "boolean"];
|
|
13
|
-
/**
|
|
14
|
-
* Weak True
|
|
15
|
-
* */
|
|
16
|
-
export type Primitive = typeof PrimitiveItems[number];
|
|
17
|
-
/**
|
|
18
|
-
* Weak True items
|
|
19
|
-
* */
|
|
20
|
-
export declare const RealValueItems: readonly ["string", "number", "bigint", "boolean", "object", "function"];
|
|
21
|
-
/**
|
|
22
|
-
* Weak True
|
|
23
|
-
* */
|
|
24
|
-
export type RealValue = typeof RealValueItems[number];
|
|
25
|
-
/**
|
|
26
|
-
* Weak True items
|
|
27
|
-
* */
|
|
28
|
-
export declare const KeyValueItems: readonly ["string", "number"];
|
|
29
|
-
/**
|
|
30
|
-
* Weak True items
|
|
31
|
-
* */
|
|
32
|
-
export declare const WeakTrueItems: readonly ["1", "true", "t", "yes", "y", "on"];
|
|
33
|
-
/**
|
|
34
|
-
* Weak True
|
|
35
|
-
* */
|
|
36
|
-
export type WeakTrue = typeof WeakTrueItems[number];
|
|
37
|
-
/**
|
|
38
|
-
* Weak False items
|
|
39
|
-
* */
|
|
40
|
-
export declare const WeakFalseItems: readonly ["0", "-1", "false", "f", "no", "n", "off"];
|
|
41
|
-
/**
|
|
42
|
-
* Weak False
|
|
43
|
-
* */
|
|
44
|
-
export type WeakFalse = typeof WeakFalseItems[number];
|
|
45
|
-
/**
|
|
46
|
-
* Weak Boolean
|
|
47
|
-
* */
|
|
48
|
-
export type WeakBoolean = WeakTrue & WeakFalse;
|
|
49
|
-
/**
|
|
50
|
-
* Http Method items
|
|
51
|
-
* */
|
|
52
|
-
export declare const HttpMethodItems: readonly ["delete", "get", "head", "link", "options", "patch", "post", "purge", "put", "unlink"];
|
|
53
|
-
/**
|
|
54
|
-
* Http Method
|
|
55
|
-
* */
|
|
56
|
-
export type HttpMethod = typeof HttpMethodItems[number];
|
|
57
|
-
/**
|
|
58
|
-
* Http Place items
|
|
59
|
-
* */
|
|
60
|
-
export declare const HttpPlaceItems: readonly ["query", "body", "header", "path"];
|
|
61
|
-
/**
|
|
62
|
-
* Http Place
|
|
63
|
-
* */
|
|
64
|
-
export type HttpPlace = typeof HttpPlaceItems[number];
|
|
65
|
-
/**
|
|
66
|
-
* Severity items
|
|
67
|
-
* */
|
|
68
|
-
export declare const SeverityItems: readonly ["debug", "error", "fatal", "info", "log", "trace", "warn"];
|
|
69
|
-
/**
|
|
70
|
-
* Severity for log and errors
|
|
71
|
-
* */
|
|
72
|
-
export type Severity = typeof SeverityItems[number];
|
|
73
|
-
/**
|
|
74
|
-
* Environment items
|
|
75
|
-
* */
|
|
76
|
-
export declare const EnvironmentItems: readonly ["automation", "development", "local", "production", "staging", "test"];
|
|
77
|
-
/**
|
|
78
|
-
* Environment
|
|
79
|
-
* */
|
|
80
|
-
export type Environment = typeof EnvironmentItems[number];
|
|
81
|
-
/**
|
|
82
|
-
* Country code items
|
|
83
|
-
* */
|
|
84
|
-
export declare const CountryCodeItems: readonly ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CS", "CU", "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"];
|
|
85
|
-
/**
|
|
86
|
-
* Country code
|
|
87
|
-
* */
|
|
88
|
-
export type CountryCode = typeof CountryCodeItems[number];
|
|
89
|
-
/**
|
|
90
|
-
* Language code items
|
|
91
|
-
* */
|
|
92
|
-
export declare const LanguageCodeItems: readonly ["af", "an", "ar", "as", "ast", "az", "be", "bg", "bn", "br", "bs", "ca", "ce", "ch", "co", "cr", "cs", "cv", "cy", "da", "de", "el", "en", "eo", "es", "et", "eu", "fa", "fi", "fj", "fo", "fr", "fur", "fy", "ga", "gd", "gl", "gu", "he", "hi", "hr", "hsb", "ht", "hu", "hy", "id", "is", "it", "iu", "ja", "ji", "ka", "kk", "km", "kn", "ko", "ks", "ky", "la", "lb", "lt", "lv", "mi", "mk", "ml", "mo", "mr", "ms", "mt", "my", "nb", "ne", "ng", "nl", "nn", "no", "nv", "oc", "om", "or", "pa", "pl", "pt", "qu", "rm", "ro", "ru", "sa", "sb", "sc", "sd", "sg", "si", "sk", "sl", "so", "sq", "sr", "sv", "sw", "sx", "sz", "ta", "te", "th", "tig", "tk", "tlh", "tn", "tr", "ts", "tt", "uk", "ur", "ve", "vi", "vo", "wa", "xh", "zh", "zu"];
|
|
93
|
-
/**
|
|
94
|
-
* Language codes
|
|
95
|
-
* */
|
|
96
|
-
export type LanguageCode = typeof LanguageCodeItems[number];
|
|
97
|
-
/**
|
|
98
|
-
* Locale code items
|
|
99
|
-
* */
|
|
100
|
-
export declare const LocaleCodeItems: readonly ["af", "an", "ar", "ar-ae", "ar-bh", "ar-dz", "ar-eg", "ar-iq", "ar-jo", "ar-kw", "ar-lb", "ar-ly", "ar-ma", "ar-om", "ar-qa", "ar-sa", "ar-sy", "ar-tn", "ar-ye", "as", "ast", "az", "be", "bg", "bn", "br", "bs", "ca", "ce", "ch", "co", "cr", "cs", "cv", "cy", "da", "de", "de-at", "de-ch", "de-de", "de-li", "de-lu", "el", "en", "en-au", "en-bz", "en-ca", "en-gb", "en-ie", "en-jm", "en-nz", "en-ph", "en-tt", "en-us", "en-za", "en-zw", "eo", "es", "es-ar", "es-bo", "es-cl", "es-co", "es-cr", "es-do", "es-ec", "es-es", "es-gt", "es-hn", "es-mx", "es-ni", "es-pa", "es-pe", "es-pr", "es-py", "es-sv", "es-uy", "es-ve", "et", "eu", "fa", "fa-ir", "fi", "fj", "fo", "fr", "fr-be", "fr-ca", "fr-ch", "fr-fr", "fr-lu", "fr-mc", "fur", "fy", "ga", "gd", "gd-ie", "gl", "gu", "he", "hi", "hr", "hsb", "ht", "hu", "hy", "id", "is", "it", "it-ch", "iu", "ja", "ji", "ka", "kk", "km", "kn", "ko", "ko-kp", "ko-kr", "ks", "ky", "la", "lb", "lt", "lv", "mi", "mk", "ml", "mo", "mr", "ms", "mt", "my", "nb", "ne", "ng", "nl", "nl-be", "nn", "no", "nv", "oc", "om", "or", "pa", "pa-in", "pa-pk", "pl", "pt", "pt-br", "qu", "rm", "ro", "ro-mo", "ru", "ru-mo", "sa", "sb", "sc", "sd", "sg", "si", "sk", "sl", "so", "sq", "sr", "sv", "sv-fi", "sv-sv", "sw", "sx", "sz", "ta", "te", "th", "tig", "tk", "tlh", "tn", "tr", "ts", "tt", "uk", "ur", "ve", "vi", "vo", "wa", "xh", "zh", "zh-cn", "zh-hk", "zh-sg", "zh-tw", "zu"];
|
|
101
|
-
/**
|
|
102
|
-
* Locale codes
|
|
103
|
-
*
|
|
104
|
-
* Pattern: [Language Code]-[Country Code]
|
|
105
|
-
* */
|
|
106
|
-
export type LocaleCode = typeof LocaleCodeItems[number];
|
package/dist/literals.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LocaleCodeItems = exports.LanguageCodeItems = exports.CountryCodeItems = exports.EnvironmentItems = exports.SeverityItems = exports.HttpPlaceItems = exports.HttpMethodItems = exports.WeakFalseItems = exports.WeakTrueItems = exports.KeyValueItems = exports.RealValueItems = exports.PrimitiveItems = exports.StorageTypeItems = void 0;
|
|
4
|
-
// noinspection JSUnusedGlobalSymbols
|
|
5
|
-
/**
|
|
6
|
-
* Weak True items
|
|
7
|
-
* */
|
|
8
|
-
exports.StorageTypeItems = ['array', 'list', 'map', 'set'];
|
|
9
|
-
/**
|
|
10
|
-
* Weak True items
|
|
11
|
-
* */
|
|
12
|
-
exports.PrimitiveItems = ['string', 'number', 'boolean'];
|
|
13
|
-
/**
|
|
14
|
-
* Weak True items
|
|
15
|
-
* */
|
|
16
|
-
exports.RealValueItems = ['string', 'number', 'bigint', 'boolean', 'object', 'function'];
|
|
17
|
-
/**
|
|
18
|
-
* Weak True items
|
|
19
|
-
* */
|
|
20
|
-
exports.KeyValueItems = ['string', 'number'];
|
|
21
|
-
/**
|
|
22
|
-
* Weak True items
|
|
23
|
-
* */
|
|
24
|
-
exports.WeakTrueItems = ['1', 'true', 't', 'yes', 'y', 'on'];
|
|
25
|
-
/**
|
|
26
|
-
* Weak False items
|
|
27
|
-
* */
|
|
28
|
-
exports.WeakFalseItems = ['0', '-1', 'false', 'f', 'no', 'n', 'off'];
|
|
29
|
-
/**
|
|
30
|
-
* Http Method items
|
|
31
|
-
* */
|
|
32
|
-
exports.HttpMethodItems = ['delete', 'get', 'head', 'link', 'options', 'patch', 'post', 'purge', 'put', 'unlink'];
|
|
33
|
-
/**
|
|
34
|
-
* Http Place items
|
|
35
|
-
* */
|
|
36
|
-
exports.HttpPlaceItems = ['query', 'body', 'header', 'path'];
|
|
37
|
-
/**
|
|
38
|
-
* Severity items
|
|
39
|
-
* */
|
|
40
|
-
exports.SeverityItems = ['debug', 'error', 'fatal', 'info', 'log', 'trace', 'warn'];
|
|
41
|
-
/**
|
|
42
|
-
* Environment items
|
|
43
|
-
* */
|
|
44
|
-
exports.EnvironmentItems = ['automation', 'development', 'local', 'production', 'staging', 'test'];
|
|
45
|
-
/**
|
|
46
|
-
* Country code items
|
|
47
|
-
* */
|
|
48
|
-
exports.CountryCodeItems = ['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AN', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX',
|
|
49
|
-
'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BM', 'BN', 'BO', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD',
|
|
50
|
-
'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CS', 'CU', 'CV', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC',
|
|
51
|
-
'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN',
|
|
52
|
-
'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS',
|
|
53
|
-
'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS',
|
|
54
|
-
'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX',
|
|
55
|
-
'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM',
|
|
56
|
-
'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM',
|
|
57
|
-
'SN', 'SO', 'SR', 'ST', 'SV', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ',
|
|
58
|
-
'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW'];
|
|
59
|
-
/**
|
|
60
|
-
* Language code items
|
|
61
|
-
* */
|
|
62
|
-
exports.LanguageCodeItems = ['af', 'an', 'ar', 'as', 'ast', 'az', 'be', 'bg', 'bn', 'br', 'bs', 'ca', 'ce', 'ch', 'co', 'cr', 'cs',
|
|
63
|
-
'cv', 'cy', 'da', 'de', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fj', 'fo', 'fr', 'fur', 'fy', 'ga', 'gd', 'gl', 'gu', 'he', 'hi',
|
|
64
|
-
'hr', 'hsb', 'ht', 'hu', 'hy', 'id', 'is', 'it', 'iu', 'ja', 'ji', 'ka', 'kk', 'km', 'kn', 'ko', 'ks', 'ky', 'la', 'lb', 'lt', 'lv', 'mi',
|
|
65
|
-
'mk', 'ml', 'mo', 'mr', 'ms', 'mt', 'my', 'nb', 'ne', 'ng', 'nl', 'nn', 'no', 'nv', 'oc', 'om', 'or', 'pa', 'pl', 'pt', 'qu', 'rm', 'ro',
|
|
66
|
-
'ru', 'sa', 'sb', 'sc', 'sd', 'sg', 'si', 'sk', 'sl', 'so', 'sq', 'sr', 'sv', 'sw', 'sx', 'sz', 'ta', 'te', 'th', 'tig', 'tk', 'tlh',
|
|
67
|
-
'tn', 'tr', 'ts', 'tt', 'uk', 'ur', 've', 'vi', 'vo', 'wa', 'xh', 'zh', 'zu'];
|
|
68
|
-
/**
|
|
69
|
-
* Locale code items
|
|
70
|
-
* */
|
|
71
|
-
exports.LocaleCodeItems = ['af', 'an', 'ar', 'ar-ae', 'ar-bh', 'ar-dz', 'ar-eg', 'ar-iq', 'ar-jo', 'ar-kw', 'ar-lb', 'ar-ly',
|
|
72
|
-
'ar-ma', 'ar-om', 'ar-qa', 'ar-sa', 'ar-sy', 'ar-tn', 'ar-ye', 'as', 'ast', 'az', 'be', 'bg', 'bn', 'br', 'bs', 'ca', 'ce', 'ch',
|
|
73
|
-
'co', 'cr', 'cs', 'cv', 'cy', 'da', 'de', 'de-at', 'de-ch', 'de-de', 'de-li', 'de-lu', 'el', 'en', 'en-au', 'en-bz', 'en-ca',
|
|
74
|
-
'en-gb', 'en-ie', 'en-jm', 'en-nz', 'en-ph', 'en-tt', 'en-us', 'en-za', 'en-zw', 'eo', 'es', 'es-ar', 'es-bo', 'es-cl', 'es-co',
|
|
75
|
-
'es-cr', 'es-do', 'es-ec', 'es-es', 'es-gt', 'es-hn', 'es-mx', 'es-ni', 'es-pa', 'es-pe', 'es-pr', 'es-py', 'es-sv', 'es-uy',
|
|
76
|
-
'es-ve', 'et', 'eu', 'fa', 'fa-ir', 'fi', 'fj', 'fo', 'fr', 'fr-be', 'fr-ca', 'fr-ch', 'fr-fr', 'fr-lu', 'fr-mc', 'fur', 'fy', 'ga',
|
|
77
|
-
'gd', 'gd-ie', 'gl', 'gu', 'he', 'hi', 'hr', 'hsb', 'ht', 'hu', 'hy', 'id', 'is', 'it', 'it-ch', 'iu', 'ja', 'ji', 'ka', 'kk', 'km',
|
|
78
|
-
'kn', 'ko', 'ko-kp', 'ko-kr', 'ks', 'ky', 'la', 'lb', 'lt', 'lv', 'mi', 'mk', 'ml', 'mo', 'mr', 'ms', 'mt', 'my', 'nb', 'ne', 'ng', 'nl',
|
|
79
|
-
'nl-be', 'nn', 'no', 'nv', 'oc', 'om', 'or', 'pa', 'pa-in', 'pa-pk', 'pl', 'pt', 'pt-br', 'qu', 'rm', 'ro', 'ro-mo', 'ru', 'ru-mo',
|
|
80
|
-
'sa', 'sb', 'sc', 'sd', 'sg', 'si', 'sk', 'sl', 'so', 'sq', 'sr', 'sv', 'sv-fi', 'sv-sv', 'sw', 'sx', 'sz', 'ta', 'te', 'th', 'tig',
|
|
81
|
-
'tk', 'tlh', 'tn', 'tr', 'ts', 'tt', 'uk', 'ur', 've', 'vi', 'vo', 'wa', 'xh', 'zh', 'zh-cn', 'zh-hk', 'zh-sg', 'zh-tw', 'zu'];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExceptionLike } from "./index-types";
|
|
2
1
|
import { Exception } from "./exception";
|
|
2
|
+
import { ExceptionLike } from "./index-types";
|
|
3
3
|
export declare class MultipleException extends Exception {
|
|
4
4
|
protected _errors: Array<ExceptionLike>;
|
|
5
5
|
constructor(...errors: Array<Error>);
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AssertionOpt } from "./index-types";
|
|
2
1
|
import { Leyyo } from "../leyyo";
|
|
2
|
+
import { AssertionOpt } from "./index-types";
|
|
3
3
|
export declare function assert(flag: boolean, message?: string): void;
|
|
4
4
|
export declare function assert(flag: boolean, opt?: AssertionOpt): void;
|
|
5
5
|
export declare function assert(flag: boolean, fn?: Function): void;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|