@jonloucks/contracts-ts 0.5.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 -5
- package/api/AutoClose.d.ts.map +1 -1
- package/api/AutoClose.js +14 -7
- package/api/AutoClose.js.map +1 -1
- package/api/AutoCloseFactory.d.ts +2 -11
- package/api/AutoCloseFactory.d.ts.map +1 -1
- package/api/AutoCloseFactory.js +4 -25
- package/api/AutoCloseFactory.js.map +1 -1
- package/api/AutoOpen.d.ts +3 -5
- package/api/AutoOpen.d.ts.map +1 -1
- package/api/AutoOpen.js +1 -2
- 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 +0 -3
- package/api/BindStrategy.d.ts.map +1 -1
- package/api/BindStrategy.js +0 -1
- package/api/BindStrategy.js.map +1 -1
- package/api/Contract.d.ts +15 -13
- package/api/Contract.d.ts.map +1 -1
- package/api/Contract.js +1 -1
- package/api/Contract.js.map +1 -1
- package/api/ContractFactory.d.ts +2 -2
- package/api/ContractFactory.d.ts.map +1 -1
- package/api/ContractFactory.js +1 -1
- package/api/ContractFactory.js.map +1 -1
- package/api/Contracts.d.ts +4 -4
- package/api/Contracts.d.ts.map +1 -1
- package/api/Contracts.js +2 -2
- package/api/Contracts.js.map +1 -1
- package/api/ContractsFactory.d.ts +2 -2
- package/api/ContractsFactory.d.ts.map +1 -1
- package/api/ContractsFactory.js +1 -1
- 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 -10
- package/api/Promisor.d.ts.map +1 -1
- package/api/Promisor.js +2 -26
- package/api/Promisor.js.map +1 -1
- package/api/PromisorFactory.d.ts +1 -7
- package/api/PromisorFactory.d.ts.map +1 -1
- package/api/PromisorFactory.js +4 -24
- 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 +4 -9
- package/api/Repository.d.ts.map +1 -1
- package/api/Repository.js +2 -25
- package/api/Repository.js.map +1 -1
- package/api/RepositoryFactory.d.ts +2 -8
- package/api/RepositoryFactory.d.ts.map +1 -1
- package/api/RepositoryFactory.js +2 -23
- 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 +2 -11
- package/auxiliary/AtomicBoolean.d.ts.map +1 -1
- package/auxiliary/AtomicBoolean.js +1 -25
- package/auxiliary/AtomicBoolean.js.map +1 -1
- package/auxiliary/AtomicBooleanFactory.d.ts +3 -12
- package/auxiliary/AtomicBooleanFactory.d.ts.map +1 -1
- package/auxiliary/AtomicBooleanFactory.js +2 -24
- package/auxiliary/AtomicBooleanFactory.js.map +1 -1
- package/auxiliary/AtomicInteger.d.ts +2 -11
- package/auxiliary/AtomicInteger.d.ts.map +1 -1
- package/auxiliary/AtomicInteger.js +1 -25
- package/auxiliary/AtomicInteger.js.map +1 -1
- package/auxiliary/AtomicIntegerFactory.d.ts +3 -12
- package/auxiliary/AtomicIntegerFactory.d.ts.map +1 -1
- package/auxiliary/AtomicIntegerFactory.js +2 -24
- package/auxiliary/AtomicIntegerFactory.js.map +1 -1
- package/auxiliary/AtomicReference.d.ts +2 -11
- package/auxiliary/AtomicReference.d.ts.map +1 -1
- package/auxiliary/AtomicReference.js +1 -25
- package/auxiliary/AtomicReference.js.map +1 -1
- package/auxiliary/AtomicReferenceFactory.d.ts +2 -11
- package/auxiliary/AtomicReferenceFactory.d.ts.map +1 -1
- package/auxiliary/AtomicReferenceFactory.js +2 -24
- 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 +2 -2
- package/api/Lawyer.d.ts +0 -20
- 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.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,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OptionalType } from "@jonloucks/contracts-ts/api/Types";
|
|
1
|
+
import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
3
2
|
/**
|
|
4
3
|
* Responsibility: An atomic boolean interface for thread-safe boolean operations.
|
|
5
4
|
*/
|
|
@@ -33,13 +32,5 @@ export interface AtomicBoolean {
|
|
|
33
32
|
* @param instance the instance to check
|
|
34
33
|
* @returns true if the instance implements AtomicBoolean
|
|
35
34
|
*/
|
|
36
|
-
export declare function guard(instance: unknown): instance is
|
|
37
|
-
/** @deprecated use guard instead
|
|
38
|
-
*/
|
|
39
|
-
export { guard as isAtomicBoolean };
|
|
40
|
-
/**
|
|
41
|
-
* For creating a Contract for AtomicBoolean with duck-typing checks.
|
|
42
|
-
* @deprecated create a contract using typeGuard directly
|
|
43
|
-
*/
|
|
44
|
-
export declare const LAWYER: Lawyer<AtomicBoolean>;
|
|
35
|
+
export declare function guard(instance: unknown): instance is RequiredType<AtomicBoolean>;
|
|
45
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,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LAWYER = void 0;
|
|
4
3
|
exports.guard = guard;
|
|
5
|
-
exports.isAtomicBoolean = guard;
|
|
6
|
-
const RatifiedContract_1 = require("@jonloucks/contracts-ts/api/RatifiedContract");
|
|
7
4
|
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
8
5
|
/**
|
|
9
6
|
* Type guard for AtomicBoolean interface.
|
|
@@ -12,27 +9,6 @@ const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
|
12
9
|
* @returns true if the instance implements AtomicBoolean
|
|
13
10
|
*/
|
|
14
11
|
function guard(instance) {
|
|
15
|
-
return (0, Types_1.
|
|
12
|
+
return (0, Types_1.guardFunctions)(instance, "compareAndSet", "get", "set");
|
|
16
13
|
}
|
|
17
|
-
/**
|
|
18
|
-
* For creating a Contract for AtomicBoolean with duck-typing checks.
|
|
19
|
-
* @deprecated create a contract using typeGuard directly
|
|
20
|
-
*/
|
|
21
|
-
exports.LAWYER = new class {
|
|
22
|
-
/**
|
|
23
|
-
* Lawyer.isDeliverable override
|
|
24
|
-
*/
|
|
25
|
-
isDeliverable(instance) {
|
|
26
|
-
return guard(instance);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Lawyer.createContract override
|
|
30
|
-
*/
|
|
31
|
-
createContract(config) {
|
|
32
|
-
const copy = { ...config ?? {} };
|
|
33
|
-
copy.test ?? (copy.test = this.isDeliverable);
|
|
34
|
-
copy.typeName ?? (copy.typeName = "AtomicBoolean");
|
|
35
|
-
return (0, RatifiedContract_1.create)(copy);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
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,6 +1,5 @@
|
|
|
1
1
|
import { Contract } from "@jonloucks/contracts-ts/api/Contract";
|
|
2
|
-
import {
|
|
3
|
-
import { OptionalType, RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
2
|
+
import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
4
3
|
import { AtomicBoolean } from "@jonloucks/contracts-ts/auxiliary/AtomicBoolean";
|
|
5
4
|
/**
|
|
6
5
|
* Factory interface for creating AtomicBoolean instances.
|
|
@@ -10,7 +9,7 @@ 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.
|
|
@@ -18,15 +17,7 @@ export interface AtomicBooleanFactory {
|
|
|
18
17
|
* @param instance the instance to check
|
|
19
18
|
* @returns true if the instance implements AtomicBooleanFactory
|
|
20
19
|
*/
|
|
21
|
-
export declare function guard(instance: unknown): instance is
|
|
22
|
-
/** @deprecated use guard instead
|
|
23
|
-
*/
|
|
24
|
-
export { guard as isAtomicBooleanFactory };
|
|
25
|
-
/**
|
|
26
|
-
* For creating a Contract for AtomicBoolean with duck-typing checks.
|
|
27
|
-
* @deprecated use CONTRACT instead
|
|
28
|
-
*/
|
|
29
|
-
export declare const LAWYER: Lawyer<AtomicBooleanFactory>;
|
|
20
|
+
export declare function guard(instance: unknown): instance is RequiredType<AtomicBooleanFactory>;
|
|
30
21
|
/**
|
|
31
22
|
* The factory Contract for creating new AtomicBoolean instances.
|
|
32
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,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CONTRACT =
|
|
3
|
+
exports.CONTRACT = void 0;
|
|
4
4
|
exports.guard = guard;
|
|
5
|
-
exports.isAtomicBooleanFactory = guard;
|
|
6
5
|
const RatifiedContract_1 = require("@jonloucks/contracts-ts/api/RatifiedContract");
|
|
7
6
|
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
8
7
|
/**
|
|
@@ -12,29 +11,8 @@ const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
|
12
11
|
* @returns true if the instance implements AtomicBooleanFactory
|
|
13
12
|
*/
|
|
14
13
|
function guard(instance) {
|
|
15
|
-
return (0, Types_1.
|
|
14
|
+
return (0, Types_1.guardFunctions)(instance, "createAtomicBoolean");
|
|
16
15
|
}
|
|
17
|
-
/**
|
|
18
|
-
* For creating a Contract for AtomicBoolean with duck-typing checks.
|
|
19
|
-
* @deprecated use CONTRACT instead
|
|
20
|
-
*/
|
|
21
|
-
exports.LAWYER = new class {
|
|
22
|
-
/**
|
|
23
|
-
* Lawyer.isDeliverable override
|
|
24
|
-
*/
|
|
25
|
-
isDeliverable(instance) {
|
|
26
|
-
return guard(instance);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Lawyer.createContract override
|
|
30
|
-
*/
|
|
31
|
-
createContract(config) {
|
|
32
|
-
const copy = { ...config ?? {} };
|
|
33
|
-
copy.test ?? (copy.test = this.isDeliverable);
|
|
34
|
-
copy.typeName ?? (copy.typeName = "AtomicBooleanFactory");
|
|
35
|
-
return (0, RatifiedContract_1.create)(copy);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
16
|
/**
|
|
39
17
|
* The factory Contract for creating new AtomicBoolean instances.
|
|
40
18
|
*/
|
|
@@ -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,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OptionalType } from "@jonloucks/contracts-ts/api/Types";
|
|
1
|
+
import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
3
2
|
/**
|
|
4
3
|
* Responsibility: An atomic integer interface for thread-safe integer operations.
|
|
5
4
|
*/
|
|
@@ -42,13 +41,5 @@ export interface AtomicInteger {
|
|
|
42
41
|
* @param instance the instance to check
|
|
43
42
|
* @returns true if the instance implements AtomicInteger
|
|
44
43
|
*/
|
|
45
|
-
export declare function guard(instance: unknown): instance is
|
|
46
|
-
/** @deprecated use guard instead
|
|
47
|
-
*/
|
|
48
|
-
export { guard as isAtomicInteger };
|
|
49
|
-
/**
|
|
50
|
-
* For creating a Contract for AtomicInteger with duck-typing checks.
|
|
51
|
-
* @deprecated create a contract using guard directly
|
|
52
|
-
*/
|
|
53
|
-
export declare const LAWYER: Lawyer<AtomicInteger>;
|
|
44
|
+
export declare function guard(instance: unknown): instance is RequiredType<AtomicInteger>;
|
|
54
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,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LAWYER = void 0;
|
|
4
3
|
exports.guard = guard;
|
|
5
|
-
exports.isAtomicInteger = guard;
|
|
6
|
-
const RatifiedContract_1 = require("@jonloucks/contracts-ts/api/RatifiedContract");
|
|
7
4
|
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
8
5
|
/**
|
|
9
6
|
* Type guard for AtomicInteger interface.
|
|
@@ -12,27 +9,6 @@ const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
|
12
9
|
* @returns true if the instance implements AtomicInteger
|
|
13
10
|
*/
|
|
14
11
|
function guard(instance) {
|
|
15
|
-
return (0, Types_1.
|
|
12
|
+
return (0, Types_1.guardFunctions)(instance, "compareAndSet", "incrementAndGet", "decrementAndGet", "get", "set");
|
|
16
13
|
}
|
|
17
|
-
/**
|
|
18
|
-
* For creating a Contract for AtomicInteger with duck-typing checks.
|
|
19
|
-
* @deprecated create a contract using guard directly
|
|
20
|
-
*/
|
|
21
|
-
exports.LAWYER = new class {
|
|
22
|
-
/**
|
|
23
|
-
* Lawyer.isDeliverable override
|
|
24
|
-
*/
|
|
25
|
-
isDeliverable(instance) {
|
|
26
|
-
return guard(instance);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Lawyer.createContract override
|
|
30
|
-
*/
|
|
31
|
-
createContract(config) {
|
|
32
|
-
const copy = { ...config ?? {} };
|
|
33
|
-
copy.test ?? (copy.test = this.isDeliverable);
|
|
34
|
-
copy.typeName ?? (copy.typeName = "AtomicInteger");
|
|
35
|
-
return (0, RatifiedContract_1.create)(copy);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
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,6 +1,5 @@
|
|
|
1
1
|
import { Contract } from "@jonloucks/contracts-ts/api/Contract";
|
|
2
|
-
import {
|
|
3
|
-
import { OptionalType, RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
2
|
+
import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
4
3
|
import { AtomicInteger } from "@jonloucks/contracts-ts/auxiliary/AtomicInteger";
|
|
5
4
|
/**
|
|
6
5
|
* Factory interface for creating AtomicInteger instances.
|
|
@@ -10,7 +9,7 @@ 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.
|
|
@@ -18,15 +17,7 @@ export interface AtomicIntegerFactory {
|
|
|
18
17
|
* @param instance the instance to check
|
|
19
18
|
* @returns true if the instance implements AtomicIntegerFactory
|
|
20
19
|
*/
|
|
21
|
-
export declare function guard(instance: unknown): instance is
|
|
22
|
-
/** @deprecated use guard instead
|
|
23
|
-
*/
|
|
24
|
-
export { guard as isAtomicIntegerFactory };
|
|
25
|
-
/**
|
|
26
|
-
* For creating a Contract for AtomicInteger with duck-typing checks.
|
|
27
|
-
* @deprecated use createContract instead with guard
|
|
28
|
-
*/
|
|
29
|
-
export declare const LAWYER: Lawyer<AtomicIntegerFactory>;
|
|
20
|
+
export declare function guard(instance: unknown): instance is RequiredType<AtomicIntegerFactory>;
|
|
30
21
|
/**
|
|
31
22
|
* The factory Contract for creating new AtomicInteger instances.
|
|
32
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"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CONTRACT =
|
|
3
|
+
exports.CONTRACT = void 0;
|
|
4
4
|
exports.guard = guard;
|
|
5
|
-
exports.isAtomicIntegerFactory = guard;
|
|
6
5
|
const RatifiedContract_1 = require("@jonloucks/contracts-ts/api/RatifiedContract");
|
|
7
6
|
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
8
7
|
/**
|
|
@@ -12,29 +11,8 @@ const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
|
12
11
|
* @returns true if the instance implements AtomicIntegerFactory
|
|
13
12
|
*/
|
|
14
13
|
function guard(instance) {
|
|
15
|
-
return (0, Types_1.
|
|
14
|
+
return (0, Types_1.guardFunctions)(instance, 'createAtomicInteger');
|
|
16
15
|
}
|
|
17
|
-
/**
|
|
18
|
-
* For creating a Contract for AtomicInteger with duck-typing checks.
|
|
19
|
-
* @deprecated use createContract instead with guard
|
|
20
|
-
*/
|
|
21
|
-
exports.LAWYER = new class {
|
|
22
|
-
/**
|
|
23
|
-
* Lawyer.isDeliverable override
|
|
24
|
-
*/
|
|
25
|
-
isDeliverable(instance) {
|
|
26
|
-
return guard(instance);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Lawyer.createContract override
|
|
30
|
-
*/
|
|
31
|
-
createContract(config) {
|
|
32
|
-
const copy = { ...config ?? {} };
|
|
33
|
-
copy.test ?? (copy.test = this.isDeliverable);
|
|
34
|
-
copy.typeName ?? (copy.typeName = "AtomicIntegerFactory");
|
|
35
|
-
return (0, RatifiedContract_1.create)(copy);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
16
|
/**
|
|
39
17
|
* The factory Contract for creating new AtomicInteger instances.
|
|
40
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicIntegerFactory.js","sourceRoot":"","sources":["../../src/auxiliary/AtomicIntegerFactory.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AtomicIntegerFactory.js","sourceRoot":"","sources":["../../src/auxiliary/AtomicIntegerFactory.ts"],"names":[],"mappings":";;;AAuBA,sBAEC;AAxBD,mFAAwF;AACxF,6DAAiF;AAejF;;;;;GAKG;AACH,SAAgB,KAAK,CAAC,QAAiB;IACnC,OAAO,IAAA,sBAAc,EAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;AAC3D,CAAC;AAED;;GAEG;AACU,QAAA,QAAQ,GAAmC,IAAA,yBAAc,EAAC;IACnE,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,sBAAsB;CAC/B,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OptionalType } from "@jonloucks/contracts-ts/api/Types";
|
|
1
|
+
import { OptionalType, RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
3
2
|
/**
|
|
4
3
|
* Responsibility: An atomic reference interface for thread-safe reference operations.
|
|
5
4
|
* Note: typescript limitations prevent full atomicity guarantees.
|
|
@@ -28,13 +27,5 @@ export interface AtomicReference<T> {
|
|
|
28
27
|
* @param instance the instance to check
|
|
29
28
|
* @returns true if the instance implements AtomicReference
|
|
30
29
|
*/
|
|
31
|
-
export declare function guard<T>(instance: unknown): instance is
|
|
32
|
-
/** @deprecated use guard instead
|
|
33
|
-
*/
|
|
34
|
-
export { guard as isAtomicReference };
|
|
35
|
-
/**
|
|
36
|
-
* For creating a Contract for AtomicReference with duck-typing checks.
|
|
37
|
-
* @deprecated create a contract using typeGuard directly
|
|
38
|
-
*/
|
|
39
|
-
export declare const LAWYER: Lawyer<AtomicReference<unknown>>;
|
|
30
|
+
export declare function guard<T>(instance: unknown): instance is RequiredType<AtomicReference<T>>;
|
|
40
31
|
//# sourceMappingURL=AtomicReference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicReference.d.ts","sourceRoot":"","sources":["../../src/auxiliary/AtomicReference.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AtomicReference.d.ts","sourceRoot":"","sources":["../../src/auxiliary/AtomicReference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,mCAAmC,CAAC;AAE/F;;;GAGG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAE9B;;OAEG;IACH,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;IAEvB;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;IAEpC;;;;;OAKG;IACH,aAAa,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;CACrF;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAExF"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LAWYER = void 0;
|
|
4
3
|
exports.guard = guard;
|
|
5
|
-
exports.isAtomicReference = guard;
|
|
6
|
-
const RatifiedContract_1 = require("@jonloucks/contracts-ts/api/RatifiedContract");
|
|
7
4
|
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
8
5
|
/**
|
|
9
6
|
* Type guard for AtomicReference interface.
|
|
@@ -12,27 +9,6 @@ const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
|
12
9
|
* @returns true if the instance implements AtomicReference
|
|
13
10
|
*/
|
|
14
11
|
function guard(instance) {
|
|
15
|
-
return (0, Types_1.
|
|
12
|
+
return (0, Types_1.guardFunctions)(instance, "compareAndSet", "get", "set");
|
|
16
13
|
}
|
|
17
|
-
/**
|
|
18
|
-
* For creating a Contract for AtomicReference with duck-typing checks.
|
|
19
|
-
* @deprecated create a contract using typeGuard directly
|
|
20
|
-
*/
|
|
21
|
-
exports.LAWYER = new class {
|
|
22
|
-
/**
|
|
23
|
-
* Lawyer.isDeliverable override
|
|
24
|
-
*/
|
|
25
|
-
isDeliverable(instance) {
|
|
26
|
-
return guard(instance);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Lawyer.createContract override
|
|
30
|
-
*/
|
|
31
|
-
createContract(config) {
|
|
32
|
-
const copy = { ...config ?? {} };
|
|
33
|
-
copy.test ?? (copy.test = this.isDeliverable);
|
|
34
|
-
copy.typeName ?? (copy.typeName = "AtomicReference");
|
|
35
|
-
return (0, RatifiedContract_1.create)(copy);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
14
|
//# sourceMappingURL=AtomicReference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicReference.js","sourceRoot":"","sources":["../../src/auxiliary/AtomicReference.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AtomicReference.js","sourceRoot":"","sources":["../../src/auxiliary/AtomicReference.ts"],"names":[],"mappings":";;AAkCA,sBAEC;AApCD,6DAA+F;AA4B/F;;;;;GAKG;AACH,SAAgB,KAAK,CAAI,QAAiB;IACtC,OAAO,IAAA,sBAAc,EAAC,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACnE,CAAC"}
|