@jonloucks/contracts-ts 1.2.0 → 1.2.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/api/AutoClose.d.ts +2 -2
- package/api/AutoOpen.d.ts +0 -2
- package/api/AutoOpen.d.ts.map +1 -1
- package/api/AutoOpen.js.map +1 -1
- package/api/BasicContract.d.ts +1 -6
- package/api/BasicContract.d.ts.map +1 -1
- package/api/BasicContract.js +32 -14
- 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.map +1 -1
- package/api/ContractException.d.ts +2 -2
- package/api/ContractException.d.ts.map +1 -1
- package/api/ContractException.js +3 -2
- package/api/ContractException.js.map +1 -1
- package/api/ContractFactory.d.ts +2 -2
- package/api/ContractFactory.js +1 -1
- package/api/Promisor.d.ts +2 -4
- package/api/Promisor.d.ts.map +1 -1
- package/api/Promisor.js.map +1 -1
- package/api/PromisorFactory.d.ts +1 -1
- package/auxiliary/Checks.d.ts +8 -0
- package/auxiliary/Checks.d.ts.map +1 -1
- package/auxiliary/Checks.js +10 -1
- package/auxiliary/Checks.js.map +1 -1
- package/auxiliary/IdempotentFactory.d.ts +2 -2
- package/auxiliary/IllegalArgumentException.d.ts +1 -1
- package/auxiliary/IllegalArgumentException.d.ts.map +1 -1
- package/auxiliary/IllegalArgumentException.js +2 -1
- package/auxiliary/IllegalArgumentException.js.map +1 -1
- package/auxiliary/IllegalStateException.d.ts +1 -1
- package/auxiliary/IllegalStateException.d.ts.map +1 -1
- package/auxiliary/IllegalStateException.js +2 -1
- package/auxiliary/IllegalStateException.js.map +1 -1
- package/impl/AtomicBoolean.impl.js +13 -7
- package/impl/AtomicBoolean.impl.js.map +1 -1
- package/impl/AtomicInteger.impl.js +15 -9
- package/impl/AtomicInteger.impl.js.map +1 -1
- package/impl/AtomicReference.impl.d.ts +1 -1
- package/impl/AtomicReference.impl.d.ts.map +1 -1
- package/impl/AtomicReference.impl.js +21 -7
- package/impl/AtomicReference.impl.js.map +1 -1
- package/impl/AutoCloseMany.impl.js +11 -5
- package/impl/AutoCloseMany.impl.js.map +1 -1
- package/impl/AutoCloseOne.impl.js +12 -6
- package/impl/AutoCloseOne.impl.js.map +1 -1
- package/impl/Contracts.impl.js +26 -18
- package/impl/Contracts.impl.js.map +1 -1
- package/impl/ContractsFactory.impl.js +9 -2
- package/impl/ContractsFactory.impl.js.map +1 -1
- package/impl/ContractsWrapper.impl.js +24 -9
- package/impl/ContractsWrapper.impl.js.map +1 -1
- package/impl/Events.impl.js +24 -9
- package/impl/Events.impl.js.map +1 -1
- package/impl/ExtractorPromisor.impl.js +21 -6
- package/impl/ExtractorPromisor.impl.js.map +1 -1
- package/impl/Idempotent.impl.js +36 -21
- package/impl/Idempotent.impl.js.map +1 -1
- package/impl/IdempotentFactory.impl.d.ts.map +1 -1
- package/impl/IdempotentFactory.impl.js +3 -1
- package/impl/IdempotentFactory.impl.js.map +1 -1
- package/impl/Policy.impl.d.ts.map +1 -1
- package/impl/Policy.impl.js +2 -1
- package/impl/Policy.impl.js.map +1 -1
- package/impl/Repository.impl.js +1 -2
- package/impl/Repository.impl.js.map +1 -1
- package/package.json +2 -2
- package/version.js +1 -1
package/api/AutoClose.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface Close {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Opt-in interface for resources that need cleanup when their lifecycle ends. For example, this is when threads should be stopped or hooks removed.
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
* Features like life cycle promisors
|
|
19
19
|
* will automatically call this method once if the deliverable implements this method.
|
|
20
20
|
*/
|
|
@@ -52,7 +52,7 @@ export interface AutoCloseOne extends AutoClose {
|
|
|
52
52
|
*/
|
|
53
53
|
export declare const AUTO_CLOSE_NONE: AutoClose;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Used to adapt from AutoCloseType to AutoClose with unwrapping capability.
|
|
56
56
|
*/
|
|
57
57
|
export interface AutoCloseWrapper extends AutoClose {
|
|
58
58
|
/**
|
package/api/AutoOpen.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
|
3
3
|
/**
|
|
4
4
|
* Opt-in interface to be called once after creation, although implementations should
|
|
5
5
|
* handle this gracefully. For example, this is when threads or hooks could be added.
|
|
6
|
-
* See also {@link AutoClose}
|
|
7
|
-
* Features like {@link Promisors#createLifeCycle(Promisor)}
|
|
8
6
|
* will automatically call this method once if the deliverable implements this method.
|
|
9
7
|
*/
|
|
10
8
|
export interface AutoOpen {
|
package/api/AutoOpen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoOpen.d.ts","sourceRoot":"","sources":["../../src/api/AutoOpen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAkB,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjF
|
|
1
|
+
{"version":3,"file":"AutoOpen.d.ts","sourceRoot":"","sources":["../../src/api/AutoOpen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAkB,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjF;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IAErB;;;OAGG;IACH,QAAQ,IAAI,SAAS,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,CAE3E"}
|
package/api/AutoOpen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoOpen.js","sourceRoot":"","sources":["../../src/api/AutoOpen.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"AutoOpen.js","sourceRoot":"","sources":["../../src/api/AutoOpen.ts"],"names":[],"mappings":";;AAuBA,sBAEC;AAxBD,6DAAiF;AAgBjF;;;;;GAKG;AACH,SAAgB,KAAK,CAAC,QAAiB;IACnC,OAAO,IAAA,sBAAc,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAChD,CAAC"}
|
package/api/BasicContract.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare function create<T>(config?: Config<T> | null): RequiredType<Contr
|
|
|
16
16
|
* Class designed for extension.
|
|
17
17
|
*/
|
|
18
18
|
export declare class BasicContract<T> implements Contract<T> {
|
|
19
|
+
#private;
|
|
19
20
|
/**
|
|
20
21
|
* Create a contract derived from the given configuration
|
|
21
22
|
*
|
|
@@ -69,12 +70,6 @@ export declare class BasicContract<T> implements Contract<T> {
|
|
|
69
70
|
constructor(config?: Config<T> | null);
|
|
70
71
|
private throwCastException;
|
|
71
72
|
private static ID_GENERATOR;
|
|
72
|
-
private readonly _id;
|
|
73
|
-
private readonly _name;
|
|
74
|
-
private readonly _typeName;
|
|
75
|
-
private readonly _tester;
|
|
76
|
-
private readonly _replaceable;
|
|
77
|
-
private readonly _guarded;
|
|
78
73
|
}
|
|
79
74
|
type DeliveryType<T> = OptionalType<T>;
|
|
80
75
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasicContract.d.ts","sourceRoot":"","sources":["../../src/api/BasicContract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAgB,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAG7F;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAE9E;AAED;;;;;;;GAOG;AACH,qBAAa,aAAa,CAA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
package/api/BasicContract.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
11
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12
|
+
};
|
|
13
|
+
var _a, _BasicContract_id, _BasicContract_name, _BasicContract_typeName, _BasicContract_tester, _BasicContract_replaceable, _BasicContract_guarded;
|
|
2
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
15
|
exports.BasicContract = void 0;
|
|
4
16
|
exports.create = create;
|
|
@@ -30,7 +42,7 @@ class BasicContract {
|
|
|
30
42
|
* @return the new Contract
|
|
31
43
|
*/
|
|
32
44
|
static create(config) {
|
|
33
|
-
return new
|
|
45
|
+
return new _a(config);
|
|
34
46
|
}
|
|
35
47
|
/**
|
|
36
48
|
* Casts the given object to the return type for this Contract
|
|
@@ -42,14 +54,14 @@ class BasicContract {
|
|
|
42
54
|
*/
|
|
43
55
|
cast(value) {
|
|
44
56
|
if ((0, Types_1.isNotPresent)(value)) {
|
|
45
|
-
if (this
|
|
57
|
+
if (__classPrivateFieldGet(this, _BasicContract_guarded, "f")) {
|
|
46
58
|
this.throwCastException();
|
|
47
59
|
}
|
|
48
60
|
else {
|
|
49
61
|
return value;
|
|
50
62
|
}
|
|
51
63
|
}
|
|
52
|
-
if (this.
|
|
64
|
+
if (__classPrivateFieldGet(this, _BasicContract_tester, "f").call(this, value)) {
|
|
53
65
|
return value;
|
|
54
66
|
}
|
|
55
67
|
else {
|
|
@@ -60,14 +72,14 @@ class BasicContract {
|
|
|
60
72
|
* @return the contract name
|
|
61
73
|
*/
|
|
62
74
|
get name() {
|
|
63
|
-
return this
|
|
75
|
+
return __classPrivateFieldGet(this, _BasicContract_name, "f");
|
|
64
76
|
}
|
|
65
77
|
/**
|
|
66
78
|
* When guarded is true the Contract throws exception if deliverable is null or undefined
|
|
67
79
|
* The default is true.
|
|
68
80
|
*/
|
|
69
81
|
get guarded() {
|
|
70
|
-
return this
|
|
82
|
+
return __classPrivateFieldGet(this, _BasicContract_guarded, "f");
|
|
71
83
|
}
|
|
72
84
|
/**
|
|
73
85
|
* Note: Do not rely on this being a java class name
|
|
@@ -76,7 +88,7 @@ class BasicContract {
|
|
|
76
88
|
* @return the type of deliverable for this contract.
|
|
77
89
|
*/
|
|
78
90
|
get typeName() {
|
|
79
|
-
return this
|
|
91
|
+
return __classPrivateFieldGet(this, _BasicContract_typeName, "f");
|
|
80
92
|
}
|
|
81
93
|
/**
|
|
82
94
|
* When replaceable a new binding can replace in an existing one
|
|
@@ -85,7 +97,7 @@ class BasicContract {
|
|
|
85
97
|
* @return true if replaceable
|
|
86
98
|
*/
|
|
87
99
|
get replaceable() {
|
|
88
|
-
return this
|
|
100
|
+
return __classPrivateFieldGet(this, _BasicContract_replaceable, "f");
|
|
89
101
|
}
|
|
90
102
|
/**
|
|
91
103
|
* String representation of this Contract
|
|
@@ -93,7 +105,7 @@ class BasicContract {
|
|
|
93
105
|
* @returns a string representation of the contract
|
|
94
106
|
*/
|
|
95
107
|
toString() {
|
|
96
|
-
let text = `Contract(id=${this
|
|
108
|
+
let text = `Contract(id=${__classPrivateFieldGet(this, _BasicContract_id, "f")}`;
|
|
97
109
|
if (this.name.length > 0) {
|
|
98
110
|
text += `, name=${this.name}`;
|
|
99
111
|
}
|
|
@@ -108,13 +120,18 @@ class BasicContract {
|
|
|
108
120
|
* @param config
|
|
109
121
|
*/
|
|
110
122
|
constructor(config) {
|
|
111
|
-
this
|
|
123
|
+
_BasicContract_id.set(this, _a.ID_GENERATOR++);
|
|
124
|
+
_BasicContract_name.set(this, void 0);
|
|
125
|
+
_BasicContract_typeName.set(this, void 0);
|
|
126
|
+
_BasicContract_tester.set(this, void 0);
|
|
127
|
+
_BasicContract_replaceable.set(this, void 0);
|
|
128
|
+
_BasicContract_guarded.set(this, void 0);
|
|
112
129
|
const candidateConfig = config ?? {};
|
|
113
|
-
this
|
|
114
|
-
this
|
|
115
|
-
this
|
|
116
|
-
this
|
|
117
|
-
this
|
|
130
|
+
__classPrivateFieldSet(this, _BasicContract_replaceable, candidateConfig?.replaceable ?? false, "f");
|
|
131
|
+
__classPrivateFieldSet(this, _BasicContract_guarded, candidateConfig?.guarded ?? true, "f");
|
|
132
|
+
__classPrivateFieldSet(this, _BasicContract_name, candidateConfig?.name ?? "", "f");
|
|
133
|
+
__classPrivateFieldSet(this, _BasicContract_typeName, candidateConfig?.typeName ?? "", "f");
|
|
134
|
+
__classPrivateFieldSet(this, _BasicContract_tester, candidateConfig?.test ?? ((unknown) => true), "f");
|
|
118
135
|
}
|
|
119
136
|
throwCastException() {
|
|
120
137
|
// Note: message intentionally does not include the instance value
|
|
@@ -122,5 +139,6 @@ class BasicContract {
|
|
|
122
139
|
}
|
|
123
140
|
}
|
|
124
141
|
exports.BasicContract = BasicContract;
|
|
142
|
+
_a = BasicContract, _BasicContract_id = new WeakMap(), _BasicContract_name = new WeakMap(), _BasicContract_typeName = new WeakMap(), _BasicContract_tester = new WeakMap(), _BasicContract_replaceable = new WeakMap(), _BasicContract_guarded = new WeakMap();
|
|
125
143
|
BasicContract.ID_GENERATOR = 1;
|
|
126
144
|
//# sourceMappingURL=BasicContract.js.map
|
package/api/BasicContract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasicContract.js","sourceRoot":"","sources":["../../src/api/BasicContract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BasicContract.js","sourceRoot":"","sources":["../../src/api/BasicContract.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAUA,wBAEC;AAXD,6DAA6F;AAC7F,qFAAkF;AAElF;;;;;GAKG;AACH,SAAgB,MAAM,CAAI,MAAyB;IACjD,OAAO,aAAa,CAAC,MAAM,CAAI,MAAM,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;GAOG;AACH,MAAa,aAAa;IAExB;;;;;;QAMI;IACJ,MAAM,CAAC,MAAM,CAAI,MAAyB;QACxC,OAAO,IAAI,EAAa,CAAI,MAAM,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;;MAOE;IACK,IAAI,CAAC,KAAiC;QAC3C,IAAI,IAAA,oBAAY,EAAC,KAAK,CAAC,EAAE,CAAC;YACxB,IAAI,uBAAA,IAAI,8BAAS,EAAE,CAAC;gBAClB,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC5B,CAAC;iBAAM,CAAC;gBACN,OAAO,KAAwB,CAAC;YAClC,CAAC;QACH,CAAC;QAAC,IAAI,uBAAA,IAAI,6BAAQ,MAAZ,IAAI,EAAS,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,KAAK,CAAC;QACf,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC9B,CAAC;IACH,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,uBAAA,IAAI,2BAAM,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,IAAW,OAAO;QAChB,OAAO,uBAAA,IAAI,8BAAS,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,IAAW,QAAQ;QACjB,OAAO,uBAAA,I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AI,CAAC,CAAC;IACrF,CAAC;;AAvGH,sCAiHC;;AARgB,0BAAY,GAAW,CAAC,AAAZ,CAAa"}
|
package/api/BindStrategy.d.ts
CHANGED
|
@@ -4,9 +4,6 @@ import { OptionalType, RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
|
4
4
|
* <p>
|
|
5
5
|
* Used to dictate how or if binding should happen when the Contract is already bound.
|
|
6
6
|
* </p>
|
|
7
|
-
* @see Contracts#bind(Contract, Promisor, BindStrategy)
|
|
8
|
-
* @see Repository#store(Contract, Promisor, BindStrategy)
|
|
9
|
-
* @see Repository#keep(Contract, Promisor, BindStrategy)
|
|
10
7
|
*/
|
|
11
8
|
export type BindStrategy =
|
|
12
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BindStrategy.d.ts","sourceRoot":"","sources":["../../src/api/BindStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAE/E
|
|
1
|
+
{"version":3,"file":"BindStrategy.d.ts","sourceRoot":"","sources":["../../src/api/BindStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAE/E;;;;;GAKG;AACH,MAAM,MAAM,YAAY;AACpB;;EAEE;AACF,QAAQ;AACR;;EAEE;AACF,cAAc;AACd;;EAEE;AACF,YAAY,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAA2B,CAAA;AAE/D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,CAExG;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,YAAY,CAAC,CAW/E"}
|
package/api/BindStrategy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BindStrategy.js","sourceRoot":"","sources":["../../src/api/BindStrategy.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"BindStrategy.js","sourceRoot":"","sources":["../../src/api/BindStrategy.ts"],"names":[],"mappings":";;;AAsCA,kDAEC;AAOD,sBAWC;AApCD;;GAEG;AACU,QAAA,qBAAqB,GAAiB,YAAY,CAAA;AAO/D;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,YAAwC;IACxE,OAAO,YAAY,IAAI,6BAAqB,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,SAAgB,KAAK,CAAC,QAAiB;IACnC,QAAQ,QAAQ,EAAE,CAAC;QACf,KAAK,SAAS,CAAC;QACf,KAAK,IAAI,CAAC;QACV,KAAK,QAAQ,CAAC;QACd,KAAK,cAAc,CAAC;QACpB,KAAK,YAAY;YACb,OAAO,IAAI,CAAC;QAChB;YACI,OAAO,KAAK,CAAC;IACrB,CAAC;AACL,CAAC"}
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare class ContractException extends Error {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Create a new ContractException
|
|
8
8
|
*
|
|
9
9
|
* @param message the message for this exception
|
|
10
10
|
* @param thrown the cause of this exception, null is allowed
|
|
11
11
|
*/
|
|
12
|
-
constructor(message: string,
|
|
12
|
+
constructor(message: string, thrown?: Error | null);
|
|
13
13
|
/**
|
|
14
14
|
* Ensure something that was caught is rethrown as a ContractException
|
|
15
15
|
* @param caught the caught value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractException.d.ts","sourceRoot":"","sources":["../../src/api/ContractException.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAE1C;;;;;OAKG;gBACgB,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"ContractException.d.ts","sourceRoot":"","sources":["../../src/api/ContractException.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAE1C;;;;;OAKG;gBACgB,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,KAAK,GAAG,IAAW;IAU/D;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK;CASzD;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAEhE"}
|
package/api/ContractException.js
CHANGED
|
@@ -9,14 +9,15 @@ const Checks_1 = require("@jonloucks/contracts-ts/auxiliary/Checks");
|
|
|
9
9
|
*/
|
|
10
10
|
class ContractException extends Error {
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Create a new ContractException
|
|
13
13
|
*
|
|
14
14
|
* @param message the message for this exception
|
|
15
15
|
* @param thrown the cause of this exception, null is allowed
|
|
16
16
|
*/
|
|
17
|
-
constructor(message,
|
|
17
|
+
constructor(message, thrown = null) {
|
|
18
18
|
// super(messageCheck(message), thrown || undefined);
|
|
19
19
|
super((0, Checks_1.messageCheck)(message));
|
|
20
|
+
(0, Checks_1.used)(thrown);
|
|
20
21
|
this.name = "ContractException";
|
|
21
22
|
Object.setPrototypeOf(this, ContractException.prototype);
|
|
22
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractException.js","sourceRoot":"","sources":["../../src/api/ContractException.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ContractException.js","sourceRoot":"","sources":["../../src/api/ContractException.ts"],"names":[],"mappings":";;;AA8CA,sBAEC;AAhDD,qEAA8E;AAE9E;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,KAAK;IAE1C;;;;;OAKG;IACH,YAAmB,OAAe,EAAE,SAAuB,IAAI;QAC7D,qDAAqD;QACrD,KAAK,CAAC,IAAA,qBAAY,EAAC,OAAO,CAAC,CAAC,CAAC;QAE7B,IAAA,aAAI,EAAC,MAAM,CAAC,CAAC;QAEb,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAA;IAC1D,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,MAAe,EAAE,OAAgB;QAC9C,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAClB,MAAM,MAAM,CAAC;QACf,CAAC;aAAM,IAAI,MAAM,YAAY,KAAK,EAAE,CAAC;YACnC,MAAM,IAAI,iBAAiB,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,iBAAiB,CAAC,OAAO,IAAI,+BAA+B,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;CACF;AAhCD,8CAgCC;AAED;;;;;GAKG;AACH,SAAgB,KAAK,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,iBAAiB,CAAC;AAC5C,CAAC"}
|
package/api/ContractFactory.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Config, Contract } from "@jonloucks/contracts-ts/api/Contract";
|
|
2
2
|
import { OptionalType, RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
3
3
|
/**
|
|
4
|
-
* A
|
|
4
|
+
* A Contract factory to bootstrapping Global Contracts and provide
|
|
5
5
|
* Standalone services for special needs.
|
|
6
6
|
*/
|
|
7
7
|
export interface ContractFactory {
|
|
@@ -19,7 +19,7 @@ export interface ContractFactory {
|
|
|
19
19
|
* Type guard for ContractFactory
|
|
20
20
|
*
|
|
21
21
|
* @param value the value to check
|
|
22
|
-
* @return true if value is ContractFactory, false otherwise
|
|
22
|
+
* @return true if value is a ContractFactory, false otherwise
|
|
23
23
|
*/
|
|
24
24
|
export declare function guard(value: unknown): value is RequiredType<ContractFactory>;
|
|
25
25
|
//# sourceMappingURL=ContractFactory.d.ts.map
|
package/api/ContractFactory.js
CHANGED
|
@@ -6,7 +6,7 @@ const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
|
6
6
|
* Type guard for ContractFactory
|
|
7
7
|
*
|
|
8
8
|
* @param value the value to check
|
|
9
|
-
* @return true if value is ContractFactory, false otherwise
|
|
9
|
+
* @return true if value is a ContractFactory, false otherwise
|
|
10
10
|
*/
|
|
11
11
|
function guard(value) {
|
|
12
12
|
return (0, Types_1.guardFunctions)(value, 'createContract');
|
package/api/Promisor.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OptionalType, RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
2
2
|
/**
|
|
3
3
|
* Interface for providing a deliverable for a Contract
|
|
4
|
-
* The main and required implementation is
|
|
4
|
+
* The main and required implementation is demand().
|
|
5
5
|
* There are optional methods with appropriate defaults.
|
|
6
6
|
* @param <T> The type of the deliverable
|
|
7
7
|
*/
|
|
@@ -14,15 +14,13 @@ export interface Promisor<T> {
|
|
|
14
14
|
/**
|
|
15
15
|
* Reference counting used for advanced resource management
|
|
16
16
|
* Incremented when bound or by other Promisors
|
|
17
|
-
* Decremented if caller invokes {@link AutoClose#close()} on the return value of bind
|
|
18
17
|
* Every successful 'open' must be followed by a 'close' at the appropriate time
|
|
19
18
|
* @return the usage count. This might be a constant
|
|
20
19
|
*/
|
|
21
20
|
incrementUsage(): number;
|
|
22
21
|
/**
|
|
23
22
|
* Reference counting used for advanced resource management
|
|
24
|
-
*
|
|
25
|
-
* Decremented if caller invokes {@link AutoClose#close()} on the return value of bind
|
|
23
|
+
* Decremented when no longer used
|
|
26
24
|
* Every successful 'open' must be followed by a 'close' at the appropriate time
|
|
27
25
|
* @return the usage count. This might be a constant
|
|
28
26
|
*/
|
package/api/Promisor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Promisor.d.ts","sourceRoot":"","sources":["../../src/api/Promisor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAA+C,MAAM,mCAAmC,CAAC;AAG5H;;;;;GAKG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC;IAEzB;;;OAGG;IACH,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;IAE1B
|
|
1
|
+
{"version":3,"file":"Promisor.d.ts","sourceRoot":"","sources":["../../src/api/Promisor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAA+C,MAAM,mCAAmC,CAAC;AAG5H;;;;;GAKG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC;IAEzB;;;OAGG;IACH,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;IAE1B;;;;;OAKG;IACH,cAAc,IAAI,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,cAAc,IAAI,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAEjF;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AAE7H;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAYlF;AA+BD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAQxG"}
|
package/api/Promisor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Promisor.js","sourceRoot":"","sources":["../../src/api/Promisor.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"Promisor.js","sourceRoot":"","sources":["../../src/api/Promisor.ts"],"names":[],"mappings":";;AAuCA,sBAEC;AAaD,wCAYC;AAqCD,gDAQC;AA/GD,6DAA4H;AAC5H,qEAAwE;AAiCxE;;;;GAIG;AACH,SAAgB,KAAK,CAAI,QAAiB;IACxC,OAAO,IAAA,sBAAc,EAAC,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;AAChF,CAAC;AAOD;;;;;GAKG;AACH,SAAgB,cAAc,CAAI,IAAqB;IACrD,IAAI,IAAA,oBAAY,EAAC,IAAI,CAAC,EAAE,CAAC;QACvB,OAAO,YAAY,CAAI,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,gCAAgC;IAC5E,CAAC;SAAM,IAAI,IAAA,qBAAa,EAAI,IAAI,CAAC,EAAE,CAAC;QAClC,OAAO,YAAY,CAAI,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,2BAA2B;IAC7E,CAAC;SAAM,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC,CAAC,qBAAqB;IACpC,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QACtC,OAAO,YAAY,CAAI,IAAI,EAAE,IAAe,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,OAAO,YAAY,CAAI,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,sDAAsD;IAClG,CAAC;AACH,CAAC;AAaD;;;;;;GAMG;AACH,SAAS,YAAY,CAAI,IAAqB,EAAE,MAA6B;IAC3E,MAAM,WAAW,GAAG,IAAA,qBAAY,EAAC,MAAM,EAAE,2CAA2C,CAAC,CAAC;IACtF,IAAI,UAAU,GAAW,CAAC,CAAC;IAC3B,OAAO;QACL,MAAM,EAAE,WAAW;QACnB,cAAc,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU;QAClC,cAAc,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU;QAClC,kBAAkB,EAAE,GAAG,EAAE,CAAC,IAAI;KAC/B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAI,QAAmC;IACrE,IAAI,IAAA,oBAAY,EAAC,QAAQ,CAAC,EAAE,CAAC;QACzB,OAAO,QAAQ,CAAC;IACpB,CAAC;IACD,IAAI,oBAAoB,IAAI,QAAQ,IAAI,OAAO,QAAQ,CAAC,kBAAkB,KAAK,UAAU,EAAE,CAAC;QACxF,OAAO,QAAQ,CAAC,kBAAkB,EAAE,CAAC;IACzC,CAAC;IACD,OAAO,QAAQ,CAAA;AACnB,CAAC"}
|
package/api/PromisorFactory.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Contract } from "@jonloucks/contracts-ts/api/Contract";
|
|
|
2
2
|
import { Promisor, PromisorType } from "@jonloucks/contracts-ts/api/Promisor";
|
|
3
3
|
import { OptionalType, RequiredType, TransformType } from "@jonloucks/contracts-ts/api/Types";
|
|
4
4
|
/**
|
|
5
|
-
* Helper methods for creating and chaining Promisors used for
|
|
5
|
+
* Helper methods for creating and chaining Promisors used for Contracts.bind().
|
|
6
6
|
*/
|
|
7
7
|
export interface PromisorFactory {
|
|
8
8
|
/**
|
package/auxiliary/Checks.d.ts
CHANGED
|
@@ -70,4 +70,12 @@ export declare const presentCheck: <T>(value: OptionalType<T>, message: string)
|
|
|
70
70
|
* @returns the value passed in
|
|
71
71
|
*/
|
|
72
72
|
export declare const illegalCheck: <T>(value: T, failed: boolean, message: string) => T;
|
|
73
|
+
/**
|
|
74
|
+
* explicity mark a value as used to avoid compiler warnings
|
|
75
|
+
* useful for "using" variable which are used for disposal or other side-effects
|
|
76
|
+
* but not directly referenced in code.
|
|
77
|
+
*
|
|
78
|
+
* @param value the value which you wish to declare as used
|
|
79
|
+
*/
|
|
80
|
+
export declare const used: (value: unknown) => void;
|
|
73
81
|
//# sourceMappingURL=Checks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checks.d.ts","sourceRoot":"","sources":["../../src/auxiliary/Checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAG7F;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"Checks.d.ts","sourceRoot":"","sources":["../../src/auxiliary/Checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAG7F;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,KACpD,YAAY,CAAC,CAAC,CAGhB,CAAA;AAEH;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,KACtD,YAAY,CAAC,CAAC,CAGhB,CAAA;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,KACpD,YAAY,CAAC,CAAC,CAGhB,CAAA;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,KAChD,YAAY,CAAC,CAAC,CAGhB,CAAA;AAEH;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,KAC5C,YAAY,CAAC,CAAC,CAGhB,CAAA;AAEH;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,KAC5C,YAAY,CAAC,CAAC,CAGhB,CAAA;AAEH;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,KAChD,YAAY,CAAC,CAAC,CAGhB,CAAA;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,KACjE,YAAY,CAAC,CAAC,CAGhB,CAAC;AAEJ;;;;;;;EAOE;AACF,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KACpE,CASF,CAAC;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,KAC7B,IACkC,CAAA"}
|
package/auxiliary/Checks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.illegalCheck = exports.presentCheck = exports.messageCheck = exports.nameCheck = exports.typeCheck = exports.configCheck = exports.promisorCheck = exports.contractsCheck = exports.contractCheck = void 0;
|
|
3
|
+
exports.used = exports.illegalCheck = exports.presentCheck = exports.messageCheck = exports.nameCheck = exports.typeCheck = exports.configCheck = exports.promisorCheck = exports.contractsCheck = exports.contractCheck = void 0;
|
|
4
4
|
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
5
5
|
const IllegalArgumentException_1 = require("@jonloucks/contracts-ts/auxiliary/IllegalArgumentException");
|
|
6
6
|
/**
|
|
@@ -107,4 +107,13 @@ const illegalCheck = (value, failed, message) => {
|
|
|
107
107
|
return value;
|
|
108
108
|
};
|
|
109
109
|
exports.illegalCheck = illegalCheck;
|
|
110
|
+
/**
|
|
111
|
+
* explicity mark a value as used to avoid compiler warnings
|
|
112
|
+
* useful for "using" variable which are used for disposal or other side-effects
|
|
113
|
+
* but not directly referenced in code.
|
|
114
|
+
*
|
|
115
|
+
* @param value the value which you wish to declare as used
|
|
116
|
+
*/
|
|
117
|
+
const used = (value) => { void value; };
|
|
118
|
+
exports.used = used;
|
|
110
119
|
//# sourceMappingURL=Checks.js.map
|
package/auxiliary/Checks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checks.js","sourceRoot":"","sources":["../../src/auxiliary/Checks.ts"],"names":[],"mappings":";;;AAAA,6DAA6F;AAC7F,yGAAsG;AAEtG;;;;;;;GAOG;AACI,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"Checks.js","sourceRoot":"","sources":["../../src/auxiliary/Checks.ts"],"names":[],"mappings":";;;AAAA,6DAA6F;AAC7F,yGAAsG;AAEtG;;;;;;;GAOG;AACI,MAAM,aAAa,GAEtB,CAAI,QAAyB,EAAE,EAAE;IACjC,OAAO,IAAA,oBAAY,EAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAC;AAC7D,CAAC,CAAA;AAJU,QAAA,aAAa,iBAIvB;AAEH;;;;GAIG;AACI,MAAM,cAAc,GAEvB,CAAI,SAA0B,EAAE,EAAE;IAClC,OAAO,IAAA,oBAAY,EAAC,SAAS,EAAE,4BAA4B,CAAC,CAAC;AAC/D,CAAC,CAAA;AAJU,QAAA,cAAc,kBAIxB;AAEH;;;;;;;GAOG;A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AM,IAAI,mDAAwB,CAAC,4CAA4C,CAAC,CAAC;IACnF,CAAC;IACD,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,IAAI,mDAAwB,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAVS,QAAA,YAAY,gBAUrB;AAEJ;;;;;;GAMG;AACI,MAAM,IAAI,GAEb,CAAC,KAAc,EAAE,EAAE,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAA;AAF1B,QAAA,IAAI,QAEsB"}
|
|
@@ -6,10 +6,10 @@ import { Idempotent, Config } from "@jonloucks/contracts-ts/auxiliary/Idempotent
|
|
|
6
6
|
*/
|
|
7
7
|
export interface IdempotentFactory {
|
|
8
8
|
/**
|
|
9
|
-
* Create a new
|
|
9
|
+
* Create a new Idempotent using the provided configuration.
|
|
10
10
|
*
|
|
11
11
|
* @param config configuration for the idempotent; invalid or null/undefined values are not allowed
|
|
12
|
-
* @returns an
|
|
12
|
+
* @returns an Idempotent instance created from the given configuration
|
|
13
13
|
* @throws Error if the configuration is invalid or the idempotent cannot be created
|
|
14
14
|
*/
|
|
15
15
|
createIdempotent(config: Config): RequiredType<Idempotent>;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* Note: This can not extend ContractException due to circular dependency.
|
|
4
4
|
*/
|
|
5
5
|
export declare class IllegalArgumentException extends Error {
|
|
6
|
-
constructor(message: string,
|
|
6
|
+
constructor(message: string, thrown?: Error | null);
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=IllegalArgumentException.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IllegalArgumentException.d.ts","sourceRoot":"","sources":["../../src/auxiliary/IllegalArgumentException.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"IllegalArgumentException.d.ts","sourceRoot":"","sources":["../../src/auxiliary/IllegalArgumentException.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,KAAK,GAAG,IAAW;CAOzD"}
|
|
@@ -7,9 +7,10 @@ const Checks_1 = require("@jonloucks/contracts-ts/auxiliary/Checks");
|
|
|
7
7
|
* Note: This can not extend ContractException due to circular dependency.
|
|
8
8
|
*/
|
|
9
9
|
class IllegalArgumentException extends Error {
|
|
10
|
-
constructor(message,
|
|
10
|
+
constructor(message, thrown = null) {
|
|
11
11
|
// super(messageCheck(message), thrown || undefined);
|
|
12
12
|
super((0, Checks_1.messageCheck)(message));
|
|
13
|
+
(0, Checks_1.used)(thrown);
|
|
13
14
|
this.name = "IllegalArgumentException";
|
|
14
15
|
Object.setPrototypeOf(this, IllegalArgumentException.prototype);
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IllegalArgumentException.js","sourceRoot":"","sources":["../../src/auxiliary/IllegalArgumentException.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"IllegalArgumentException.js","sourceRoot":"","sources":["../../src/auxiliary/IllegalArgumentException.ts"],"names":[],"mappings":";;;AAAA,qEAA8E;AAE9E;;;GAGG;AACH,MAAa,wBAAyB,SAAQ,KAAK;IACjD,YAAY,OAAe,EAAE,SAAuB,IAAI;QACtD,qDAAqD;QACrD,KAAK,CAAC,IAAA,qBAAY,EAAC,OAAO,CAAC,CAAC,CAAC;QAC7B,IAAA,aAAI,EAAC,MAAM,CAAC,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;QACvC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAA;IACjE,CAAC;CACF;AARD,4DAQC"}
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* Note: This can not extend ContractException due to circular dependency.
|
|
4
4
|
*/
|
|
5
5
|
export declare class IllegalStateException extends Error {
|
|
6
|
-
constructor(message: string,
|
|
6
|
+
constructor(message: string, thrown?: Error | null);
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=IllegalStateException.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IllegalStateException.d.ts","sourceRoot":"","sources":["../../src/auxiliary/IllegalStateException.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"IllegalStateException.d.ts","sourceRoot":"","sources":["../../src/auxiliary/IllegalStateException.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,KAAK,GAAG,IAAW;CAOzD"}
|
|
@@ -7,9 +7,10 @@ const Checks_1 = require("@jonloucks/contracts-ts/auxiliary/Checks");
|
|
|
7
7
|
* Note: This can not extend ContractException due to circular dependency.
|
|
8
8
|
*/
|
|
9
9
|
class IllegalStateException extends Error {
|
|
10
|
-
constructor(message,
|
|
10
|
+
constructor(message, thrown = null) {
|
|
11
11
|
// super(messageCheck(message), thrown || undefined);
|
|
12
12
|
super((0, Checks_1.messageCheck)(message));
|
|
13
|
+
(0, Checks_1.used)(thrown);
|
|
13
14
|
this.name = "IllegalStateException";
|
|
14
15
|
Object.setPrototypeOf(this, IllegalStateException.prototype);
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IllegalStateException.js","sourceRoot":"","sources":["../../src/auxiliary/IllegalStateException.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"IllegalStateException.js","sourceRoot":"","sources":["../../src/auxiliary/IllegalStateException.ts"],"names":[],"mappings":";;;AAAA,qEAA8E;AAE9E;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,OAAe,EAAE,SAAuB,IAAI;QACtD,qDAAqD;QACrD,KAAK,CAAC,IAAA,qBAAY,EAAC,OAAO,CAAC,CAAC,CAAC;QAC7B,IAAA,aAAI,EAAC,MAAM,CAAC,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAA;IAC9D,CAAC;CACF;AARD,sDAQC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var _AtomicBooleanImpl_buffer, _AtomicBooleanImpl_array;
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
9
|
exports.create = create;
|
|
4
10
|
/**
|
|
@@ -25,14 +31,14 @@ class AtomicBooleanImpl {
|
|
|
25
31
|
*/
|
|
26
32
|
get() {
|
|
27
33
|
// Atomics.load ensures thread-safe reading
|
|
28
|
-
return Atomics.load(this
|
|
34
|
+
return Atomics.load(__classPrivateFieldGet(this, _AtomicBooleanImpl_array, "f"), 0) === TRUE_AS_NUMBER;
|
|
29
35
|
}
|
|
30
36
|
/**
|
|
31
37
|
* AtomicBoolean.set override
|
|
32
38
|
*/
|
|
33
39
|
set(value) {
|
|
34
40
|
// Atomics.store ensures thread-safe writing
|
|
35
|
-
Atomics.store(this
|
|
41
|
+
Atomics.store(__classPrivateFieldGet(this, _AtomicBooleanImpl_array, "f"), 0, value ? TRUE_AS_NUMBER : FALSE_AS_NUMBER);
|
|
36
42
|
}
|
|
37
43
|
/**
|
|
38
44
|
* AtomicBoolean.compareAndSet override
|
|
@@ -41,20 +47,20 @@ class AtomicBooleanImpl {
|
|
|
41
47
|
const expectedVal = booleanToNumber(expected);
|
|
42
48
|
const newTargetVal = booleanToNumber(newValue);
|
|
43
49
|
// Atomics.compareExchange checks value and sets it if it matches expectation
|
|
44
|
-
return Atomics.compareExchange(this
|
|
50
|
+
return Atomics.compareExchange(__classPrivateFieldGet(this, _AtomicBooleanImpl_array, "f"), 0, expectedVal, newTargetVal) === expectedVal;
|
|
45
51
|
}
|
|
46
52
|
/**
|
|
47
53
|
* AtomicBoolean.getAndSet override
|
|
48
54
|
*/
|
|
49
55
|
getAndSet(newValue) {
|
|
50
56
|
const newTargetVal = booleanToNumber(newValue);
|
|
51
|
-
const previousVal = Atomics.exchange(this
|
|
57
|
+
const previousVal = Atomics.exchange(__classPrivateFieldGet(this, _AtomicBooleanImpl_array, "f"), 0, newTargetVal);
|
|
52
58
|
return previousVal === TRUE_AS_NUMBER;
|
|
53
59
|
}
|
|
54
60
|
/**
|
|
55
61
|
* [Symbol.toPrimitive] override
|
|
56
62
|
*/
|
|
57
|
-
[Symbol.toPrimitive](hint) {
|
|
63
|
+
[(_AtomicBooleanImpl_buffer = new WeakMap(), _AtomicBooleanImpl_array = new WeakMap(), Symbol.toPrimitive)](hint) {
|
|
58
64
|
const value = this.get();
|
|
59
65
|
switch (hint) {
|
|
60
66
|
case 'string':
|
|
@@ -75,8 +81,8 @@ class AtomicBooleanImpl {
|
|
|
75
81
|
return new AtomicBooleanImpl(initialValue ?? false);
|
|
76
82
|
}
|
|
77
83
|
constructor(initialValue) {
|
|
78
|
-
this
|
|
79
|
-
this
|
|
84
|
+
_AtomicBooleanImpl_buffer.set(this, new SharedArrayBuffer(4));
|
|
85
|
+
_AtomicBooleanImpl_array.set(this, new Int32Array(__classPrivateFieldGet(this, _AtomicBooleanImpl_buffer, "f")));
|
|
80
86
|
this.set(initialValue);
|
|
81
87
|
}
|
|
82
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicBoolean.impl.js","sourceRoot":"","sources":["../../src/impl/AtomicBoolean.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AtomicBoolean.impl.js","sourceRoot":"","sources":["../../src/impl/AtomicBoolean.impl.ts"],"names":[],"mappings":";;;;;;;;AASA,wBAEC;AARD;;;;;GAKG;AACH,SAAgB,MAAM,CAAC,YAAsB;IAC3C,OAAO,iBAAiB,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AACxD,CAAC;AAED,yCAAyC;AAEzC,MAAM,eAAe,GAAW,CAAC,CAAC;AAClC,MAAM,cAAc,GAAW,CAAC,CAAC;AAEjC,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,iBAAiB;IAErB;;OAEG;IACH,GAAG;QACD,2CAA2C;QAC3C,OAAO,OAAO,CAAC,IAAI,CAAC,uBAAA,IAAI,gCAAO,EAAE,CAAC,CAAC,KAAK,cAAc,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,KAAc;QAChB,4CAA4C;QAC5C,OAAO,CAAC,KAAK,CAAC,uBAAA,IAAI,gCAAO,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,QAAiB,EAAE,QAAiB;QAChD,MAAM,WAAW,GAAW,eAAe,CAAC,QAAQ,CAAC,CAAC;QACtD,MAAM,YAAY,GAAW,eAAe,CAAC,QAAQ,CAAC,CAAC;QAEvD,6EAA6E;QAC7E,OAAO,OAAO,CAAC,eAAe,CAAC,uBAAA,IAAI,gCAAO,EAAE,CAAC,E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