@jonloucks/contracts-ts 0.4.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/AutoClose.d.ts +3 -3
- package/api/AutoClose.d.ts.map +1 -1
- package/api/AutoClose.js +17 -9
- package/api/AutoClose.js.map +1 -1
- package/api/AutoCloseFactory.d.ts +5 -3
- package/api/AutoCloseFactory.d.ts.map +1 -1
- package/api/AutoCloseFactory.js +14 -20
- package/api/AutoCloseFactory.js.map +1 -1
- package/api/AutoOpen.d.ts +3 -2
- package/api/AutoOpen.d.ts.map +1 -1
- package/api/AutoOpen.js +3 -3
- package/api/AutoOpen.js.map +1 -1
- package/api/BasicContract.d.ts +8 -2
- package/api/BasicContract.d.ts.map +1 -1
- package/api/BasicContract.js +35 -7
- package/api/BasicContract.js.map +1 -1
- package/api/BindStrategy.d.ts +1 -1
- package/api/BindStrategy.d.ts.map +1 -1
- package/api/BindStrategy.js +2 -2
- package/api/BindStrategy.js.map +1 -1
- package/api/Contract.d.ts +21 -12
- package/api/Contract.d.ts.map +1 -1
- package/api/Contract.js +11 -0
- package/api/Contract.js.map +1 -1
- package/api/ContractException.d.ts +7 -0
- package/api/ContractException.d.ts.map +1 -1
- package/api/ContractException.js +11 -1
- package/api/ContractException.js.map +1 -1
- package/api/ContractFactory.d.ts +8 -1
- package/api/ContractFactory.d.ts.map +1 -1
- package/api/ContractFactory.js +11 -0
- package/api/ContractFactory.js.map +1 -1
- package/api/Contracts.d.ts +10 -3
- package/api/Contracts.d.ts.map +1 -1
- package/api/Contracts.js +12 -0
- package/api/Contracts.js.map +1 -1
- package/api/ContractsFactory.d.ts +8 -1
- package/api/ContractsFactory.d.ts.map +1 -1
- package/api/ContractsFactory.js +11 -0
- package/api/ContractsFactory.js.map +1 -1
- package/api/Open.d.ts +20 -0
- package/api/Open.d.ts.map +1 -0
- package/api/Open.js +14 -0
- package/api/Open.js.map +1 -0
- package/api/Promisor.d.ts +1 -6
- package/api/Promisor.d.ts.map +1 -1
- package/api/Promisor.js +5 -27
- package/api/Promisor.js.map +1 -1
- package/api/PromisorFactory.d.ts +5 -3
- package/api/PromisorFactory.d.ts.map +1 -1
- package/api/PromisorFactory.js +14 -20
- package/api/PromisorFactory.js.map +1 -1
- package/api/RatifiedContract.d.ts +2 -2
- package/api/RatifiedContract.d.ts.map +1 -1
- package/api/RatifiedContract.js +1 -4
- package/api/RatifiedContract.js.map +1 -1
- package/api/Repository.d.ts +8 -5
- package/api/Repository.d.ts.map +1 -1
- package/api/Repository.js +9 -20
- package/api/Repository.js.map +1 -1
- package/api/RepositoryFactory.d.ts +6 -4
- package/api/RepositoryFactory.d.ts.map +1 -1
- package/api/RepositoryFactory.js +13 -20
- package/api/RepositoryFactory.js.map +1 -1
- package/api/Types.d.ts +11 -66
- package/api/Types.d.ts.map +1 -1
- package/api/Types.js +14 -105
- package/api/Types.js.map +1 -1
- package/auxiliary/AtomicBoolean.d.ts +6 -3
- package/auxiliary/AtomicBoolean.d.ts.map +1 -1
- package/auxiliary/AtomicBoolean.js +8 -20
- package/auxiliary/AtomicBoolean.js.map +1 -1
- package/auxiliary/AtomicBooleanFactory.d.ts +6 -4
- package/auxiliary/AtomicBooleanFactory.d.ts.map +1 -1
- package/auxiliary/AtomicBooleanFactory.js +13 -20
- package/auxiliary/AtomicBooleanFactory.js.map +1 -1
- package/auxiliary/AtomicInteger.d.ts +6 -3
- package/auxiliary/AtomicInteger.d.ts.map +1 -1
- package/auxiliary/AtomicInteger.js +8 -20
- package/auxiliary/AtomicInteger.js.map +1 -1
- package/auxiliary/AtomicIntegerFactory.d.ts +6 -4
- package/auxiliary/AtomicIntegerFactory.d.ts.map +1 -1
- package/auxiliary/AtomicIntegerFactory.js +13 -20
- package/auxiliary/AtomicIntegerFactory.js.map +1 -1
- package/auxiliary/AtomicReference.d.ts +6 -4
- package/auxiliary/AtomicReference.d.ts.map +1 -1
- package/auxiliary/AtomicReference.js +8 -20
- package/auxiliary/AtomicReference.js.map +1 -1
- package/auxiliary/AtomicReferenceFactory.d.ts +6 -4
- package/auxiliary/AtomicReferenceFactory.d.ts.map +1 -1
- package/auxiliary/AtomicReferenceFactory.js +13 -20
- package/auxiliary/AtomicReferenceFactory.js.map +1 -1
- package/impl/AtomicBooleanFactory.impl.js +2 -2
- package/impl/AtomicBooleanFactory.impl.js.map +1 -1
- package/impl/AtomicIntegerFactory.impl.js +2 -2
- package/impl/AtomicIntegerFactory.impl.js.map +1 -1
- package/impl/AtomicReferenceFactory.impl.js +2 -2
- package/impl/AtomicReferenceFactory.impl.js.map +1 -1
- package/impl/ContractFactory.impl.js +2 -2
- package/impl/ContractFactory.impl.js.map +1 -1
- package/impl/Contracts.impl.d.ts.map +1 -1
- package/impl/Contracts.impl.js +7 -1
- package/impl/Contracts.impl.js.map +1 -1
- package/impl/ContractsFactory.impl.js +4 -4
- package/impl/ContractsFactory.impl.js.map +1 -1
- package/impl/ContractsWrapper.impl.d.ts.map +1 -1
- package/impl/ContractsWrapper.impl.js +3 -0
- package/impl/ContractsWrapper.impl.js.map +1 -1
- package/impl/Events.d.ts +2 -2
- package/impl/Events.d.ts.map +1 -1
- package/impl/Events.impl.d.ts.map +1 -1
- package/impl/Events.impl.js +3 -0
- package/impl/Events.impl.js.map +1 -1
- package/impl/LifeCyclePromisor.impl.js +2 -2
- package/impl/LifeCyclePromisor.impl.js.map +1 -1
- package/impl/Repository.impl.d.ts.map +1 -1
- package/impl/Repository.impl.js +7 -1
- package/impl/Repository.impl.js.map +1 -1
- package/impl/RepositoryFactory.impl.js +1 -1
- package/impl/RepositoryFactory.impl.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.d.ts.map +1 -1
- package/index.js +7 -7
- package/index.js.map +1 -1
- package/package.json +3 -2
- package/version.d.ts.map +1 -1
- package/version.js +14 -8
- package/version.js.map +1 -1
- package/api/Lawyer.d.ts +0 -19
- package/api/Lawyer.d.ts.map +0 -1
- package/api/Lawyer.js +0 -3
- package/api/Lawyer.js.map +0 -1
- package/auxiliary/ClassCastException.d.ts +0 -8
- package/auxiliary/ClassCastException.d.ts.map +0 -1
- package/auxiliary/ClassCastException.js +0 -18
- package/auxiliary/ClassCastException.js.map +0 -1
package/api/Types.d.ts
CHANGED
|
@@ -38,97 +38,50 @@ export declare function isNotPresent(value: unknown): value is null | undefined;
|
|
|
38
38
|
* @param value the value to check
|
|
39
39
|
* @returns true if value is a function and is not null or undefined
|
|
40
40
|
*/
|
|
41
|
-
export declare function
|
|
42
|
-
/**
|
|
43
|
-
* Check if given value is a function or null/undefined
|
|
44
|
-
* @param value the value to check
|
|
45
|
-
* @returns true if value is a function
|
|
46
|
-
*/
|
|
47
|
-
export declare function isFunction(value: unknown): value is OptionalType<UnknownFunction>;
|
|
41
|
+
export declare function isFunction<T extends UnknownFunction>(value: unknown): value is RequiredType<T>;
|
|
48
42
|
/**
|
|
49
43
|
* Check if given value is an object and is not null or undefined
|
|
50
44
|
* @param value the value to check
|
|
51
45
|
* @returns true if value is an object and is not null or undefined
|
|
52
46
|
*/
|
|
53
|
-
export declare function
|
|
54
|
-
/**
|
|
55
|
-
* Check if given value is an object or null/undefined
|
|
56
|
-
* @param value the value to check
|
|
57
|
-
* @returns true if value is an object
|
|
58
|
-
*/
|
|
59
|
-
export declare function isObject(value: unknown): value is OptionalType<object>;
|
|
60
|
-
/**
|
|
61
|
-
* Check if given value is a string and is not null or undefined
|
|
62
|
-
* @param value the value to check
|
|
63
|
-
* @returns true if value is a string and is not null or undefined
|
|
64
|
-
*/
|
|
65
|
-
export declare function isStringPresent(value: unknown): value is RequiredType<string>;
|
|
47
|
+
export declare function isObject(value: unknown): value is RequiredType<object>;
|
|
66
48
|
/**
|
|
67
|
-
* Check if given value is a string
|
|
49
|
+
* Check if given value is a string
|
|
50
|
+
*
|
|
68
51
|
* @param value the value to check
|
|
69
52
|
* @returns true if value is a string
|
|
70
53
|
*/
|
|
71
|
-
export declare function isString(value: unknown): value is
|
|
54
|
+
export declare function isString(value: unknown): value is RequiredType<string>;
|
|
72
55
|
/**
|
|
73
56
|
* Check if given value is a number and is not null or undefined
|
|
74
57
|
* @param value the value to check
|
|
75
58
|
* @returns true if value is a number and is not null or undefined
|
|
76
59
|
*/
|
|
77
|
-
export declare function
|
|
78
|
-
/**
|
|
79
|
-
* Check if given value is a number or null/undefined
|
|
80
|
-
* @param value the value to check
|
|
81
|
-
* @returns true if value is a number
|
|
82
|
-
*/
|
|
83
|
-
export declare function isNumber(value: unknown): value is OptionalType<number>;
|
|
60
|
+
export declare function isNumber(value: unknown): value is RequiredType<number>;
|
|
84
61
|
/**
|
|
85
62
|
* Check if given value is a symbol and is not null or undefined
|
|
86
63
|
* @param value the value to check
|
|
87
64
|
* @returns true if value is a symbol and is not null or undefined
|
|
88
65
|
*/
|
|
89
|
-
export declare function
|
|
90
|
-
/**
|
|
91
|
-
* Check if given value is a symbol or null/undefined
|
|
92
|
-
* @param value the value to check
|
|
93
|
-
* @returns true if value is a symbol
|
|
94
|
-
*/
|
|
95
|
-
export declare function isSymbol(value: unknown): value is OptionalType<symbol>;
|
|
66
|
+
export declare function isSymbol(value: unknown): value is RequiredType<symbol>;
|
|
96
67
|
/**
|
|
97
68
|
* Check if given value is a boolean and is not null or undefined
|
|
98
69
|
* @param value the value to check
|
|
99
70
|
* @returns true if value is a boolean and is not null or undefined
|
|
100
71
|
*/
|
|
101
|
-
export declare function
|
|
102
|
-
/**
|
|
103
|
-
* Check if given value is a boolean or null/undefined
|
|
104
|
-
* @param value the value to check
|
|
105
|
-
* @returns true if value is a boolean
|
|
106
|
-
*/
|
|
107
|
-
export declare function isBoolean(value: unknown): value is OptionalType<boolean>;
|
|
72
|
+
export declare function isBoolean(value: unknown): value is RequiredType<boolean>;
|
|
108
73
|
/**
|
|
109
74
|
* Check if given value is a bigint and is not null or undefined
|
|
110
75
|
* @param value the value to check
|
|
111
76
|
* @returns true if value is a bigint and is not null or undefined
|
|
112
77
|
*/
|
|
113
|
-
export declare function
|
|
114
|
-
/**
|
|
115
|
-
* Check if given value is a bigint or null/undefined
|
|
116
|
-
* @param value the value to check
|
|
117
|
-
* @returns true if value is a bigint
|
|
118
|
-
*/
|
|
119
|
-
export declare function isBigInt(value: unknown): value is OptionalType<bigint>;
|
|
78
|
+
export declare function isBigInt(value: unknown): value is RequiredType<bigint>;
|
|
120
79
|
/**
|
|
121
80
|
* Check if given value is a constructor and is not null or undefined
|
|
122
81
|
* @param value the value to check
|
|
123
82
|
* @returns true if value is a constructor and is not null or undefined
|
|
124
83
|
*/
|
|
125
|
-
export declare function
|
|
126
|
-
/**
|
|
127
|
-
* Check if given value is a constructor or null/undefined
|
|
128
|
-
* @param value the value to check
|
|
129
|
-
* @returns true if value is a constructor
|
|
130
|
-
*/
|
|
131
|
-
export declare function isConstructor<T>(value: unknown): value is OptionalType<(new () => T)>;
|
|
84
|
+
export declare function isConstructor<T>(value: unknown): value is RequiredType<(new () => T)>;
|
|
132
85
|
/**
|
|
133
86
|
* Check if given value has defined properties
|
|
134
87
|
* Note: if the value is present is required to have all the functions defined
|
|
@@ -137,13 +90,5 @@ export declare function isConstructor<T>(value: unknown): value is OptionalType<
|
|
|
137
90
|
* @param propertyNames the property names to check
|
|
138
91
|
* @returns true if property is defined
|
|
139
92
|
*/
|
|
140
|
-
export declare function
|
|
141
|
-
/**
|
|
142
|
-
* Check if given value has defined properties
|
|
143
|
-
*
|
|
144
|
-
* @param value the value to check
|
|
145
|
-
* @param propertyNames the property names to check
|
|
146
|
-
* @returns true if property is defined
|
|
147
|
-
*/
|
|
148
|
-
export declare function hasFunctionsPresent(value: unknown, ...propertyNames: (string | symbol)[]): value is RequiredType<UnknownFunction>;
|
|
93
|
+
export declare function guardFunctions(value: unknown, ...propertyNames: (string | symbol)[]): value is RequiredType<UnknownFunction>;
|
|
149
94
|
//# sourceMappingURL=Types.d.ts.map
|
package/api/Types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../src/api/Types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,EAAE,CAAC;IAC7B,SAAS,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;CAChD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC,CAAC,CAAC,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,SAAS,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../src/api/Types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,EAAE,CAAC;IAC7B,SAAS,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;CAChD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC,CAAC,CAAC,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,SAAS,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,eAAe,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC,CAAC,CAAC,CAE9F;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC,MAAM,CAAC,CAEtE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC,MAAM,CAAC,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC,MAAM,CAAC,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC,MAAM,CAAC,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC,OAAO,CAAC,CAExE;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC,MAAM,CAAC,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAErF;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,aAAa,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,YAAY,CAAC,eAAe,CAAC,CAW5H"}
|
package/api/Types.js
CHANGED
|
@@ -5,24 +5,15 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.isPresent = isPresent;
|
|
7
7
|
exports.isNotPresent = isNotPresent;
|
|
8
|
-
exports.isFunctionPresent = isFunctionPresent;
|
|
9
8
|
exports.isFunction = isFunction;
|
|
10
|
-
exports.isObjectPresent = isObjectPresent;
|
|
11
9
|
exports.isObject = isObject;
|
|
12
|
-
exports.isStringPresent = isStringPresent;
|
|
13
10
|
exports.isString = isString;
|
|
14
|
-
exports.isNumberPresent = isNumberPresent;
|
|
15
11
|
exports.isNumber = isNumber;
|
|
16
|
-
exports.isSymbolPresent = isSymbolPresent;
|
|
17
12
|
exports.isSymbol = isSymbol;
|
|
18
|
-
exports.isBooleanPresent = isBooleanPresent;
|
|
19
13
|
exports.isBoolean = isBoolean;
|
|
20
|
-
exports.isBigIntPresent = isBigIntPresent;
|
|
21
14
|
exports.isBigInt = isBigInt;
|
|
22
|
-
exports.isConstructorPresent = isConstructorPresent;
|
|
23
15
|
exports.isConstructor = isConstructor;
|
|
24
|
-
exports.
|
|
25
|
-
exports.hasFunctionsPresent = hasFunctionsPresent;
|
|
16
|
+
exports.guardFunctions = guardFunctions;
|
|
26
17
|
/**
|
|
27
18
|
* Check iif given value is not null or undefined
|
|
28
19
|
*
|
|
@@ -46,128 +37,65 @@ function isNotPresent(value) {
|
|
|
46
37
|
* @param value the value to check
|
|
47
38
|
* @returns true if value is a function and is not null or undefined
|
|
48
39
|
*/
|
|
49
|
-
function isFunctionPresent(value) {
|
|
50
|
-
return _typeOfPresent(value, "function");
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Check if given value is a function or null/undefined
|
|
54
|
-
* @param value the value to check
|
|
55
|
-
* @returns true if value is a function
|
|
56
|
-
*/
|
|
57
40
|
function isFunction(value) {
|
|
58
|
-
return
|
|
41
|
+
return isPresent(value) && typeof value === "function";
|
|
59
42
|
}
|
|
60
43
|
/**
|
|
61
44
|
* Check if given value is an object and is not null or undefined
|
|
62
45
|
* @param value the value to check
|
|
63
46
|
* @returns true if value is an object and is not null or undefined
|
|
64
47
|
*/
|
|
65
|
-
function isObjectPresent(value) {
|
|
66
|
-
return _typeOfPresent(value, "object");
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Check if given value is an object or null/undefined
|
|
70
|
-
* @param value the value to check
|
|
71
|
-
* @returns true if value is an object
|
|
72
|
-
*/
|
|
73
48
|
function isObject(value) {
|
|
74
|
-
return
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Check if given value is a string and is not null or undefined
|
|
78
|
-
* @param value the value to check
|
|
79
|
-
* @returns true if value is a string and is not null or undefined
|
|
80
|
-
*/
|
|
81
|
-
function isStringPresent(value) {
|
|
82
|
-
return _typeOfPresent(value, "string");
|
|
49
|
+
return isPresent(value) && typeof value === "object";
|
|
83
50
|
}
|
|
84
51
|
/**
|
|
85
|
-
* Check if given value is a string
|
|
52
|
+
* Check if given value is a string
|
|
53
|
+
*
|
|
86
54
|
* @param value the value to check
|
|
87
55
|
* @returns true if value is a string
|
|
88
56
|
*/
|
|
89
57
|
function isString(value) {
|
|
90
|
-
return
|
|
58
|
+
return isPresent(value) && typeof value === "string";
|
|
91
59
|
}
|
|
92
60
|
/**
|
|
93
61
|
* Check if given value is a number and is not null or undefined
|
|
94
62
|
* @param value the value to check
|
|
95
63
|
* @returns true if value is a number and is not null or undefined
|
|
96
64
|
*/
|
|
97
|
-
function isNumberPresent(value) {
|
|
98
|
-
return _typeOfPresent(value, "number");
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Check if given value is a number or null/undefined
|
|
102
|
-
* @param value the value to check
|
|
103
|
-
* @returns true if value is a number
|
|
104
|
-
*/
|
|
105
65
|
function isNumber(value) {
|
|
106
|
-
return
|
|
66
|
+
return isPresent(value) && typeof value === "number";
|
|
107
67
|
}
|
|
108
68
|
/**
|
|
109
69
|
* Check if given value is a symbol and is not null or undefined
|
|
110
70
|
* @param value the value to check
|
|
111
71
|
* @returns true if value is a symbol and is not null or undefined
|
|
112
72
|
*/
|
|
113
|
-
function isSymbolPresent(value) {
|
|
114
|
-
return _typeOfPresent(value, "symbol");
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Check if given value is a symbol or null/undefined
|
|
118
|
-
* @param value the value to check
|
|
119
|
-
* @returns true if value is a symbol
|
|
120
|
-
*/
|
|
121
73
|
function isSymbol(value) {
|
|
122
|
-
return
|
|
74
|
+
return isPresent(value) && typeof value === "symbol";
|
|
123
75
|
}
|
|
124
76
|
/**
|
|
125
77
|
* Check if given value is a boolean and is not null or undefined
|
|
126
78
|
* @param value the value to check
|
|
127
79
|
* @returns true if value is a boolean and is not null or undefined
|
|
128
80
|
*/
|
|
129
|
-
function isBooleanPresent(value) {
|
|
130
|
-
return _typeOfPresent(value, "boolean");
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Check if given value is a boolean or null/undefined
|
|
134
|
-
* @param value the value to check
|
|
135
|
-
* @returns true if value is a boolean
|
|
136
|
-
*/
|
|
137
81
|
function isBoolean(value) {
|
|
138
|
-
return
|
|
82
|
+
return isPresent(value) && typeof value === "boolean";
|
|
139
83
|
}
|
|
140
84
|
/**
|
|
141
85
|
* Check if given value is a bigint and is not null or undefined
|
|
142
86
|
* @param value the value to check
|
|
143
87
|
* @returns true if value is a bigint and is not null or undefined
|
|
144
88
|
*/
|
|
145
|
-
function isBigIntPresent(value) {
|
|
146
|
-
return _typeOfPresent(value, "bigint");
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Check if given value is a bigint or null/undefined
|
|
150
|
-
* @param value the value to check
|
|
151
|
-
* @returns true if value is a bigint
|
|
152
|
-
*/
|
|
153
89
|
function isBigInt(value) {
|
|
154
|
-
return
|
|
90
|
+
return isPresent(value) && typeof value === "bigint";
|
|
155
91
|
}
|
|
156
92
|
/**
|
|
157
93
|
* Check if given value is a constructor and is not null or undefined
|
|
158
94
|
* @param value the value to check
|
|
159
95
|
* @returns true if value is a constructor and is not null or undefined
|
|
160
96
|
*/
|
|
161
|
-
function isConstructorPresent(value) {
|
|
162
|
-
return isFunctionPresent(value) && 'prototype' in value && 'constructor' in value;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Check if given value is a constructor or null/undefined
|
|
166
|
-
* @param value the value to check
|
|
167
|
-
* @returns true if value is a constructor
|
|
168
|
-
*/
|
|
169
97
|
function isConstructor(value) {
|
|
170
|
-
return
|
|
98
|
+
return isFunction(value) && 'prototype' in value && 'constructor' in value;
|
|
171
99
|
}
|
|
172
100
|
/**
|
|
173
101
|
* Check if given value has defined properties
|
|
@@ -177,32 +105,13 @@ function isConstructor(value) {
|
|
|
177
105
|
* @param propertyNames the property names to check
|
|
178
106
|
* @returns true if property is defined
|
|
179
107
|
*/
|
|
180
|
-
function
|
|
181
|
-
return _hasFunctions(value, propertyNames, false);
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Check if given value has defined properties
|
|
185
|
-
*
|
|
186
|
-
* @param value the value to check
|
|
187
|
-
* @param propertyNames the property names to check
|
|
188
|
-
* @returns true if property is defined
|
|
189
|
-
*/
|
|
190
|
-
function hasFunctionsPresent(value, ...propertyNames) {
|
|
191
|
-
return _hasFunctions(value, propertyNames, true);
|
|
192
|
-
}
|
|
193
|
-
function _isTypeOf(value, type) {
|
|
194
|
-
return isNotPresent(value) || _typeOfPresent(value, type);
|
|
195
|
-
}
|
|
196
|
-
function _typeOfPresent(value, type) {
|
|
197
|
-
return isPresent(value) && typeof value === type;
|
|
198
|
-
}
|
|
199
|
-
function _hasFunctions(value, propertyNames, required) {
|
|
108
|
+
function guardFunctions(value, ...propertyNames) {
|
|
200
109
|
if (isNotPresent(value)) {
|
|
201
|
-
return
|
|
110
|
+
return false;
|
|
202
111
|
}
|
|
203
112
|
const record = value;
|
|
204
113
|
for (const propertyName of propertyNames) {
|
|
205
|
-
if (!
|
|
114
|
+
if (!isFunction(record[propertyName])) {
|
|
206
115
|
return false;
|
|
207
116
|
}
|
|
208
117
|
}
|
package/api/Types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Types.js","sourceRoot":"","sources":["../../src/api/Types.ts"],"names":[],"mappings":";AAAA;;GAEG;;AA8BH,8BAEC;AAQD,oCAEC;AAOD,
|
|
1
|
+
{"version":3,"file":"Types.js","sourceRoot":"","sources":["../../src/api/Types.ts"],"names":[],"mappings":";AAAA;;GAEG;;AA8BH,8BAEC;AAQD,oCAEC;AAOD,gCAEC;AAOD,4BAEC;AAQD,4BAEC;AAOD,4BAEC;AAOD,4BAEC;AAOD,8BAEC;AAOD,4BAEC;AAOD,sCAEC;AAUD,wCAWC;AAhHD;;;;;GAKG;AACH,SAAgB,SAAS,CAAI,KAAc;IACzC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC;AAED;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,KAAc;IACzC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,SAAgB,UAAU,CAA4B,KAAc;IAClE,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,UAAU,CAAC;AACzD,CAAC;AAED;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAC,KAAc;IACtC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,SAAS,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAAI,KAAc;IAC7C,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,WAAW,IAAI,KAAK,IAAI,aAAa,IAAI,KAAK,CAAA;AAC5E,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,KAAc,EAAE,GAAG,aAAkC;IAClF,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,MAAM,GAAG,KAAyC,CAAC;IACzD,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QACzC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;YACtC,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
2
2
|
/**
|
|
3
3
|
* Responsibility: An atomic boolean interface for thread-safe boolean operations.
|
|
4
4
|
*/
|
|
@@ -27,7 +27,10 @@ export interface AtomicBoolean {
|
|
|
27
27
|
[Symbol.toPrimitive](hint: string): string | boolean | number;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Type guard for AtomicBoolean interface.
|
|
31
|
+
*
|
|
32
|
+
* @param instance the instance to check
|
|
33
|
+
* @returns true if the instance implements AtomicBoolean
|
|
31
34
|
*/
|
|
32
|
-
export declare
|
|
35
|
+
export declare function guard(instance: unknown): instance is RequiredType<AtomicBoolean>;
|
|
33
36
|
//# sourceMappingURL=AtomicBoolean.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicBoolean.d.ts","sourceRoot":"","sources":["../../src/auxiliary/AtomicBoolean.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AtomicBoolean.d.ts","sourceRoot":"","sources":["../../src/auxiliary/AtomicBoolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAkB,MAAM,mCAAmC,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,aAAa;IAE1B;;OAEG;IACH,GAAG,IAAI,OAAO,CAAC;IAEf;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAE7B;;;;;;OAMG;IACH,aAAa,CAAC,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC;IAElE;;;OAGG;IACH,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;CACjE;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,aAAa,CAAC,CAEhF"}
|
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const RatifiedContract_1 = require("@jonloucks/contracts-ts/api/RatifiedContract");
|
|
3
|
+
exports.guard = guard;
|
|
5
4
|
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
6
|
+
* Type guard for AtomicBoolean interface.
|
|
7
|
+
*
|
|
8
|
+
* @param instance the instance to check
|
|
9
|
+
* @returns true if the instance implements AtomicBoolean
|
|
8
10
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
isDeliverable(instance) {
|
|
14
|
-
return (0, Types_1.hasFunctions)(instance, "compareAndSet", "get", "set");
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Lawyer.createContract override
|
|
18
|
-
*/
|
|
19
|
-
createContract(config) {
|
|
20
|
-
const copy = { ...config ?? {} };
|
|
21
|
-
copy.test ?? (copy.test = this.isDeliverable);
|
|
22
|
-
copy.typeName ?? (copy.typeName = "AtomicBoolean");
|
|
23
|
-
return (0, RatifiedContract_1.create)(copy);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
11
|
+
function guard(instance) {
|
|
12
|
+
return (0, Types_1.guardFunctions)(instance, "compareAndSet", "get", "set");
|
|
13
|
+
}
|
|
26
14
|
//# sourceMappingURL=AtomicBoolean.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicBoolean.js","sourceRoot":"","sources":["../../src/auxiliary/AtomicBoolean.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AtomicBoolean.js","sourceRoot":"","sources":["../../src/auxiliary/AtomicBoolean.ts"],"names":[],"mappings":";;AAwCA,sBAEC;AA1CD,6DAAiF;AAkCjF;;;;;GAKG;AACH,SAAgB,KAAK,CAAC,QAAiB;IACnC,OAAO,IAAA,sBAAc,EAAC,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Contract } from "@jonloucks/contracts-ts/api/Contract";
|
|
2
|
-
import { Lawyer } from "@jonloucks/contracts-ts/api/Lawyer";
|
|
3
2
|
import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
4
3
|
import { AtomicBoolean } from "@jonloucks/contracts-ts/auxiliary/AtomicBoolean";
|
|
5
4
|
/**
|
|
@@ -10,12 +9,15 @@ export interface AtomicBooleanFactory {
|
|
|
10
9
|
* Create a new AtomicBoolean instance.
|
|
11
10
|
* @param initialValue the initial value of the AtomicBoolean
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
createAtomicBoolean(initialValue?: boolean): RequiredType<AtomicBoolean>;
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
|
-
*
|
|
15
|
+
* Type guard for AtomicBooleanFactory interface.
|
|
16
|
+
*
|
|
17
|
+
* @param instance the instance to check
|
|
18
|
+
* @returns true if the instance implements AtomicBooleanFactory
|
|
17
19
|
*/
|
|
18
|
-
export declare
|
|
20
|
+
export declare function guard(instance: unknown): instance is RequiredType<AtomicBooleanFactory>;
|
|
19
21
|
/**
|
|
20
22
|
* The factory Contract for creating new AtomicBoolean instances.
|
|
21
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicBooleanFactory.d.ts","sourceRoot":"","sources":["../../src/auxiliary/AtomicBooleanFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"AtomicBooleanFactory.d.ts","sourceRoot":"","sources":["../../src/auxiliary/AtomicBooleanFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAkB,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IAEnC;;;OAGG;IACH,mBAAmB,CAAC,YAAY,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;CAC1E;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,oBAAoB,CAAC,CAEvF;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,oBAAoB,CAGlD,CAAC"}
|
|
@@ -1,30 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CONTRACT =
|
|
3
|
+
exports.CONTRACT = void 0;
|
|
4
|
+
exports.guard = guard;
|
|
4
5
|
const RatifiedContract_1 = require("@jonloucks/contracts-ts/api/RatifiedContract");
|
|
5
6
|
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* Type guard for AtomicBooleanFactory interface.
|
|
9
|
+
*
|
|
10
|
+
* @param instance the instance to check
|
|
11
|
+
* @returns true if the instance implements AtomicBooleanFactory
|
|
8
12
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
isDeliverable(instance) {
|
|
14
|
-
return (0, Types_1.hasFunctions)(instance, "create");
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Lawyer.createContract override
|
|
18
|
-
*/
|
|
19
|
-
createContract(config) {
|
|
20
|
-
const copy = { ...config ?? {} };
|
|
21
|
-
copy.test ?? (copy.test = this.isDeliverable);
|
|
22
|
-
copy.typeName ?? (copy.typeName = "AtomicBooleanFactory");
|
|
23
|
-
return (0, RatifiedContract_1.create)(copy);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
13
|
+
function guard(instance) {
|
|
14
|
+
return (0, Types_1.guardFunctions)(instance, "createAtomicBoolean");
|
|
15
|
+
}
|
|
26
16
|
/**
|
|
27
17
|
* The factory Contract for creating new AtomicBoolean instances.
|
|
28
18
|
*/
|
|
29
|
-
exports.CONTRACT =
|
|
19
|
+
exports.CONTRACT = (0, RatifiedContract_1.create)({
|
|
20
|
+
test: guard,
|
|
21
|
+
name: "AtomicBooleanFactory"
|
|
22
|
+
});
|
|
30
23
|
//# sourceMappingURL=AtomicBooleanFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicBooleanFactory.js","sourceRoot":"","sources":["../../src/auxiliary/AtomicBooleanFactory.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AtomicBooleanFactory.js","sourceRoot":"","sources":["../../src/auxiliary/AtomicBooleanFactory.ts"],"names":[],"mappings":";;;AAuBA,sBAEC;AAxBD,mFAAwF;AACxF,6DAAiF;AAejF;;;;;GAKG;AACH,SAAgB,KAAK,CAAC,QAAiB;IACrC,OAAO,IAAA,sBAAc,EAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;AACzD,CAAC;AAED;;GAEG;AACU,QAAA,QAAQ,GAAmC,IAAA,yBAAc,EAAC;IACrE,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,sBAAsB;CAC7B,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
2
2
|
/**
|
|
3
3
|
* Responsibility: An atomic integer interface for thread-safe integer operations.
|
|
4
4
|
*/
|
|
@@ -36,7 +36,10 @@ export interface AtomicInteger {
|
|
|
36
36
|
[Symbol.toPrimitive](hint: string): string | number | boolean;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Type guard for AtomicInteger interface.
|
|
40
|
+
*
|
|
41
|
+
* @param instance the instance to check
|
|
42
|
+
* @returns true if the instance implements AtomicInteger
|
|
40
43
|
*/
|
|
41
|
-
export declare
|
|
44
|
+
export declare function guard(instance: unknown): instance is RequiredType<AtomicInteger>;
|
|
42
45
|
//# sourceMappingURL=AtomicInteger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicInteger.d.ts","sourceRoot":"","sources":["../../src/auxiliary/AtomicInteger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AtomicInteger.d.ts","sourceRoot":"","sources":["../../src/auxiliary/AtomicInteger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAkB,MAAM,mCAAmC,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,aAAa;IAE1B;;OAEG;IACH,GAAG,IAAI,MAAM,CAAC;IAEd;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;;;;OAKG;IACH,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAEhE;;;OAGG;IACH,eAAe,IAAI,MAAM,CAAC;IAE1B;;;OAGG;IACH,eAAe,IAAI,MAAM,CAAC;IAE1B;;;OAGG;IACH,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CACjE;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,aAAa,CAAC,CAEhF"}
|
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const RatifiedContract_1 = require("@jonloucks/contracts-ts/api/RatifiedContract");
|
|
3
|
+
exports.guard = guard;
|
|
5
4
|
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
6
|
+
* Type guard for AtomicInteger interface.
|
|
7
|
+
*
|
|
8
|
+
* @param instance the instance to check
|
|
9
|
+
* @returns true if the instance implements AtomicInteger
|
|
8
10
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
isDeliverable(instance) {
|
|
14
|
-
return (0, Types_1.hasFunctions)(instance, "compareAndSet", "incrementAndGet", "decrementAndGet", "get", "set");
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Lawyer.createContract override
|
|
18
|
-
*/
|
|
19
|
-
createContract(config) {
|
|
20
|
-
const copy = { ...config ?? {} };
|
|
21
|
-
copy.test ?? (copy.test = this.isDeliverable);
|
|
22
|
-
copy.typeName ?? (copy.typeName = "AtomicInteger");
|
|
23
|
-
return (0, RatifiedContract_1.create)(copy);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
11
|
+
function guard(instance) {
|
|
12
|
+
return (0, Types_1.guardFunctions)(instance, "compareAndSet", "incrementAndGet", "decrementAndGet", "get", "set");
|
|
13
|
+
}
|
|
26
14
|
//# sourceMappingURL=AtomicInteger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicInteger.js","sourceRoot":"","sources":["../../src/auxiliary/AtomicInteger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AtomicInteger.js","sourceRoot":"","sources":["../../src/auxiliary/AtomicInteger.ts"],"names":[],"mappings":";;AAmDA,sBAEC;AArDD,6DAAiF;AA6CjF;;;;;GAKG;AACH,SAAgB,KAAK,CAAC,QAAiB;IACnC,OAAO,IAAA,sBAAc,EAAC,QAAQ,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACzG,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Contract } from "@jonloucks/contracts-ts/api/Contract";
|
|
2
|
-
import { Lawyer } from "@jonloucks/contracts-ts/api/Lawyer";
|
|
3
2
|
import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
4
3
|
import { AtomicInteger } from "@jonloucks/contracts-ts/auxiliary/AtomicInteger";
|
|
5
4
|
/**
|
|
@@ -10,12 +9,15 @@ export interface AtomicIntegerFactory {
|
|
|
10
9
|
* Create a new AtomicInteger instance.
|
|
11
10
|
* @param initialValue the initial value of the AtomicInteger
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
createAtomicInteger(initialValue?: number): RequiredType<AtomicInteger>;
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
|
-
*
|
|
15
|
+
* Type guard for AtomicIntegerFactory interface.
|
|
16
|
+
*
|
|
17
|
+
* @param instance the instance to check
|
|
18
|
+
* @returns true if the instance implements AtomicIntegerFactory
|
|
17
19
|
*/
|
|
18
|
-
export declare
|
|
20
|
+
export declare function guard(instance: unknown): instance is RequiredType<AtomicIntegerFactory>;
|
|
19
21
|
/**
|
|
20
22
|
* The factory Contract for creating new AtomicInteger instances.
|
|
21
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicIntegerFactory.d.ts","sourceRoot":"","sources":["../../src/auxiliary/AtomicIntegerFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"AtomicIntegerFactory.d.ts","sourceRoot":"","sources":["../../src/auxiliary/AtomicIntegerFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAkB,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IAEjC;;;OAGG;IACH,mBAAmB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;CAC3E;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,oBAAoB,CAAC,CAEvF;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,oBAAoB,CAGlD,CAAC"}
|