@jonloucks/concurrency-ts 0.4.0 → 0.5.1
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/Types.d.ts +3 -3
- package/api/Types.d.ts.map +1 -1
- package/api/Types.js +3 -3
- package/api/Types.js.map +1 -1
- package/api/WaitableNotify.d.ts +2 -2
- package/api/WaitableNotify.d.ts.map +1 -1
- package/api/WaitableSupplier.d.ts +2 -2
- package/api/WaitableSupplier.d.ts.map +1 -1
- package/impl/CompleteLater.impl.d.ts +1 -1
- package/impl/CompleteLater.impl.d.ts.map +1 -1
- package/impl/CompleteLater.impl.js +1 -1
- package/impl/CompleteLater.impl.js.map +1 -1
- package/impl/CompleteNow.impl.d.ts +1 -1
- package/impl/CompleteNow.impl.d.ts.map +1 -1
- package/impl/CompleteNow.impl.js +1 -1
- package/impl/CompleteNow.impl.js.map +1 -1
- package/impl/Waitable.impl.js +3 -3
- package/impl/Waitable.impl.js.map +1 -1
- package/package.json +12 -8
- package/version.js +1 -1
- package/auxiliary/Consumer.d.ts +0 -45
- package/auxiliary/Consumer.d.ts.map +0 -1
- package/auxiliary/Consumer.js +0 -45
- package/auxiliary/Consumer.js.map +0 -1
- package/auxiliary/Predicate.d.ts +0 -55
- package/auxiliary/Predicate.d.ts.map +0 -1
- package/auxiliary/Predicate.js +0 -73
- package/auxiliary/Predicate.js.map +0 -1
- package/auxiliary/Supplier.d.ts +0 -52
- package/auxiliary/Supplier.d.ts.map +0 -1
- package/auxiliary/Supplier.js +0 -67
- package/auxiliary/Supplier.js.map +0 -1
package/api/Types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { type Consumer, type Method as ConsumerFunction, guard as consumerGuard, type Type as ConsumerType } from "@jonloucks/
|
|
2
|
-
export { type Predicate, type Method as PredicateFunction, guard as predicateGuard, type Type as PredicateType } from "@jonloucks/
|
|
3
|
-
export { type Supplier, type Method as SupplierFunction, guard as supplierGuard, type Type as SupplierType, toValue as supplierToValue } from "@jonloucks/
|
|
1
|
+
export { type Consumer, type Method as ConsumerFunction, guard as consumerGuard, type Type as ConsumerType } from "@jonloucks/contracts-ts/auxiliary/Consumer";
|
|
2
|
+
export { type Predicate, type Method as PredicateFunction, guard as predicateGuard, type Type as PredicateType } from "@jonloucks/contracts-ts/auxiliary/Predicate";
|
|
3
|
+
export { type Supplier, type Method as SupplierFunction, guard as supplierGuard, type Type as SupplierType, toValue as supplierToValue } from "@jonloucks/contracts-ts/auxiliary/Supplier";
|
|
4
4
|
export { guardFunctions, isNotPresent, isNumber, isPresent, isString, type OptionalType, type RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
5
5
|
/**
|
|
6
6
|
* A type that can be a value of type T, null, or undefined
|
package/api/Types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../src/api/Types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,IAAI,gBAAgB,EAAE,KAAK,IAAI,aAAa,EAAE,KAAK,IAAI,IAAI,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../src/api/Types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,IAAI,gBAAgB,EAAE,KAAK,IAAI,aAAa,EAAE,KAAK,IAAI,IAAI,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC/J,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,IAAI,iBAAiB,EAAE,KAAK,IAAI,cAAc,EAAE,KAAK,IAAI,IAAI,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACpK,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,IAAI,gBAAgB,EAAE,KAAK,IAAI,aAAa,EAAE,KAAK,IAAI,IAAI,YAAY,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC3L,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGtJ;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,CAAiB;AAItF,MAAM,WAAW,QAAQ;IACvB,IAAI,YAAY,IAAI,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,QAIzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,QAIzB,CAAC"}
|
package/api/Types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { guard as consumerGuard } from "@jonloucks/
|
|
2
|
-
export { guard as predicateGuard } from "@jonloucks/
|
|
3
|
-
export { guard as supplierGuard, toValue as supplierToValue } from "@jonloucks/
|
|
1
|
+
export { guard as consumerGuard } from "@jonloucks/contracts-ts/auxiliary/Consumer";
|
|
2
|
+
export { guard as predicateGuard } from "@jonloucks/contracts-ts/auxiliary/Predicate";
|
|
3
|
+
export { guard as supplierGuard, toValue as supplierToValue } from "@jonloucks/contracts-ts/auxiliary/Supplier";
|
|
4
4
|
export { guardFunctions, isNotPresent, isNumber, isPresent, isString } from "@jonloucks/contracts-ts/api/Types";
|
|
5
5
|
/**
|
|
6
6
|
* Type guard to determine if a value is Throwable
|
package/api/Types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Types.js","sourceRoot":"","sources":["../../src/api/Types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,IAAI,aAAa,EAA6B,MAAM,
|
|
1
|
+
{"version":3,"file":"Types.js","sourceRoot":"","sources":["../../src/api/Types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,IAAI,aAAa,EAA6B,MAAM,4CAA4C,CAAC;AAC/J,OAAO,EAAoD,KAAK,IAAI,cAAc,EAA8B,MAAM,6CAA6C,CAAC;AACpK,OAAO,EAAkD,KAAK,IAAI,aAAa,EAA6B,OAAO,IAAI,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC3L,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAwC,MAAM,mCAAmC,CAAC;AAQtJ;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAI,KAAc,IAA2B,OAAO,IAAI,CAAC,CAAC,CAAC;AAQtF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAa;IACnC,IAAI,YAAY;QACd,OAAO,CAAC,CAAC;IACX,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAa;IACnC,IAAI,YAAY;QACd,OAAO,MAAM,CAAC,gBAAgB,CAAC;IACjC,CAAC;CACF,CAAC"}
|
package/api/WaitableNotify.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RequiredType } from "@jonloucks/concurrency-ts/api/Types";
|
|
2
|
-
import { Type as ConsumerType } from "@jonloucks/
|
|
3
|
-
import { Type as PredicateType } from "@jonloucks/
|
|
2
|
+
import { Type as ConsumerType } from "@jonloucks/contracts-ts/auxiliary/Consumer";
|
|
3
|
+
import { Type as PredicateType } from "@jonloucks/contracts-ts/auxiliary/Predicate";
|
|
4
4
|
import { AutoClose } from "@jonloucks/contracts-ts/api/AutoClose";
|
|
5
5
|
export { type AutoClose, type ConsumerType, type PredicateType, type RequiredType };
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WaitableNotify.d.ts","sourceRoot":"","sources":["../../src/api/WaitableNotify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"WaitableNotify.d.ts","sourceRoot":"","sources":["../../src/api/WaitableNotify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAElE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,CAAC;AAEpF;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC;IAE/B;;;;;;;;;KASC;IACD,WAAW,CAAC,SAAS,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;CAC1H;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAEjF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Duration, OptionalType, RequiredType } from "@jonloucks/concurrency-ts/api/Types";
|
|
2
|
-
import { Type as PredicateType } from "@jonloucks/
|
|
3
|
-
import { Supplier } from "@jonloucks/
|
|
2
|
+
import { Type as PredicateType } from "@jonloucks/contracts-ts/auxiliary/Predicate";
|
|
3
|
+
import { Supplier } from "@jonloucks/contracts-ts/auxiliary/Supplier";
|
|
4
4
|
export { type RequiredType, type OptionalType, type Duration, type PredicateType, type Supplier };
|
|
5
5
|
/**
|
|
6
6
|
* Waitable supplier
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WaitableSupplier.d.ts","sourceRoot":"","sources":["../../src/api/WaitableSupplier.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,qCAAqC,CAAC;AAE3G,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"WaitableSupplier.d.ts","sourceRoot":"","sources":["../../src/api/WaitableSupplier.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,qCAAqC,CAAC;AAE3G,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AAEtE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,CAAA;AAEjG;;;GAGG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,QAAQ,CAAC,CAAC,CAAC;IAEtD;;OAEG;IACH,MAAM,IAAI,CAAC,CAAC;IAEZ;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IAEvD;;;;;;;;;;;;;;;;;OAiBG;IACH,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACvF;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAMzF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Type as ConsumerType } from "@jonloucks/
|
|
1
|
+
import { Type as ConsumerType } from "@jonloucks/contracts-ts/auxiliary/Consumer";
|
|
2
2
|
import { OnCompletion } from "@jonloucks/concurrency-ts/api/OnCompletion";
|
|
3
3
|
import { RequiredType } from "@jonloucks/concurrency-ts/api/Types";
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompleteLater.impl.d.ts","sourceRoot":"","sources":["../../src/impl/CompleteLater.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,IAAI,IAAI,YAAY,EAAkC,MAAM,
|
|
1
|
+
{"version":3,"file":"CompleteLater.impl.d.ts","sourceRoot":"","sources":["../../src/impl/CompleteLater.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,IAAI,IAAI,YAAY,EAAkC,MAAM,4CAA4C,CAAC;AAC5H,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,YAAY,EAA2B,MAAM,qCAAqC,CAAC;AAI5F;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAmBzI"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fromType as fromTypeToConsumer } from "@jonloucks/
|
|
1
|
+
import { fromType as fromTypeToConsumer } from "@jonloucks/contracts-ts/auxiliary/Consumer";
|
|
2
2
|
import { onCompletionCheck } from "@jonloucks/concurrency-ts/auxiliary/Checks";
|
|
3
3
|
/**
|
|
4
4
|
* Completes the given OnCompletion later by delegating to the provided delegate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompleteLater.impl.js","sourceRoot":"","sources":["../../src/impl/CompleteLater.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,QAAQ,IAAI,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CompleteLater.impl.js","sourceRoot":"","sources":["../../src/impl/CompleteLater.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,QAAQ,IAAI,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAG5H,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAG/E;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAI,YAA2C,EAAE,QAAqD;IACjI,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC,kCAAkC;IAC7F,IAAI,KAAK,GAAoB,SAAS,CAAC;IACvC,IAAI,MAAM,GAAqC,SAAS,CAAC;IACzD,IAAI,SAAS,GAAY,KAAK,CAAC;IAE/B,IAAI,CAAC;QACH,MAAM,aAAa,GAA8B,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAC9E,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,wBAAwB;QAC7D,SAAS,GAAG,IAAI,CAAC;IACnB,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,MAAM,GAAG,MAAM,CAAC;QAChB,KAAK,GAAG,QAAQ,CAAC;QACjB,MAAM,MAAM,CAAC;IACf,CAAC;YAAS,CAAC;QACT,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,iBAAiB,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Type as SupplierType } from "@jonloucks/
|
|
1
|
+
import { Type as SupplierType } from "@jonloucks/contracts-ts/auxiliary/Supplier";
|
|
2
2
|
import { RequiredType, OptionalType } from "@jonloucks/concurrency-ts/api/Types";
|
|
3
3
|
import { OnCompletion } from "@jonloucks/concurrency-ts/api/OnCompletion";
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompleteNow.impl.d.ts","sourceRoot":"","sources":["../../src/impl/CompleteNow.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,IAAI,IAAI,YAAY,EAAkC,MAAM,
|
|
1
|
+
{"version":3,"file":"CompleteNow.impl.d.ts","sourceRoot":"","sources":["../../src/impl/CompleteNow.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,IAAI,IAAI,YAAY,EAAkC,MAAM,4CAA4C,CAAC;AAC5H,OAAO,EAAE,YAAY,EAAE,YAAY,EAAa,MAAM,qCAAqC,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAI1E;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAmBxI"}
|
package/impl/CompleteNow.impl.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fromType as fromTypeToSupplier } from "@jonloucks/
|
|
1
|
+
import { fromType as fromTypeToSupplier } from "@jonloucks/contracts-ts/auxiliary/Supplier";
|
|
2
2
|
import { onCompletionCheck } from "@jonloucks/concurrency-ts/auxiliary/Checks";
|
|
3
3
|
/**
|
|
4
4
|
* Completes the given OnCompletion immediately with the result of the successBlock.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompleteNow.impl.js","sourceRoot":"","sources":["../../src/impl/CompleteNow.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,QAAQ,IAAI,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CompleteNow.impl.js","sourceRoot":"","sources":["../../src/impl/CompleteNow.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,QAAQ,IAAI,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAG5H,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAG/E;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAI,YAA2C,EAAE,YAA2C;IACrH,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC,kCAAkC;IAC7F,IAAI,KAAuB,CAAC;IAC5B,IAAI,MAAM,GAAqC,SAAS,CAAC;IACzD,IAAI,KAAK,GAAoB,SAAS,CAAC;IAEvC,IAAI,CAAC;QACH,oCAAoC;QACpC,MAAM,aAAa,GAAgB,kBAAkB,CAAC,YAAY,CAAC,CAAC;QACpE,KAAK,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC;QAC/B,KAAK,GAAG,WAAW,CAAC;QACpB,OAAO,KAAK,CAAC;IACf,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,MAAM,GAAG,MAAM,CAAC;QAChB,KAAK,GAAG,QAAQ,CAAC;QACjB,MAAM,MAAM,CAAC;IACf,CAAC;YAAS,CAAC;QACT,iBAAiB,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
|
package/impl/Waitable.impl.js
CHANGED
|
@@ -11,9 +11,9 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
11
11
|
};
|
|
12
12
|
var _WaitableImpl_isOpen, _WaitableImpl_reference, _WaitableImpl_valueObservers;
|
|
13
13
|
import { ConcurrencyException } from "@jonloucks/concurrency-ts/api/ConcurrencyException";
|
|
14
|
-
import { fromType as consumerFromType } from "@jonloucks/
|
|
15
|
-
import { fromType as predicateFromType } from "@jonloucks/
|
|
16
|
-
import { fromType as supplierFromType } from "@jonloucks/
|
|
14
|
+
import { fromType as consumerFromType } from "@jonloucks/contracts-ts/auxiliary/Consumer";
|
|
15
|
+
import { fromType as predicateFromType } from "@jonloucks/contracts-ts/auxiliary/Predicate";
|
|
16
|
+
import { fromType as supplierFromType } from "@jonloucks/contracts-ts/auxiliary/Supplier";
|
|
17
17
|
import { createAtomicBoolean, createAtomicReference } from "@jonloucks/contracts-ts/auxiliary/Convenience";
|
|
18
18
|
import { IllegalStateException } from "@jonloucks/contracts-ts/auxiliary/IllegalStateException";
|
|
19
19
|
import { AUTO_CLOSE_NONE, inlineAutoClose } from "@jonloucks/contracts-ts/api/AutoClose";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Waitable.impl.js","sourceRoot":"","sources":["../../src/impl/Waitable.impl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAG1F,OAAO,EAAY,QAAQ,IAAI,gBAAgB,EAAwB,MAAM,
|
|
1
|
+
{"version":3,"file":"Waitable.impl.js","sourceRoot":"","sources":["../../src/impl/Waitable.impl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAG1F,OAAO,EAAY,QAAQ,IAAI,gBAAgB,EAAwB,MAAM,4CAA4C,CAAC;AAC1H,OAAO,EAAa,QAAQ,IAAI,iBAAiB,EAAyB,MAAM,6CAA6C,CAAC;AAC9H,OAAO,EAAY,QAAQ,IAAI,gBAAgB,EAAwB,MAAM,4CAA4C,CAAC;AAC1H,OAAO,EAAkC,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAC3I,OAAO,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAC;AAChG,OAAO,EAAa,eAAe,EAAS,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAG3G,OAAO,EAAE,MAAM,IAAI,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,Q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AAK,QAAQ,EAAE,CAAC;YAC1B,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IAEO,eAAe,CAAC,QAAyB;QAC/C,KAAK,MAAM,aAAa,IAAI,uBAAA,IAAI,oCAAgB,EAAE,CAAC;YACjD,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;IAEO,iBAAiB;QACvB,KAAK,MAAM,aAAa,IAAI,uBAAA,IAAI,oCAAgB,EAAE,CAAC;YACjD,aAAa,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;IAEO,UAAU;QAChB,IAAI,CAAC,uBAAA,IAAI,4BAAQ,CAAC,GAAG,EAAE,EAAE,CAAC;YACxB,MAAM,IAAI,qBAAqB,CAAC,wBAAwB,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;CAKF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jonloucks/concurrency-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "TypeScript asynchronous concurrency library with Waitables, Completables, and State Machines",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -37,7 +37,9 @@
|
|
|
37
37
|
"build": "tsc",
|
|
38
38
|
"test": "tsx --test $(find src -name '*.test.ts')",
|
|
39
39
|
"test:watch": "tsx --test --watch $(find src -name '*.test.ts')",
|
|
40
|
-
"test:coverage": "
|
|
40
|
+
"test:coverage": "mkdir -p coverage && tsx --test --experimental-test-coverage --experimental-specifier-resolution=node --test-reporter=lcov $(find src -name '*.test.ts') > coverage/lcov.info",
|
|
41
|
+
"test:coverage-report": "npx badges-ts coverage-report",
|
|
42
|
+
"test:coverage-gate": "npx badges-ts coverage-gate",
|
|
41
43
|
"lint": "eslint . --ext .ts",
|
|
42
44
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
43
45
|
"prepublishOnly": "npm run build",
|
|
@@ -71,18 +73,20 @@
|
|
|
71
73
|
"publishConfig": {
|
|
72
74
|
"registry": "https://registry.npmjs.org/"
|
|
73
75
|
},
|
|
76
|
+
"overrides": {
|
|
77
|
+
"minimatch": "10.2.1"
|
|
78
|
+
},
|
|
74
79
|
"devDependencies": {
|
|
75
|
-
"@jonloucks/badges-ts": "^1.0
|
|
76
|
-
"@types/node": "^25.
|
|
80
|
+
"@jonloucks/badges-ts": "^1.4.0",
|
|
81
|
+
"@types/node": "^25.3.0",
|
|
77
82
|
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
78
|
-
"@typescript-eslint/parser": "^8.
|
|
79
|
-
"
|
|
80
|
-
"eslint": "^9.39.2",
|
|
83
|
+
"@typescript-eslint/parser": "^8.56.0",
|
|
84
|
+
"eslint": "^10.0.0",
|
|
81
85
|
"tsx": "^4.21.0",
|
|
82
86
|
"typedoc": "^0.28.17",
|
|
83
87
|
"typescript": "^5.9.3"
|
|
84
88
|
},
|
|
85
89
|
"dependencies": {
|
|
86
|
-
"@jonloucks/contracts-ts": "^2.0.
|
|
90
|
+
"@jonloucks/contracts-ts": "^2.0.3"
|
|
87
91
|
}
|
|
88
92
|
}
|
package/version.js
CHANGED
package/auxiliary/Consumer.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Consumer.ts
|
|
3
|
-
* Candidate for inclusion in api-ts
|
|
4
|
-
* Defines a Consumer type that can consume values of type T.
|
|
5
|
-
*/
|
|
6
|
-
import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
7
|
-
/**
|
|
8
|
-
* A method that consumes a value of type T
|
|
9
|
-
*/
|
|
10
|
-
export type Method<T> = (value: T) => void;
|
|
11
|
-
/**
|
|
12
|
-
* A Consumer that consumes values of type T
|
|
13
|
-
*/
|
|
14
|
-
export interface Consumer<T> {
|
|
15
|
-
consume(value: T): void;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* A type that can be either a Method or a Consumer
|
|
19
|
-
*/
|
|
20
|
-
export type Type<T> = Method<T> | Consumer<T>;
|
|
21
|
-
/**
|
|
22
|
-
* Duck type guard check for Consumer
|
|
23
|
-
*
|
|
24
|
-
* @param instance the instance to check
|
|
25
|
-
* @param <T> the type of value consumed
|
|
26
|
-
* @returns true if instance is a Consumer, false otherwise
|
|
27
|
-
*/
|
|
28
|
-
export declare function guard<T>(instance: unknown): instance is RequiredType<Consumer<T>>;
|
|
29
|
-
/**
|
|
30
|
-
* Convert a Type to a Consumer
|
|
31
|
-
*
|
|
32
|
-
* @param type the type to convert
|
|
33
|
-
* @param <T> the type of value consumed
|
|
34
|
-
* @returns a Consumer that consumes values of type T
|
|
35
|
-
*/
|
|
36
|
-
export declare function fromType<T>(type: Type<T>): RequiredType<Consumer<T>>;
|
|
37
|
-
/**
|
|
38
|
-
* Check that a Consumer is present
|
|
39
|
-
*
|
|
40
|
-
* @param consumer the consumer to check
|
|
41
|
-
* @return the consumer if present
|
|
42
|
-
* @throws IllegalArgumentException if the consumer is not present
|
|
43
|
-
*/
|
|
44
|
-
export declare function check<T>(consumer: Type<T>): Type<T>;
|
|
45
|
-
//# sourceMappingURL=Consumer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Consumer.d.ts","sourceRoot":"","sources":["../../src/auxiliary/Consumer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAkB,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGjF;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC;IAAI,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;CAAE;AAEzD;;GAEG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAEjF;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAQpE;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAEnD"}
|
package/auxiliary/Consumer.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Consumer.ts
|
|
3
|
-
* Candidate for inclusion in api-ts
|
|
4
|
-
* Defines a Consumer type that can consume values of type T.
|
|
5
|
-
*/
|
|
6
|
-
import { guardFunctions } from "@jonloucks/contracts-ts/api/Types";
|
|
7
|
-
import { presentCheck } from "@jonloucks/contracts-ts/auxiliary/Checks";
|
|
8
|
-
/**
|
|
9
|
-
* Duck type guard check for Consumer
|
|
10
|
-
*
|
|
11
|
-
* @param instance the instance to check
|
|
12
|
-
* @param <T> the type of value consumed
|
|
13
|
-
* @returns true if instance is a Consumer, false otherwise
|
|
14
|
-
*/
|
|
15
|
-
export function guard(instance) {
|
|
16
|
-
return guardFunctions(instance, 'consume');
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Convert a Type to a Consumer
|
|
20
|
-
*
|
|
21
|
-
* @param type the type to convert
|
|
22
|
-
* @param <T> the type of value consumed
|
|
23
|
-
* @returns a Consumer that consumes values of type T
|
|
24
|
-
*/
|
|
25
|
-
export function fromType(type) {
|
|
26
|
-
if (guard(type)) {
|
|
27
|
-
return type;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
return {
|
|
31
|
-
consume: type
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Check that a Consumer is present
|
|
37
|
-
*
|
|
38
|
-
* @param consumer the consumer to check
|
|
39
|
-
* @return the consumer if present
|
|
40
|
-
* @throws IllegalArgumentException if the consumer is not present
|
|
41
|
-
*/
|
|
42
|
-
export function check(consumer) {
|
|
43
|
-
return presentCheck(consumer, "Consumer must be present.");
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=Consumer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Consumer.js","sourceRoot":"","sources":["../../src/auxiliary/Consumer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAgB,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAiBxE;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAI,QAAiB;IACxC,OAAO,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAI,IAAa;IACvC,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,CAAC;QACN,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAI,QAAiB;IACxC,OAAO,YAAY,CAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAC;AAC7D,CAAC"}
|
package/auxiliary/Predicate.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Predicate.ts
|
|
3
|
-
*
|
|
4
|
-
* Candidate for inclusion in api-ts
|
|
5
|
-
* Defines a Predicate type that can test values of type T.
|
|
6
|
-
*/
|
|
7
|
-
import { OptionalType, RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
8
|
-
/**
|
|
9
|
-
* A method that tests a value of type T and returns a boolean
|
|
10
|
-
*/
|
|
11
|
-
export type Method<T> = (value: T) => boolean;
|
|
12
|
-
/**
|
|
13
|
-
* A Predicate that tests values of type T
|
|
14
|
-
*/
|
|
15
|
-
export interface Predicate<T> {
|
|
16
|
-
test(value: T): boolean;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* A type that can be a Method, Predicate, or a boolean
|
|
20
|
-
*/
|
|
21
|
-
export type Type<T> = Method<T> | Predicate<T> | boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Duck type guard check for Predicate
|
|
24
|
-
*
|
|
25
|
-
* @param instance the instance to check
|
|
26
|
-
* @param <T> the type of value tested
|
|
27
|
-
* @returns true if instance is a Predicate, false otherwise
|
|
28
|
-
*/
|
|
29
|
-
export declare function guard<T>(instance: unknown): instance is Predicate<T>;
|
|
30
|
-
/**
|
|
31
|
-
* Convert a Type to a Predicate
|
|
32
|
-
*
|
|
33
|
-
* @param type the type to convert
|
|
34
|
-
* @param <T> the type of value tested
|
|
35
|
-
* @returns a Predicate that tests values of type T
|
|
36
|
-
*/
|
|
37
|
-
export declare function fromType<T>(type: Type<T>): Predicate<T>;
|
|
38
|
-
/**
|
|
39
|
-
* Test a value against a Predicate Type
|
|
40
|
-
*
|
|
41
|
-
* @param type the Predicate Type
|
|
42
|
-
* @param value the value to test
|
|
43
|
-
* @param <T> the type of value tested
|
|
44
|
-
* @returns true if the value satisfies the Predicate, false otherwise
|
|
45
|
-
*/
|
|
46
|
-
export declare function toValue<T>(type: Type<T>, value: T): boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Check that a predicate is present
|
|
49
|
-
*
|
|
50
|
-
* @param predicate the predicate to check
|
|
51
|
-
* @return the predicate if present
|
|
52
|
-
* @throws IllegalArgumentException if the predicate is not present
|
|
53
|
-
*/
|
|
54
|
-
export declare function check<T>(predicate: OptionalType<Predicate<T>>): RequiredType<Predicate<T>>;
|
|
55
|
-
//# sourceMappingURL=Predicate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Predicate.d.ts","sourceRoot":"","sources":["../../src/auxiliary/Predicate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAkB,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAG/F;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC;IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;CAAE;AAE1D;;GAEG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,SAAS,CAAC,CAAC,CAAC,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAevD;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAQ3D;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAE1F"}
|
package/auxiliary/Predicate.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Predicate.ts
|
|
3
|
-
*
|
|
4
|
-
* Candidate for inclusion in api-ts
|
|
5
|
-
* Defines a Predicate type that can test values of type T.
|
|
6
|
-
*/
|
|
7
|
-
import { guardFunctions } from "@jonloucks/contracts-ts/api/Types";
|
|
8
|
-
import { presentCheck, used } from "@jonloucks/contracts-ts/auxiliary/Checks";
|
|
9
|
-
/**
|
|
10
|
-
* Duck type guard check for Predicate
|
|
11
|
-
*
|
|
12
|
-
* @param instance the instance to check
|
|
13
|
-
* @param <T> the type of value tested
|
|
14
|
-
* @returns true if instance is a Predicate, false otherwise
|
|
15
|
-
*/
|
|
16
|
-
export function guard(instance) {
|
|
17
|
-
return guardFunctions(instance, 'test');
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Convert a Type to a Predicate
|
|
21
|
-
*
|
|
22
|
-
* @param type the type to convert
|
|
23
|
-
* @param <T> the type of value tested
|
|
24
|
-
* @returns a Predicate that tests values of type T
|
|
25
|
-
*/
|
|
26
|
-
export function fromType(type) {
|
|
27
|
-
if (guard(type)) {
|
|
28
|
-
return type;
|
|
29
|
-
}
|
|
30
|
-
else if (typeof type === 'boolean') {
|
|
31
|
-
return {
|
|
32
|
-
test: (value) => {
|
|
33
|
-
used(value);
|
|
34
|
-
return type;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
return {
|
|
40
|
-
test: type
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Test a value against a Predicate Type
|
|
46
|
-
*
|
|
47
|
-
* @param type the Predicate Type
|
|
48
|
-
* @param value the value to test
|
|
49
|
-
* @param <T> the type of value tested
|
|
50
|
-
* @returns true if the value satisfies the Predicate, false otherwise
|
|
51
|
-
*/
|
|
52
|
-
export function toValue(type, value) {
|
|
53
|
-
if (guard(type)) {
|
|
54
|
-
return type.test(value);
|
|
55
|
-
}
|
|
56
|
-
else if (typeof type === 'boolean') {
|
|
57
|
-
return type;
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
return type(value);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Check that a predicate is present
|
|
65
|
-
*
|
|
66
|
-
* @param predicate the predicate to check
|
|
67
|
-
* @return the predicate if present
|
|
68
|
-
* @throws IllegalArgumentException if the predicate is not present
|
|
69
|
-
*/
|
|
70
|
-
export function check(predicate) {
|
|
71
|
-
return presentCheck(predicate, "Predicate must be Present.");
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=Predicate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Predicate.js","sourceRoot":"","sources":["../../src/auxiliary/Predicate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAA8B,MAAM,mCAAmC,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAiB9E;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAI,QAAiB;IACxC,OAAO,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAI,IAAa;IACvC,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO;YACL,IAAI,EAAE,CAAC,KAAQ,EAAY,EAAE;gBAC3B,IAAI,CAAC,KAAK,CAAC,CAAC;gBACZ,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO;YACL,IAAI,EAAE,IAAI;SACX,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAI,IAAa,EAAE,KAAQ;IAChD,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAI,SAAqC;IAC5D,OAAO,YAAY,CAAC,SAAS,EAAE,4BAA4B,CAAC,CAAC;AAC/D,CAAC"}
|
package/auxiliary/Supplier.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Supplier.ts
|
|
3
|
-
* Candidate for inclusion in api-ts
|
|
4
|
-
* Defines a Supplier type that can supply values of type T.
|
|
5
|
-
*/
|
|
6
|
-
import { RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
7
|
-
/**
|
|
8
|
-
* A method that supplies a value of type T
|
|
9
|
-
*/
|
|
10
|
-
export type Method<T> = () => T;
|
|
11
|
-
/**
|
|
12
|
-
* A Supplier that supplies values of type T
|
|
13
|
-
*/
|
|
14
|
-
export interface Supplier<T> {
|
|
15
|
-
supply(): T;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* A type that can be a Method, Supplier, or a value of type T
|
|
19
|
-
*/
|
|
20
|
-
export type Type<T> = Method<T> | Supplier<T> | T;
|
|
21
|
-
/**
|
|
22
|
-
* Duck type guard check for Supplier
|
|
23
|
-
*
|
|
24
|
-
* @param instance the instance to check
|
|
25
|
-
* @param <T> the type of value supplied
|
|
26
|
-
* @returns true if instance is a Supplier, false otherwise
|
|
27
|
-
*/
|
|
28
|
-
export declare function guard<T>(instance: unknown): instance is RequiredType<Supplier<T>>;
|
|
29
|
-
/**
|
|
30
|
-
* Convert a Type to a Supplier
|
|
31
|
-
* @param type the type to convert
|
|
32
|
-
* @param <T> the type of value supplied
|
|
33
|
-
* @returns a Supplier that supplies values of type T
|
|
34
|
-
*/
|
|
35
|
-
export declare function fromType<T>(type: Type<T>): RequiredType<Supplier<T>>;
|
|
36
|
-
/**
|
|
37
|
-
* Get the value from a Supplier Type
|
|
38
|
-
*
|
|
39
|
-
* @param type the Supplier Type
|
|
40
|
-
* @param <T> the type of value supplied
|
|
41
|
-
* @returns the value supplied by the Supplier Type
|
|
42
|
-
*/
|
|
43
|
-
export declare function toValue<T>(type: Type<T>): T;
|
|
44
|
-
/**
|
|
45
|
-
* Check that a Supplier is present
|
|
46
|
-
*
|
|
47
|
-
* @param supplier the supplier to check
|
|
48
|
-
* @return the supplier if present
|
|
49
|
-
* @throws IllegalArgumentException if the supplier is not present
|
|
50
|
-
*/
|
|
51
|
-
export declare function check<T>(supplier: Type<T>): Type<T>;
|
|
52
|
-
//# sourceMappingURL=Supplier.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Supplier.d.ts","sourceRoot":"","sources":["../../src/auxiliary/Supplier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAA8B,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAG7F;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAEhC;;GAEG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC;IAAI,MAAM,IAAI,CAAC,CAAC;CAAE;AAE7C;;GAEG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAElD;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAEjF;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAYpE;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAQ3C;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAEnD"}
|
package/auxiliary/Supplier.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Supplier.ts
|
|
3
|
-
* Candidate for inclusion in api-ts
|
|
4
|
-
* Defines a Supplier type that can supply values of type T.
|
|
5
|
-
*/
|
|
6
|
-
import { guardFunctions, isFunction } from "@jonloucks/contracts-ts/api/Types";
|
|
7
|
-
import { presentCheck } from "@jonloucks/contracts-ts/auxiliary/Checks";
|
|
8
|
-
/**
|
|
9
|
-
* Duck type guard check for Supplier
|
|
10
|
-
*
|
|
11
|
-
* @param instance the instance to check
|
|
12
|
-
* @param <T> the type of value supplied
|
|
13
|
-
* @returns true if instance is a Supplier, false otherwise
|
|
14
|
-
*/
|
|
15
|
-
export function guard(instance) {
|
|
16
|
-
return guardFunctions(instance, 'supply');
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Convert a Type to a Supplier
|
|
20
|
-
* @param type the type to convert
|
|
21
|
-
* @param <T> the type of value supplied
|
|
22
|
-
* @returns a Supplier that supplies values of type T
|
|
23
|
-
*/
|
|
24
|
-
export function fromType(type) {
|
|
25
|
-
if (guard(type)) {
|
|
26
|
-
return type;
|
|
27
|
-
}
|
|
28
|
-
else if (isFunction(type)) {
|
|
29
|
-
return {
|
|
30
|
-
supply: type
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
return {
|
|
35
|
-
supply: () => type
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Get the value from a Supplier Type
|
|
41
|
-
*
|
|
42
|
-
* @param type the Supplier Type
|
|
43
|
-
* @param <T> the type of value supplied
|
|
44
|
-
* @returns the value supplied by the Supplier Type
|
|
45
|
-
*/
|
|
46
|
-
export function toValue(type) {
|
|
47
|
-
if (guard(type)) {
|
|
48
|
-
return type.supply();
|
|
49
|
-
}
|
|
50
|
-
else if (isFunction(type)) {
|
|
51
|
-
return type();
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
return type;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Check that a Supplier is present
|
|
59
|
-
*
|
|
60
|
-
* @param supplier the supplier to check
|
|
61
|
-
* @return the supplier if present
|
|
62
|
-
* @throws IllegalArgumentException if the supplier is not present
|
|
63
|
-
*/
|
|
64
|
-
export function check(supplier) {
|
|
65
|
-
return presentCheck(supplier, "Supplier must be Present.");
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=Supplier.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Supplier.js","sourceRoot":"","sources":["../../src/auxiliary/Supplier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAgB,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAiBxE;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAI,QAAiB;IACxC,OAAO,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAI,IAAa;IACvC,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,OAAO;YACL,MAAM,EAAE,IAAI;SACb,CAAA;IACH,CAAC;SAAM,CAAC;QACN,OAAO;YACL,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI;SACnB,CAAA;IACH,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAI,IAAa;IACtC,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;SAAM,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAI,QAAiB;IACxC,OAAO,YAAY,CAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAC;AAC7D,CAAC"}
|