@jonloucks/contracts-ts 1.3.0 → 2.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/README.md +69 -21
- package/api/AutoClose.d.ts +2 -2
- package/api/AutoClose.d.ts.map +1 -1
- package/api/AutoClose.js +15 -23
- package/api/AutoClose.js.map +1 -1
- package/api/AutoCloseFactory.d.ts +3 -3
- package/api/AutoCloseFactory.d.ts.map +1 -1
- package/api/AutoCloseFactory.js +5 -9
- package/api/AutoCloseFactory.js.map +1 -1
- package/api/AutoOpen.js +3 -6
- package/api/AutoOpen.js.map +1 -1
- package/api/BasicContract.js +6 -11
- package/api/BasicContract.js.map +1 -1
- package/api/BindStrategy.js +4 -9
- package/api/BindStrategy.js.map +1 -1
- package/api/Contract.js +3 -6
- package/api/Contract.js.map +1 -1
- package/api/ContractException.js +5 -10
- package/api/ContractException.js.map +1 -1
- package/api/ContractFactory.js +3 -6
- package/api/ContractFactory.js.map +1 -1
- package/api/Contracts.d.ts +1 -1
- package/api/Contracts.d.ts.map +1 -1
- package/api/Contracts.js +4 -7
- package/api/Contracts.js.map +1 -1
- package/api/ContractsFactory.js +3 -6
- package/api/ContractsFactory.js.map +1 -1
- package/api/Convenience.d.ts +21 -16
- package/api/Convenience.d.ts.map +1 -1
- package/api/Convenience.js +17 -35
- package/api/Convenience.js.map +1 -1
- package/api/Open.d.ts.map +1 -1
- package/api/Open.js +9 -13
- package/api/Open.js.map +1 -1
- package/api/Promisor.d.ts +9 -5
- package/api/Promisor.d.ts.map +1 -1
- package/api/Promisor.js +18 -23
- package/api/Promisor.js.map +1 -1
- package/api/PromisorFactory.d.ts +3 -2
- package/api/PromisorFactory.d.ts.map +1 -1
- package/api/PromisorFactory.js +5 -9
- package/api/PromisorFactory.js.map +1 -1
- package/api/RatifiedContract.js +11 -16
- package/api/RatifiedContract.js.map +1 -1
- package/api/Repository.d.ts +2 -2
- package/api/Repository.d.ts.map +1 -1
- package/api/Repository.js +4 -7
- package/api/Repository.js.map +1 -1
- package/api/RepositoryFactory.js +5 -9
- package/api/RepositoryFactory.js.map +1 -1
- package/api/Types.d.ts +0 -24
- package/api/Types.d.ts.map +1 -1
- package/api/Types.js +13 -62
- package/api/Types.js.map +1 -1
- package/auxiliary/AtomicBoolean.js +3 -6
- package/auxiliary/AtomicBoolean.js.map +1 -1
- package/auxiliary/AtomicBooleanFactory.js +5 -9
- package/auxiliary/AtomicBooleanFactory.js.map +1 -1
- package/auxiliary/AtomicInteger.js +3 -6
- package/auxiliary/AtomicInteger.js.map +1 -1
- package/auxiliary/AtomicIntegerFactory.js +5 -9
- package/auxiliary/AtomicIntegerFactory.js.map +1 -1
- package/auxiliary/AtomicReference.js +3 -6
- package/auxiliary/AtomicReference.js.map +1 -1
- package/auxiliary/AtomicReferenceFactory.js +5 -9
- package/auxiliary/AtomicReferenceFactory.js.map +1 -1
- package/auxiliary/Checks.js +23 -36
- package/auxiliary/Checks.js.map +1 -1
- package/auxiliary/Consumer.js +7 -12
- package/auxiliary/Consumer.js.map +1 -1
- package/auxiliary/Convenience.d.ts +10 -6
- package/auxiliary/Convenience.d.ts.map +1 -1
- package/auxiliary/Convenience.js +17 -19
- package/auxiliary/Convenience.js.map +1 -1
- package/auxiliary/IdempotenState.d.ts +1 -1
- package/auxiliary/IdempotenState.d.ts.map +1 -1
- package/auxiliary/IdempotenState.js +2 -5
- package/auxiliary/IdempotenState.js.map +1 -1
- package/auxiliary/Idempotent.js +3 -6
- package/auxiliary/Idempotent.js.map +1 -1
- package/auxiliary/IdempotentFactory.js +5 -9
- package/auxiliary/IdempotentFactory.js.map +1 -1
- package/auxiliary/IllegalArgumentException.js +4 -8
- package/auxiliary/IllegalArgumentException.js.map +1 -1
- package/auxiliary/IllegalStateException.js +4 -8
- package/auxiliary/IllegalStateException.js.map +1 -1
- package/auxiliary/Predicate.js +9 -15
- package/auxiliary/Predicate.js.map +1 -1
- package/auxiliary/Supplier.js +10 -16
- package/auxiliary/Supplier.js.map +1 -1
- package/auxiliary/Transform.js +11 -18
- package/auxiliary/Transform.js.map +1 -1
- package/auxiliary/Validate.js +12 -15
- package/auxiliary/Validate.js.map +1 -1
- package/impl/AtomicBoolean.impl.js +1 -4
- package/impl/AtomicBoolean.impl.js.map +1 -1
- package/impl/AtomicBooleanFactory.impl.js +3 -6
- package/impl/AtomicBooleanFactory.impl.js.map +1 -1
- package/impl/AtomicInteger.impl.js +1 -4
- package/impl/AtomicInteger.impl.js.map +1 -1
- package/impl/AtomicIntegerFactory.impl.js +3 -6
- package/impl/AtomicIntegerFactory.impl.js.map +1 -1
- package/impl/AtomicReference.impl.js +2 -7
- package/impl/AtomicReference.impl.js.map +1 -1
- package/impl/AtomicReferenceFactory.impl.js +3 -6
- package/impl/AtomicReferenceFactory.impl.js.map +1 -1
- package/impl/AutoCloseFactory.impl.d.ts +0 -3
- package/impl/AutoCloseFactory.impl.d.ts.map +1 -1
- package/impl/AutoCloseFactory.impl.js +7 -10
- package/impl/AutoCloseFactory.impl.js.map +1 -1
- package/impl/AutoCloseMany.impl.d.ts +0 -2
- package/impl/AutoCloseMany.impl.d.ts.map +1 -1
- package/impl/AutoCloseMany.impl.js +5 -8
- package/impl/AutoCloseMany.impl.js.map +1 -1
- package/impl/AutoCloseOne.impl.d.ts.map +1 -1
- package/impl/AutoCloseOne.impl.js +8 -11
- package/impl/AutoCloseOne.impl.js.map +1 -1
- package/impl/ContractFactory.impl.js +7 -11
- package/impl/ContractFactory.impl.js.map +1 -1
- package/impl/Contracts.impl.d.ts.map +1 -1
- package/impl/Contracts.impl.js +38 -41
- package/impl/Contracts.impl.js.map +1 -1
- package/impl/ContractsFactory.impl.js +28 -32
- package/impl/ContractsFactory.impl.js.map +1 -1
- package/impl/ContractsWrapper.impl.js +3 -6
- package/impl/ContractsWrapper.impl.js.map +1 -1
- package/impl/Events.d.ts +1 -2
- package/impl/Events.d.ts.map +1 -1
- package/impl/Events.impl.d.ts +1 -2
- package/impl/Events.impl.d.ts.map +1 -1
- package/impl/Events.impl.js +6 -9
- package/impl/Events.impl.js.map +1 -1
- package/impl/Events.js +1 -2
- package/impl/Events.js.map +1 -1
- package/impl/ExtractorPromisor.impl.d.ts +2 -1
- package/impl/ExtractorPromisor.impl.d.ts.map +1 -1
- package/impl/ExtractorPromisor.impl.js +6 -9
- package/impl/ExtractorPromisor.impl.js.map +1 -1
- package/impl/Idempotent.impl.js +10 -13
- package/impl/Idempotent.impl.js.map +1 -1
- package/impl/IdempotentFactory.impl.js +5 -8
- package/impl/IdempotentFactory.impl.js.map +1 -1
- package/impl/Internal.impl.js +5 -8
- package/impl/Internal.impl.js.map +1 -1
- package/impl/LifeCyclePromisor.impl.js +19 -22
- package/impl/LifeCyclePromisor.impl.js.map +1 -1
- package/impl/Policy.d.ts +0 -1
- package/impl/Policy.d.ts.map +1 -1
- package/impl/Policy.impl.d.ts +1 -3
- package/impl/Policy.impl.d.ts.map +1 -1
- package/impl/Policy.impl.js +7 -10
- package/impl/Policy.impl.js.map +1 -1
- package/impl/Policy.js +1 -2
- package/impl/PromisorFactory.impl.d.ts.map +1 -1
- package/impl/PromisorFactory.impl.js +11 -14
- package/impl/PromisorFactory.impl.js.map +1 -1
- package/impl/Repository.impl.d.ts.map +1 -1
- package/impl/Repository.impl.js +19 -22
- package/impl/Repository.impl.js.map +1 -1
- package/impl/RepositoryFactory.impl.js +3 -6
- package/impl/RepositoryFactory.impl.js.map +1 -1
- package/impl/SingletonPromisor.impl.js +7 -10
- package/impl/SingletonPromisor.impl.js.map +1 -1
- package/impl/Storage.impl.js +3 -7
- package/impl/Storage.impl.js.map +1 -1
- package/impl/ValuePromisor.impl.js +1 -4
- package/impl/ValuePromisor.impl.js.map +1 -1
- package/index.d.ts +8 -20
- package/index.d.ts.map +1 -1
- package/index.js +10 -38
- package/index.js.map +1 -1
- package/package.json +10 -14
- package/version.js +2 -5
- package/version.js.map +1 -1
- package/auxiliary/Functional.d.ts +0 -9
- package/auxiliary/Functional.d.ts.map +0 -1
- package/auxiliary/Functional.js +0 -23
- package/auxiliary/Functional.js.map +0 -1
package/auxiliary/Validate.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
3
2
|
if (value !== null && value !== void 0) {
|
|
4
3
|
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
@@ -51,38 +50,36 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
51
50
|
var e = new Error(message);
|
|
52
51
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
53
52
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const RatifiedContract_1 = require("@jonloucks/contracts-ts/api/RatifiedContract");
|
|
58
|
-
const Checks_1 = require("@jonloucks/contracts-ts/auxiliary/Checks");
|
|
53
|
+
import { ContractException } from "@jonloucks/contracts-ts/api/ContractException";
|
|
54
|
+
import { create as createContract } from "@jonloucks/contracts-ts/api/RatifiedContract";
|
|
55
|
+
import { contractsCheck } from "@jonloucks/contracts-ts/auxiliary/Checks";
|
|
59
56
|
/**
|
|
60
57
|
* A simple runtime validation of deployed implementation
|
|
61
58
|
*
|
|
62
59
|
* @param contracts the contracts to check
|
|
63
60
|
*/
|
|
64
|
-
function validateContracts(contracts) {
|
|
65
|
-
const validContracts =
|
|
61
|
+
export function validateContracts(contracts) {
|
|
62
|
+
const validContracts = contractsCheck(contracts);
|
|
66
63
|
try {
|
|
67
|
-
const contract = (
|
|
64
|
+
const contract = createContract({
|
|
68
65
|
test: (instance) => { return instance instanceof Date; }
|
|
69
66
|
});
|
|
70
67
|
const deliverableValue = new Date();
|
|
71
68
|
if (validContracts.isBound(contract)) {
|
|
72
|
-
throw new
|
|
69
|
+
throw new ContractException("Contract should not be bound.");
|
|
73
70
|
}
|
|
74
71
|
{
|
|
75
72
|
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
76
73
|
try {
|
|
77
74
|
const bindReturn = __addDisposableResource(env_1, validContracts.bind(contract, () => deliverableValue), false);
|
|
78
75
|
if (null === bindReturn || bindReturn === undefined) {
|
|
79
|
-
throw new
|
|
76
|
+
throw new ContractException("Contract bind returned null.");
|
|
80
77
|
}
|
|
81
78
|
if (!validContracts.isBound(contract)) {
|
|
82
|
-
throw new
|
|
79
|
+
throw new ContractException("Contract should have been bound.");
|
|
83
80
|
}
|
|
84
81
|
if (deliverableValue !== validContracts.claim(contract)) {
|
|
85
|
-
throw new
|
|
82
|
+
throw new ContractException("Contract claiming not working.");
|
|
86
83
|
}
|
|
87
84
|
}
|
|
88
85
|
catch (e_1) {
|
|
@@ -94,11 +91,11 @@ function validateContracts(contracts) {
|
|
|
94
91
|
}
|
|
95
92
|
}
|
|
96
93
|
if (validContracts.isBound(contract)) {
|
|
97
|
-
throw new
|
|
94
|
+
throw new ContractException("Contract unbinding not working.");
|
|
98
95
|
}
|
|
99
96
|
}
|
|
100
97
|
catch (thrown) {
|
|
101
|
-
|
|
98
|
+
ContractException.rethrow(thrown, "Contracts unexpected validation error.");
|
|
102
99
|
}
|
|
103
100
|
}
|
|
104
101
|
//# sourceMappingURL=Validate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Validate.js","sourceRoot":"","sources":["../../src/auxiliary/Validate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Validate.js","sourceRoot":"","sources":["../../src/auxiliary/Validate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE1E;;;;EAIE;AACF,MAAM,UAAU,iBAAiB,CAAC,SAAoB;IACpD,MAAM,cAAc,GAAc,cAAc,CAAC,SAAS,CAAC,CAAC;IAC5D,IAAI,CAAC;QACH,MAAM,QAAQ,GAAmB,cAAc,CAAO;YACpD,IAAI,EAAE,CAAC,QAAiB,EAAoB,EAAE,GAAG,OAAO,QAAQ,YAAY,IAAI,CAAC,CAAC,CAAC;SACpF,CAAC,CAAC;QACH,MAAM,gBAAgB,GAAS,IAAI,IAAI,EAAE,CAAC;QAE1C,IAAI,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrC,MAAM,IAAI,iBAAiB,CAAC,+BAA+B,CAAC,CAAC;QAC/D,CAAC;QACD,CAAC;;;gBACC,MAAM,UAAU,kCAAc,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,QAAA,CAAC;gBAEpF,IAAI,IAAI,KAAK,UAAU,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;oBACpD,MAAM,IAAI,iBAAiB,CAAC,8BAA8B,CAAC,CAAC;gBAC9D,CAAC;gBAED,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACtC,MAAM,IAAI,iBAAiB,CAAC,kCAAkC,CAAC,CAAC;gBAClE,CAAC;gBACD,IAAI,gBAAgB,KAAK,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACxD,MAAM,IAAI,iBAAiB,CAAC,gCAAgC,CAAC,CAAC;gBAChE,CAAC;;;;;;;;;SACF;QAED,IAAI,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrC,MAAM,IAAI,iBAAiB,CAAC,iCAAiC,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IAAC,OAAO,MAAe,EAAE,CAAC;QACzB,iBAAiB,CAAC,OAAO,CAAC,MAAM,EAAE,wCAAwC,CAAC,CAAC;IAC9E,CAAC;AACH,CAAC"}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
2
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
3
|
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
5
|
};
|
|
7
6
|
var _AtomicBooleanImpl_buffer, _AtomicBooleanImpl_array;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.create = create;
|
|
10
7
|
/**
|
|
11
8
|
* Factory to create an AtomicBoolean implementation
|
|
12
9
|
*
|
|
13
10
|
* @param initialValue the initial boolean value
|
|
14
11
|
* @returns the new AtomicBoolean implementation
|
|
15
12
|
*/
|
|
16
|
-
function create(initialValue) {
|
|
13
|
+
export function create(initialValue) {
|
|
17
14
|
return AtomicBooleanImpl.internalCreate(initialValue);
|
|
18
15
|
}
|
|
19
16
|
// ---- Implementation details below ----
|
|
@@ -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":";;;;;;AAGA;;;;;GAKG;AACH,MAAM,UAAU,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,EAAE,WAAW,EAAE,YAAY,CAAC,KAAK,WAAW,CAAC;IAC5F,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,QAAiB;QACzB,MAAM,YAAY,GAAW,eAAe,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,WAAW,GAAW,OAAO,CAAC,QAAQ,CAAC,uBAAA,IAAI,gCAAO,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;QAC3E,OAAO,WAAW,KAAK,cAAc,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,uFAAC,MAAM,CAAC,WAAW,EAAC,CAAC,IAAY;QAC/B,MAAM,KAAK,GAAY,IAAI,CAAC,GAAG,EAAE,CAAC;QAClC,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,QAAQ;gBACX,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC1B,KAAK,QAAQ;gBACX,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;YAChC;gBACE,OAAO,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,YAAsB;QAC1C,OAAO,IAAI,iBAAiB,CAAC,YAAY,IAAI,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,YAAoB,YAAqB;QAIhC,oCAA6B,IAAI,iBAAiB,CAAC,CAAC,CAAC,EAAC;QACtD,mCAAqB,IAAI,UAAU,CAAC,uBAAA,IAAI,iCAAQ,CAAC,EAAC;QAJzD,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACzB,CAAC;CAIF"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.create = create;
|
|
4
|
-
const AtomicBoolean_impl_1 = require("./AtomicBoolean.impl");
|
|
1
|
+
import { create as createAtomicBoolean } from "./AtomicBoolean.impl.js";
|
|
5
2
|
/**
|
|
6
3
|
* Factory method to create an AtomicBooleanFactory
|
|
7
4
|
*
|
|
8
5
|
* @returns the AtomicBooleanFactory implementation
|
|
9
6
|
*/
|
|
10
|
-
function create() {
|
|
7
|
+
export function create() {
|
|
11
8
|
return AtomicBooleanFactoryImpl.internalCreate();
|
|
12
9
|
}
|
|
13
10
|
// ---- Implementation details below ----
|
|
@@ -19,7 +16,7 @@ class AtomicBooleanFactoryImpl {
|
|
|
19
16
|
* AtomicBooleanFactory.createAtomicBoolean override
|
|
20
17
|
*/
|
|
21
18
|
createAtomicBoolean(initialValue) {
|
|
22
|
-
return (
|
|
19
|
+
return createAtomicBoolean(initialValue);
|
|
23
20
|
}
|
|
24
21
|
constructor() {
|
|
25
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicBooleanFactory.impl.js","sourceRoot":"","sources":["../../src/impl/AtomicBooleanFactory.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AtomicBooleanFactory.impl.js","sourceRoot":"","sources":["../../src/impl/AtomicBooleanFactory.impl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAExE;;;;GAIG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,wBAAwB,CAAC,cAAc,EAAE,CAAC;AACnD,CAAC;AAED,yCAAyC;AAEzC;;GAEG;AACH,MAAM,wBAAwB;IAE5B;;OAEG;IACH,mBAAmB,CAAC,YAAsB;QACxC,OAAO,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAC3C,CAAC;IAED;IACA,CAAC;IAED,MAAM,CAAC,cAAc;QACnB,OAAO,IAAI,wBAAwB,EAAE,CAAC;IACxC,CAAC;CACF;AAAA,CAAC"}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
2
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
3
|
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
5
|
};
|
|
7
6
|
var _AtomicIntegerImpl_buffer, _AtomicIntegerImpl_array;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.create = create;
|
|
10
7
|
/**
|
|
11
8
|
* Factory to create an AtomicInteger implementation
|
|
12
9
|
*
|
|
13
10
|
* @param initialValue the initial number value
|
|
14
11
|
* @returns the new AtomicInteger implementation
|
|
15
12
|
*/
|
|
16
|
-
function create(initialValue) {
|
|
13
|
+
export function create(initialValue) {
|
|
17
14
|
return AtomicIntegerImpl.internalCreate(initialValue);
|
|
18
15
|
}
|
|
19
16
|
// ---- Implementation details below ----
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicInteger.impl.js","sourceRoot":"","sources":["../../src/impl/AtomicInteger.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AtomicInteger.impl.js","sourceRoot":"","sources":["../../src/impl/AtomicInteger.impl.ts"],"names":[],"mappings":";;;;;;AAGA;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,YAAqB;IAC1C,OAAO,iBAAiB,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AACxD,CAAC;AAED,yCAAyC;AAEzC;;GAEG;AACH,MAAM,iBAAiB;IAErB;;OAEG;IACH,eAAe;QACb,OAAO,OAAO,CAAC,GAAG,CAAC,uBAAA,IAAI,gCAAO,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,OAAO,CAAC,GAAG,CAAC,uBAAA,IAAI,gCAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,GAAG;QACD,OAAO,OAAO,CAAC,IAAI,CAAC,uBAAA,IAAI,gCAAO,EAAE,CAAC,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,KAAa;QACf,OAAO,CAAC,KAAK,CAAC,uBAAA,IAAI,gCAAO,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,aAAqB,EAAE,QAAgB;QACnD,MAAM,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,uBAAA,IAAI,gCAAO,EAAE,CAAC,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;QACjF,OAAO,OAAO,KAAK,aAAa,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,QAAgB;QACxB,OAAO,OAAO,CAAC,QAAQ,CAAC,uBAAA,IAAI,gCAAO,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,uFAAC,MAAM,CAAC,WAAW,EAAC,CAAC,IAAY;QAC/B,MAAM,KAAK,GAAW,IAAI,CAAC,GAAG,EAAE,CAAC;QACjC,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,QAAQ;gBACX,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC1B,KAAK,SAAS;gBACZ,OAAO,KAAK,KAAK,CAAC,CAAC;YACrB;gBACE,OAAO,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,YAAqB;QACzC,OAAO,IAAI,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IAED,YAAoB,eAAuB,CAAC;QAInC,oCAA6B,IAAI,iBAAiB,CAAC,CAAC,CAAC,EAAC;QACtD,mCAAqB,IAAI,UAAU,CAAC,uBAAA,IAAI,iCAAQ,CAAC,EAAC;QAJzD,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACzB,CAAC;CAIF"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.create = create;
|
|
4
|
-
const AtomicInteger_impl_1 = require("./AtomicInteger.impl");
|
|
1
|
+
import { create as createAtomicInteger } from "./AtomicInteger.impl.js";
|
|
5
2
|
/**
|
|
6
3
|
* Factory method to create an AtomicIntegerFactory
|
|
7
4
|
*
|
|
8
5
|
* @returns the AtomicIntegerFactory implementation
|
|
9
6
|
*/
|
|
10
|
-
function create() {
|
|
7
|
+
export function create() {
|
|
11
8
|
return AtomicIntegerFactoryImpl.internalCreate();
|
|
12
9
|
}
|
|
13
10
|
// ---- Implementation details below ----
|
|
@@ -19,7 +16,7 @@ class AtomicIntegerFactoryImpl {
|
|
|
19
16
|
* AtomicIntegerFactory.createAtomicInteger override
|
|
20
17
|
*/
|
|
21
18
|
createAtomicInteger(initialValue) {
|
|
22
|
-
return (
|
|
19
|
+
return createAtomicInteger(initialValue);
|
|
23
20
|
}
|
|
24
21
|
static internalCreate() {
|
|
25
22
|
return new AtomicIntegerFactoryImpl();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicIntegerFactory.impl.js","sourceRoot":"","sources":["../../src/impl/AtomicIntegerFactory.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AtomicIntegerFactory.impl.js","sourceRoot":"","sources":["../../src/impl/AtomicIntegerFactory.impl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAExE;;;;GAIG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,wBAAwB,CAAC,cAAc,EAAE,CAAC;AACnD,CAAC;AAED,yCAAyC;AAEzC;;GAEG;AACH,MAAM,wBAAwB;IAE5B;;OAEG;IACH,mBAAmB,CAAC,YAAqB;QACvC,OAAO,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,cAAc;QACnB,OAAO,IAAI,wBAAwB,EAAE,CAAC;IACxC,CAAC;IAED;IACA,CAAC;CACF;AAAA,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
2
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
3
|
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");
|
|
@@ -11,23 +10,20 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
11
10
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12
11
|
};
|
|
13
12
|
var _AtomicReferenceImpl_value;
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.AtomicReferenceImpl = void 0;
|
|
16
|
-
exports.create = create;
|
|
17
13
|
/**
|
|
18
14
|
* Factory method to create an AtomicReference
|
|
19
15
|
*
|
|
20
16
|
* @param initialValue the initial value for the AtomicReference
|
|
21
17
|
* @returns the new AtomicReference implementation
|
|
22
18
|
*/
|
|
23
|
-
function create(initialValue) {
|
|
19
|
+
export function create(initialValue) {
|
|
24
20
|
return AtomicReferenceImpl.internalCreate(initialValue);
|
|
25
21
|
}
|
|
26
22
|
// ---- Implementation details below ----
|
|
27
23
|
/**
|
|
28
24
|
* AtomicReference implementation.
|
|
29
25
|
*/
|
|
30
|
-
class AtomicReferenceImpl {
|
|
26
|
+
export class AtomicReferenceImpl {
|
|
31
27
|
/**
|
|
32
28
|
* AtomicReference.get override
|
|
33
29
|
*/
|
|
@@ -74,6 +70,5 @@ class AtomicReferenceImpl {
|
|
|
74
70
|
__classPrivateFieldSet(this, _AtomicReferenceImpl_value, initialValue, "f");
|
|
75
71
|
}
|
|
76
72
|
}
|
|
77
|
-
exports.AtomicReferenceImpl = AtomicReferenceImpl;
|
|
78
73
|
_AtomicReferenceImpl_value = new WeakMap();
|
|
79
74
|
//# sourceMappingURL=AtomicReference.impl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicReference.impl.js","sourceRoot":"","sources":["../../src/impl/AtomicReference.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AtomicReference.impl.js","sourceRoot":"","sources":["../../src/impl/AtomicReference.impl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAI,YAA8B;IACtD,OAAO,mBAAmB,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AAC1D,CAAC;AAED,yCAAyC;AAEzC;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAE9B;;OAEG;IACH,GAAG;QACD,OAAO,uBAAA,IAAI,kCAAO,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,QAAyB;QAC3B,uBAAA,IAAI,8BAAU,QAAQ,MAAA,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,aAA8B,EAAE,QAAyB;QACrE,IAAI,uBAAA,IAAI,kCAAO,KAAK,aAAa,EAAE,CAAC;YAClC,uBAAA,IAAI,8BAAU,QAAQ,MAAA,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;aAAM,CAAC;YACN,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,QAAyB;QACjC,MAAM,aAAa,GAAG,uBAAA,IAAI,kCAAO,CAAC;QAClC,uBAAA,IAAI,8BAAU,QAAQ,MAAA,CAAC;QACvB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,aAAa,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,cAAc,CAAI,YAA8B;QACrD,OAAO,IAAI,mBAAmB,CAAI,YAAY,CAAC,CAAC;IAClD,CAAC;IAED,YAAoB,YAA8B;QAIlD,6CAAwB;QAHtB,uBAAA,IAAI,8BAAU,YAAY,MAAA,CAAC;IAC7B,CAAC;CAGF"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.create = create;
|
|
4
|
-
const AtomicReference_impl_1 = require("./AtomicReference.impl");
|
|
1
|
+
import { create as createAtomicReference } from "./AtomicReference.impl.js";
|
|
5
2
|
/**
|
|
6
3
|
* Factory method to create an AtomicReferenceFactory
|
|
7
4
|
*
|
|
8
5
|
* @returns the new AtomicReferenceFactory implementation
|
|
9
6
|
*/
|
|
10
|
-
function create() {
|
|
7
|
+
export function create() {
|
|
11
8
|
return AtomicReferenceFactoryImpl.internalCreate();
|
|
12
9
|
}
|
|
13
10
|
// ---- Implementation details below ----
|
|
@@ -19,7 +16,7 @@ class AtomicReferenceFactoryImpl {
|
|
|
19
16
|
* AtomicReferenceFactory.createAtomicReference override
|
|
20
17
|
*/
|
|
21
18
|
createAtomicReference(initialValue) {
|
|
22
|
-
return (
|
|
19
|
+
return createAtomicReference(initialValue);
|
|
23
20
|
}
|
|
24
21
|
static internalCreate() {
|
|
25
22
|
return new AtomicReferenceFactoryImpl();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AtomicReferenceFactory.impl.js","sourceRoot":"","sources":["../../src/impl/AtomicReferenceFactory.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AtomicReferenceFactory.impl.js","sourceRoot":"","sources":["../../src/impl/AtomicReferenceFactory.impl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAE5E;;;;GAIG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,0BAA0B,CAAC,cAAc,EAAE,CAAC;AACrD,CAAC;AAED,yCAAyC;AAEzC;;GAEG;AACH,MAAM,0BAA0B;IAE9B;;OAEG;IACH,qBAAqB,CAAI,YAA8B;QACrD,OAAO,qBAAqB,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,CAAC,cAAc;QACnB,OAAO,IAAI,0BAA0B,EAAE,CAAC;IAC1C,CAAC;IAED;IACA,CAAC;CACF;AAAA,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { AutoCloseFactory } from "@jonloucks/contracts-ts/api/AutoCloseFactory";
|
|
2
2
|
import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
3
|
-
export { AutoClose, AutoCloseMany, AutoCloseOne, AutoCloseType } from "@jonloucks/contracts-ts/api/AutoClose";
|
|
4
|
-
export { AutoCloseFactory } from "@jonloucks/contracts-ts/api/AutoCloseFactory";
|
|
5
|
-
export { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
6
3
|
/**
|
|
7
4
|
* Create an AutoCloseFactory instance.
|
|
8
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoCloseFactory.impl.d.ts","sourceRoot":"","sources":["../../src/impl/AutoCloseFactory.impl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAIjE
|
|
1
|
+
{"version":3,"file":"AutoCloseFactory.impl.d.ts","sourceRoot":"","sources":["../../src/impl/AutoCloseFactory.impl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAIjE;;;;GAIG;AACH,wBAAgB,MAAM,IAAI,YAAY,CAAC,gBAAgB,CAAC,CAEvD"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const AutoClose_1 = require("@jonloucks/contracts-ts/api/AutoClose");
|
|
5
|
-
const AutoCloseMany_impl_1 = require("./AutoCloseMany.impl");
|
|
6
|
-
const AutoCloseOne_impl_1 = require("./AutoCloseOne.impl");
|
|
1
|
+
import { fromType as typeToAutoClose } from "@jonloucks/contracts-ts/api/AutoClose";
|
|
2
|
+
import { create as createAutoCloseMany } from "./AutoCloseMany.impl.js";
|
|
3
|
+
import { create as createAutoCloseOne } from "./AutoCloseOne.impl.js";
|
|
7
4
|
/**
|
|
8
5
|
* Create an AutoCloseFactory instance.
|
|
9
6
|
*
|
|
10
7
|
* @returns the AutoCloseFactory implementation
|
|
11
8
|
*/
|
|
12
|
-
function create() {
|
|
9
|
+
export function create() {
|
|
13
10
|
return AutoCloseFactoryImpl.internalCreate();
|
|
14
11
|
}
|
|
15
12
|
// ---- Implementation details below ----
|
|
@@ -18,13 +15,13 @@ function create() {
|
|
|
18
15
|
*/
|
|
19
16
|
class AutoCloseFactoryImpl {
|
|
20
17
|
createAutoClose(type) {
|
|
21
|
-
return
|
|
18
|
+
return typeToAutoClose(type);
|
|
22
19
|
}
|
|
23
20
|
createAutoCloseMany() {
|
|
24
|
-
return (
|
|
21
|
+
return createAutoCloseMany();
|
|
25
22
|
}
|
|
26
23
|
createAutoCloseOne() {
|
|
27
|
-
return (
|
|
24
|
+
return createAutoCloseOne();
|
|
28
25
|
}
|
|
29
26
|
static internalCreate() {
|
|
30
27
|
return new AutoCloseFactoryImpl();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoCloseFactory.impl.js","sourceRoot":"","sources":["../../src/impl/AutoCloseFactory.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AutoCloseFactory.impl.js","sourceRoot":"","sources":["../../src/impl/AutoCloseFactory.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,QAAQ,IAAI,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAG3I,OAAO,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,MAAM,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEtE;;;;GAIG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,oBAAoB,CAAC,cAAc,EAAE,CAAC;AAC/C,CAAC;AAED,yCAAyC;AAEzC;;GAEG;AACH,MAAM,oBAAoB;IAExB,eAAe,CAAC,IAAiC;QAC/C,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,mBAAmB;QACjB,OAAO,mBAAmB,EAAE,CAAA;IAC9B,CAAC;IAED,kBAAkB;QAChB,OAAO,kBAAkB,EAAE,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,cAAc;QACnB,OAAO,IAAI,oBAAoB,EAAE,CAAC;IACpC,CAAC;IAED;IACA,CAAC;CACF"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { AutoCloseMany } from "@jonloucks/contracts-ts/api/AutoClose";
|
|
2
2
|
import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
3
|
-
export { AutoCloseMany } from "@jonloucks/contracts-ts/api/AutoClose";
|
|
4
|
-
export { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
5
3
|
/**
|
|
6
4
|
* Create an AutoCloseMany instance.
|
|
7
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoCloseMany.impl.d.ts","sourceRoot":"","sources":["../../src/impl/AutoCloseMany.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,
|
|
1
|
+
{"version":3,"file":"AutoCloseMany.impl.d.ts","sourceRoot":"","sources":["../../src/impl/AutoCloseMany.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAA8C,MAAM,uCAAuC,CAAC;AAC7H,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGjE;;;;GAIG;AACH,wBAAgB,MAAM,IAAI,YAAY,CAAC,aAAa,CAAC,CAEpD"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
2
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
3
|
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
5
|
};
|
|
7
6
|
var _AutoCloseManyImpl_closeables;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const AutoClose_1 = require("@jonloucks/contracts-ts/api/AutoClose");
|
|
11
|
-
const Internal_impl_1 = require("./Internal.impl");
|
|
7
|
+
import { fromType as typeToAutoClose } from "@jonloucks/contracts-ts/api/AutoClose";
|
|
8
|
+
import { Internal } from "./Internal.impl.js";
|
|
12
9
|
/**
|
|
13
10
|
* Create an AutoCloseMany instance.
|
|
14
11
|
*
|
|
15
12
|
* @returns the AutoCloseMany implementation
|
|
16
13
|
*/
|
|
17
|
-
function create() {
|
|
14
|
+
export function create() {
|
|
18
15
|
return AutoCloseManyImpl.internalCreate();
|
|
19
16
|
}
|
|
20
17
|
// ---- Implementation details below ----
|
|
@@ -23,7 +20,7 @@ function create() {
|
|
|
23
20
|
*/
|
|
24
21
|
class AutoCloseManyImpl {
|
|
25
22
|
add(closeable) {
|
|
26
|
-
__classPrivateFieldGet(this, _AutoCloseManyImpl_closeables, "f").push(
|
|
23
|
+
__classPrivateFieldGet(this, _AutoCloseManyImpl_closeables, "f").push(typeToAutoClose(closeable));
|
|
27
24
|
}
|
|
28
25
|
close() {
|
|
29
26
|
const errorList = [];
|
|
@@ -36,7 +33,7 @@ class AutoCloseManyImpl {
|
|
|
36
33
|
}
|
|
37
34
|
}
|
|
38
35
|
if (errorList.length > 0) {
|
|
39
|
-
|
|
36
|
+
Internal.throwAggregateError("Multiple while closing.", ...errorList);
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
39
|
[(_AutoCloseManyImpl_closeables = new WeakMap(), Symbol.dispose)]() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoCloseMany.impl.js","sourceRoot":"","sources":["../../src/impl/AutoCloseMany.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AutoCloseMany.impl.js","sourceRoot":"","sources":["../../src/impl/AutoCloseMany.impl.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAA2C,QAAQ,IAAI,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAE7H,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;GAIG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,iBAAiB,CAAC,cAAc,EAAE,CAAC;AAC5C,CAAC;AAED,yCAAyC;AAEzC;;GAEG;AACH,MAAM,iBAAiB;IAErB,GAAG,CAAC,SAAsC;QACxC,uBAAA,IAAI,qCAAY,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,KAAK;QACH,MAAM,SAAS,GAAc,EAAE,CAAC;QAChC,OAAO,uBAAA,IAAI,qCAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC;gBACH,uBAAA,IAAI,qCAAY,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC;YAClC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;QACD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzB,QAAQ,CAAC,mBAAmB,CAAC,yBAAyB,EAAE,GAAG,SAAS,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IAED,iDAAC,MAAM,CAAC,OAAO,EAAC;QACd,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,MAAM,CAAC,cAAc;QACnB,OAAO,IAAI,iBAAiB,EAAE,CAAC;IACjC,CAAC;IAED;QAIS,wCAAyC,EAAE,EAAC;IAHrD,CAAC;CAIF;AAAA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoCloseOne.impl.d.ts","sourceRoot":"","sources":["../../src/impl/AutoCloseOne.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,
|
|
1
|
+
{"version":3,"file":"AutoCloseOne.impl.d.ts","sourceRoot":"","sources":["../../src/impl/AutoCloseOne.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAyE,MAAM,uCAAuC,CAAC;AACvJ,OAAO,EAA2B,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAI1F;;;GAGG;AACH,wBAAgB,MAAM,IAAI,YAAY,CAAC,YAAY,CAAC,CAEnD"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
2
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
3
|
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
5
|
};
|
|
7
6
|
var _AutoCloseOneImpl_reference;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
12
|
-
const AtomicReference_impl_1 = require("./AtomicReference.impl");
|
|
7
|
+
import { fromType as typeToAutoClose, unwrap as unwrapAutoClose } from "@jonloucks/contracts-ts/api/AutoClose";
|
|
8
|
+
import { isPresent } from "@jonloucks/contracts-ts/api/Types";
|
|
9
|
+
import { create as createAtomicReference } from "./AtomicReference.impl.js";
|
|
13
10
|
/**
|
|
14
11
|
* Create an AutoCloseOne instance.
|
|
15
12
|
* @returns the AutoCloseOne implementation
|
|
16
13
|
*/
|
|
17
|
-
function create() {
|
|
14
|
+
export function create() {
|
|
18
15
|
return AutoCloseOneImpl.internalCreate();
|
|
19
16
|
}
|
|
20
17
|
// ---- Implementation details below ----
|
|
@@ -24,7 +21,7 @@ function create() {
|
|
|
24
21
|
class AutoCloseOneImpl {
|
|
25
22
|
close() {
|
|
26
23
|
let autoClose = __classPrivateFieldGet(this, _AutoCloseOneImpl_reference, "f").get();
|
|
27
|
-
if (
|
|
24
|
+
if (isPresent(autoClose) && __classPrivateFieldGet(this, _AutoCloseOneImpl_reference, "f").compareAndSet(autoClose, null)) {
|
|
28
25
|
autoClose.close();
|
|
29
26
|
}
|
|
30
27
|
}
|
|
@@ -33,8 +30,8 @@ class AutoCloseOneImpl {
|
|
|
33
30
|
}
|
|
34
31
|
set(newClose) {
|
|
35
32
|
const current = __classPrivateFieldGet(this, _AutoCloseOneImpl_reference, "f").get();
|
|
36
|
-
const validNewClose =
|
|
37
|
-
if (
|
|
33
|
+
const validNewClose = isPresent(newClose) ? typeToAutoClose(newClose) : newClose;
|
|
34
|
+
if (unwrapAutoClose(current) === unwrapAutoClose(validNewClose)) {
|
|
38
35
|
return; // no change
|
|
39
36
|
}
|
|
40
37
|
try {
|
|
@@ -48,7 +45,7 @@ class AutoCloseOneImpl {
|
|
|
48
45
|
return new AutoCloseOneImpl();
|
|
49
46
|
}
|
|
50
47
|
constructor() {
|
|
51
|
-
_AutoCloseOneImpl_reference.set(this, (
|
|
48
|
+
_AutoCloseOneImpl_reference.set(this, createAtomicReference());
|
|
52
49
|
// empty
|
|
53
50
|
}
|
|
54
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoCloseOne.impl.js","sourceRoot":"","sources":["../../src/impl/AutoCloseOne.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AutoCloseOne.impl.js","sourceRoot":"","sources":["../../src/impl/AutoCloseOne.impl.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAA0C,QAAQ,IAAI,eAAe,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACvJ,OAAO,EAAE,SAAS,EAA8B,MAAM,mCAAmC,CAAC;AAE1F,OAAO,EAAE,MAAM,IAAI,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAE5E;;;GAGG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,gBAAgB,CAAC,cAAc,EAAE,CAAC;AAC3C,CAAC;AAED,yCAAyC;AAEzC;;GAEG;AACH,MAAM,gBAAgB;IACpB,KAAK;QACH,IAAI,SAAS,GAAG,uBAAA,IAAI,mCAAW,CAAC,GAAG,EAAE,CAAC;QACtC,IAAI,SAAS,CAAC,SAAS,CAAC,IAAI,uBAAA,IAAI,mCAAW,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC;YAC3E,SAAS,CAAC,KAAK,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAED,+CAAC,MAAM,CAAC,OAAO,EAAC;QACd,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,GAAG,CAAC,QAAqC;QACvC,MAAM,OAAO,GAAG,uBAAA,IAAI,mCAAW,CAAC,GAAG,EAAE,CAAC;QACtC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QAEjF,IAAI,eAAe,CAAC,OAAO,CAAC,KAAK,eAAe,CAAC,aAAa,CAAC,EAAE,CAAC;YAChE,OAAO,CAAC,YAAY;QACtB,CAAC;QAED,IAAI,CAAC;YACH,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,iCAAiC;QACjD,CAAC;gBAAS,CAAC;YACT,uBAAA,IAAI,mCAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,MAAM,CAAC,cAAc;QACnB,OAAO,IAAI,gBAAgB,EAAE,CAAC;IAChC,CAAC;IAED;QAIS,sCAAyC,qBAAqB,EAAa,EAAC;QAHnF,QAAQ;IACV,CAAC;CAGF"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.create = create;
|
|
4
|
-
exports.createContract = createContract;
|
|
5
|
-
const BasicContract_1 = require("@jonloucks/contracts-ts/api/BasicContract");
|
|
6
|
-
const RatifiedContract_1 = require("@jonloucks/contracts-ts/api/RatifiedContract");
|
|
1
|
+
import { create as createBasicContract } from "@jonloucks/contracts-ts/api/BasicContract";
|
|
2
|
+
import { create as createRatifiedContract, isRatifiableConfig } from "@jonloucks/contracts-ts/api/RatifiedContract";
|
|
7
3
|
/**
|
|
8
4
|
* Factory method to create a ContractFactory
|
|
9
5
|
*
|
|
10
6
|
* @returns the new ContractFactory implementation
|
|
11
7
|
*/
|
|
12
|
-
function create() {
|
|
8
|
+
export function create() {
|
|
13
9
|
return ContractFactoryImpl.internalCreate();
|
|
14
10
|
}
|
|
15
11
|
/**
|
|
@@ -17,7 +13,7 @@ function create() {
|
|
|
17
13
|
* @param config optional Contract configuration
|
|
18
14
|
* @returns the new Contract implementation
|
|
19
15
|
*/
|
|
20
|
-
function createContract(config) {
|
|
16
|
+
export function createContract(config) {
|
|
21
17
|
return create().createContract(config);
|
|
22
18
|
}
|
|
23
19
|
// ---- Implementation details below ----
|
|
@@ -26,11 +22,11 @@ function createContract(config) {
|
|
|
26
22
|
*/
|
|
27
23
|
class ContractFactoryImpl {
|
|
28
24
|
createContract(config) {
|
|
29
|
-
if (config?.ratified === true ||
|
|
30
|
-
return (
|
|
25
|
+
if (config?.ratified === true || isRatifiableConfig(config)) {
|
|
26
|
+
return createRatifiedContract(config);
|
|
31
27
|
}
|
|
32
28
|
else {
|
|
33
|
-
return (
|
|
29
|
+
return createBasicContract(config);
|
|
34
30
|
}
|
|
35
31
|
}
|
|
36
32
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractFactory.impl.js","sourceRoot":"","sources":["../../src/impl/ContractFactory.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContractFactory.impl.js","sourceRoot":"","sources":["../../src/impl/ContractFactory.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAE1F,OAAO,EAAE,MAAM,IAAI,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAKpH;;;;GAIG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,mBAAmB,CAAC,cAAc,EAAE,CAAC;AAC9C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAI,MAAgC;IAChE,OAAO,MAAM,EAAE,CAAC,cAAc,CAAI,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,yCAAyC;AAEzC;;GAEG;AACH,MAAM,mBAAmB;IACvB,cAAc,CAAI,MAAgC;QAChD,IAAI,MAAM,EAAE,QAAQ,KAAK,IAAI,IAAI,kBAAkB,CAAI,MAAM,CAAC,EAAE,CAAC;YAC/D,OAAO,sBAAsB,CAAI,MAAM,CAAC,CAAC;QAC3C,CAAC;aAAM,CAAC;YACN,OAAO,mBAAmB,CAAI,MAAM,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAED;IACA,CAAC;IAED,MAAM,CAAC,cAAc;QACnB,OAAO,IAAI,mBAAmB,EAAE,CAAC;IACnC,CAAC;CACF;AAAA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contracts.impl.d.ts","sourceRoot":"","sources":["../../src/impl/Contracts.impl.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAE1E,OAAO,EAAgB,YAAY,EAAa,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"Contracts.impl.d.ts","sourceRoot":"","sources":["../../src/impl/Contracts.impl.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAE1E,OAAO,EAAgB,YAAY,EAAa,MAAM,mCAAmC,CAAC;AAc1F;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,CAE9D"}
|