@daiso-tech/core 0.35.4 → 0.37.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 +22 -54
- package/dist/async/backof-policies/_shared.d.ts +8 -2
- package/dist/async/backof-policies/_shared.js +0 -1
- package/dist/async/backof-policies/_shared.js.map +1 -1
- package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.d.ts +3 -3
- package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js +10 -4
- package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +1 -1
- package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.d.ts +3 -3
- package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js +10 -4
- package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +1 -1
- package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.d.ts +3 -3
- package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js +10 -4
- package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +1 -1
- package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.d.ts +3 -3
- package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js +10 -4
- package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +1 -1
- package/dist/async/middlewares/_shared.d.ts +6 -1
- package/dist/async/middlewares/_shared.js +11 -1
- package/dist/async/middlewares/_shared.js.map +1 -1
- package/dist/async/middlewares/fallback/fallback.middleware.d.ts +3 -3
- package/dist/async/middlewares/fallback/fallback.middleware.js +3 -2
- package/dist/async/middlewares/fallback/fallback.middleware.js.map +1 -1
- package/dist/async/middlewares/hedging/_shared.d.ts +7 -7
- package/dist/async/middlewares/hedging/concurrent-hedging/concurrent-hedging.middleware.js +7 -7
- package/dist/async/middlewares/hedging/concurrent-hedging/concurrent-hedging.middleware.js.map +1 -1
- package/dist/async/middlewares/hedging/sequential-hedging/sequential-hedging.middleware.js +6 -6
- package/dist/async/middlewares/hedging/sequential-hedging/sequential-hedging.middleware.js.map +1 -1
- package/dist/async/middlewares/observe/observe.middleware.d.ts +4 -4
- package/dist/async/middlewares/retry/retry.middleware.d.ts +5 -4
- package/dist/async/middlewares/retry/retry.middleware.js +10 -10
- package/dist/async/middlewares/retry/retry.middleware.js.map +1 -1
- package/dist/async/middlewares/timeout/timeout.middleware.d.ts +4 -2
- package/dist/async/middlewares/timeout/timeout.middleware.js +3 -1
- package/dist/async/middlewares/timeout/timeout.middleware.js.map +1 -1
- package/dist/async/utilities/lazy-promise/lazy-promise.d.ts +1 -1
- package/dist/async/utilities/lazy-promise/lazy-promise.js +1 -1
- package/dist/async/utilities/promise-queue/promise-queue.js.map +1 -1
- package/dist/cache/contracts/cache-factory.contract.d.ts +2 -2
- package/dist/cache/contracts/cache.errors.d.ts +3 -3
- package/dist/cache/contracts/cache.errors.js +1 -1
- package/dist/cache/contracts/cache.errors.js.map +1 -1
- package/dist/cache/implementations/adapters/_module-exports.d.ts +1 -2
- package/dist/cache/implementations/adapters/_module-exports.js +1 -2
- package/dist/cache/implementations/adapters/_module-exports.js.map +1 -1
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.d.ts +41 -16
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js +102 -57
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +4 -1
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/cache.d.ts +27 -11
- package/dist/cache/implementations/derivables/cache/cache.js +38 -34
- package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.d.ts +15 -47
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js +19 -45
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js.map +1 -1
- package/dist/cache/implementations/test-utilities/cache.test-suite.d.ts +4 -5
- package/dist/cache/implementations/test-utilities/cache.test-suite.js +4 -5
- package/dist/cache/implementations/test-utilities/cache.test-suite.js.map +1 -1
- package/dist/collection/contracts/async-collection.contract.d.ts +127 -121
- package/dist/collection/contracts/collection.contract.d.ts +126 -120
- package/dist/collection/contracts/collection.errors.d.ts +3 -3
- package/dist/collection/contracts/collection.errors.js +1 -1
- package/dist/collection/contracts/collection.errors.js.map +1 -1
- package/dist/collection/implementations/_shared.d.ts +4 -4
- package/dist/collection/implementations/_shared.js +2 -2
- package/dist/collection/implementations/_shared.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/_module.d.ts +1 -0
- package/dist/collection/implementations/async-iterable-collection/_shared/_module.js +1 -0
- package/dist/collection/implementations/async-iterable-collection/_shared/_module.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-validate-iterable.d.ts +7 -0
- package/dist/collection/implementations/async-iterable-collection/_shared/async-validate-iterable.js +17 -0
- package/dist/collection/implementations/async-iterable-collection/_shared/async-validate-iterable.js.map +1 -0
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +15 -13
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +19 -16
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/_module.d.ts +1 -0
- package/dist/collection/implementations/iterable-collection/_shared/_module.js +1 -0
- package/dist/collection/implementations/iterable-collection/_shared/_module.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/validate-iterable.d.ts +7 -0
- package/dist/collection/implementations/iterable-collection/_shared/validate-iterable.js +21 -0
- package/dist/collection/implementations/iterable-collection/_shared/validate-iterable.js.map +1 -0
- package/dist/collection/implementations/iterable-collection/iterable-collection.d.ts +14 -12
- package/dist/collection/implementations/iterable-collection/iterable-collection.js +16 -13
- package/dist/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/collection/implementations/list-collection/list-collection.d.ts +14 -12
- package/dist/collection/implementations/list-collection/list-collection.js +26 -13
- package/dist/collection/implementations/list-collection/list-collection.js.map +1 -1
- package/dist/event-bus/contracts/event-bus-factory.contract.d.ts +2 -2
- package/dist/event-bus/contracts/event-bus.contract.d.ts +2 -2
- package/dist/event-bus/contracts/event-bus.errors.d.ts +3 -3
- package/dist/event-bus/contracts/event-bus.errors.js +1 -1
- package/dist/event-bus/contracts/event-bus.errors.js.map +1 -1
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +1 -1
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +1 -1
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +46 -9
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +64 -22
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.d.ts +12 -41
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js +15 -35
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js.map +1 -1
- package/dist/lock/contracts/lock.errors.d.ts +2 -2
- package/dist/lock/contracts/lock.errors.js.map +1 -1
- package/dist/lock/implementations/adapters/_module-exports.d.ts +1 -2
- package/dist/lock/implementations/adapters/_module-exports.js +1 -2
- package/dist/lock/implementations/adapters/_module-exports.js.map +1 -1
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.d.ts +40 -15
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js +75 -34
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +6 -3
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +1 -1
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +22 -18
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +20 -22
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.d.ts +3 -3
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js +12 -6
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +4 -2
- package/dist/lock/implementations/derivables/lock-provider/lock.js +16 -18
- package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +6 -50
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js +10 -54
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map +1 -1
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.d.ts +1 -9
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +1 -9
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
- package/dist/serde/contracts/flexible-serde.contract.d.ts +9 -2
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js +1 -1
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js.map +1 -1
- package/dist/utilities/classes/_module.d.ts +1 -1
- package/dist/utilities/classes/_module.js +1 -1
- package/dist/utilities/classes/_module.js.map +1 -1
- package/dist/utilities/classes/hooks/hooks.d.ts +2 -2
- package/dist/utilities/classes/hooks/hooks.js +2 -2
- package/dist/utilities/classes/namespace/_module.d.ts +1 -0
- package/dist/utilities/classes/namespace/_module.js +2 -0
- package/dist/utilities/classes/namespace/_module.js.map +1 -0
- package/dist/utilities/classes/{key-prefixer/key-prefixer.d.ts → namespace/namespace.d.ts} +38 -17
- package/dist/utilities/classes/{key-prefixer/key-prefixer.js → namespace/namespace.js} +51 -19
- package/dist/utilities/classes/namespace/namespace.js.map +1 -0
- package/dist/utilities/classes/time-span/time-span.d.ts +1 -2
- package/dist/utilities/classes/time-span/time-span.js +1 -4
- package/dist/utilities/classes/time-span/time-span.js.map +1 -1
- package/dist/utilities/functions/_module-exports.d.ts +2 -1
- package/dist/utilities/functions/_module-exports.js +2 -1
- package/dist/utilities/functions/_module-exports.js.map +1 -1
- package/dist/utilities/functions/lazy.d.ts +4 -0
- package/dist/utilities/functions/lazy.js +9 -3
- package/dist/utilities/functions/lazy.js.map +1 -1
- package/dist/utilities/functions/result.d.ts +11 -0
- package/dist/utilities/functions/result.js +15 -0
- package/dist/utilities/functions/result.js.map +1 -0
- package/dist/utilities/functions/validate.d.ts +8 -0
- package/dist/utilities/functions/validate.js +17 -0
- package/dist/utilities/functions/validate.js.map +1 -0
- package/dist/utilities/types/factory.type.d.ts +13 -18
- package/dist/utilities/types/result.type.d.ts +11 -1
- package/package.json +15 -11
- package/dist/cache/implementations/adapters/libsql-cache-adapter/_module.d.ts +0 -1
- package/dist/cache/implementations/adapters/libsql-cache-adapter/_module.js +0 -2
- package/dist/cache/implementations/adapters/libsql-cache-adapter/_module.js.map +0 -1
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.d.ts +0 -61
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +0 -95
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js.map +0 -1
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/_module.d.ts +0 -1
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/_module.js +0 -2
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/_module.js.map +0 -1
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.d.ts +0 -59
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +0 -94
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js.map +0 -1
- package/dist/lock/implementations/adapters/libsql-lock-adapter/_module.d.ts +0 -1
- package/dist/lock/implementations/adapters/libsql-lock-adapter/_module.js +0 -2
- package/dist/lock/implementations/adapters/libsql-lock-adapter/_module.js.map +0 -1
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.d.ts +0 -60
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js +0 -84
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js.map +0 -1
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/_module.d.ts +0 -1
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/_module.js +0 -2
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/_module.js.map +0 -1
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.d.ts +0 -59
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js +0 -83
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js.map +0 -1
- package/dist/utilities/classes/key-prefixer/_module.d.ts +0 -1
- package/dist/utilities/classes/key-prefixer/_module.js +0 -2
- package/dist/utilities/classes/key-prefixer/_module.js.map +0 -1
- package/dist/utilities/classes/key-prefixer/key-prefixer.js.map +0 -1
- package/dist/utilities/functions/factory.d.ts +0 -44
- package/dist/utilities/functions/factory.js +0 -80
- package/dist/utilities/functions/factory.js.map +0 -1
|
@@ -26,12 +26,12 @@ export type ISerdeTransformer<TDeserializedValue, TSerializedValue> = {
|
|
|
26
26
|
serialize(deserializedValue: TDeserializedValue): TSerializedValue;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
* The `
|
|
29
|
+
* The `ISerderRegister` contract defines a standard way to register custom serialization and deserialization logic.
|
|
30
30
|
*
|
|
31
31
|
* IMPORT_PATH: `"@daiso-tech/core/serde/contracts"`
|
|
32
32
|
* @group Contracts
|
|
33
33
|
*/
|
|
34
|
-
export interface
|
|
34
|
+
export interface ISerderRegister {
|
|
35
35
|
/**
|
|
36
36
|
* The `registerClass` method is used for registering custom class for serialization and deserialization.
|
|
37
37
|
* The `class_` parameter must be of type {@link SerializableClass | `SerializableClass`}.
|
|
@@ -42,3 +42,10 @@ export interface IFlexibleSerde<TSerializedValue = unknown> extends ISerde<TSeri
|
|
|
42
42
|
*/
|
|
43
43
|
registerCustom<TCustomDeserialized, TCustomSerialized>(transformer: ISerdeTransformer<TCustomDeserialized, TCustomSerialized>, prefix?: OneOrMore<string>): this;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* The `IFlexibleSerde` contract defines a standard way to serialize and deserialize both plain data and custom classes.
|
|
47
|
+
*
|
|
48
|
+
* IMPORT_PATH: `"@daiso-tech/core/serde/contracts"`
|
|
49
|
+
* @group Contracts
|
|
50
|
+
*/
|
|
51
|
+
export type IFlexibleSerde<TSerializedValue = unknown> = ISerde<TSerializedValue> & ISerderRegister;
|
package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Serde
|
|
3
3
|
*/
|
|
4
4
|
import { DeserializationSerdeError, SerializationSerdeError, } from "../../../../serde/contracts/_module-exports.js";
|
|
5
|
-
import { SuperJSON } from "superjson
|
|
5
|
+
import { SuperJSON } from "superjson";
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* IMPORT_PATH: `"@daiso-tech/core/serde/adapters"`
|
package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"super-json-serde-adapter.js","sourceRoot":"","sources":["../../../../../src/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGH,yBAAyB,EACzB,uBAAuB,GAC1B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"super-json-serde-adapter.js","sourceRoot":"","sources":["../../../../../src/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGH,yBAAyB,EACzB,uBAAuB,GAC1B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;GAIG;AACH,MAAM,OAAO,qBAAqB;IACb,SAAS,GAAc,IAAI,SAAS,EAAE,CAAC;IAExD,cAAc,CACV,WAGC;QAED,IAAI,CAAC,SAAS,CAAC,cAAc,CACzB;YACI,YAAY,CAAC,KAAK;gBACd,OAAO,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YAC3C,CAAC;YACD,SAAS,CAAC,iBAAiB;gBACvB,OAAO,WAAW,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;YACpD,CAAC;YACD,WAAW,CAAC,eAAe;gBACvB,iEAAiE;gBACjE,OAAO,WAAW,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;YACpD,CAAC;SACJ,EACD,WAAW,CAAC,IAAI,CACnB,CAAC;IACN,CAAC;IAED,SAAS,CAAS,KAAa;QAC3B,IAAI,CAAC;YACD,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,MAAM,IAAI,uBAAuB,CAC7B,wBAAwB,MAAM,CAAC,KAAK,CAAC,WAAW,EAChD,KAAK,CACR,CAAC;QACN,CAAC;IACL,CAAC;IAED,WAAW,CAAS,KAAa;QAC7B,IAAI,CAAC;YACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,MAAM,IAAI,yBAAyB,CAC/B,0BAA0B,MAAM,CAAC,KAAK,CAAC,WAAW,EAClD,KAAK,CACR,CAAC;QACN,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "../../utilities/classes/
|
|
1
|
+
export * from "../../utilities/classes/namespace/_module.js";
|
|
2
2
|
export * from "../../utilities/classes/kysely-table-name-transformer-plugin/_module.js";
|
|
3
3
|
export * from "../../utilities/classes/hooks/_module.js";
|
|
4
4
|
export * from "../../utilities/classes/time-span/_module.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "../../utilities/classes/
|
|
1
|
+
export * from "../../utilities/classes/namespace/_module.js";
|
|
2
2
|
export * from "../../utilities/classes/kysely-table-name-transformer-plugin/_module.js";
|
|
3
3
|
export * from "../../utilities/classes/hooks/_module.js";
|
|
4
4
|
export * from "../../utilities/classes/time-span/_module.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/utilities/classes/_module.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/utilities/classes/_module.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC;AACzD,cAAc,qEAAqE,CAAC;AACpF,cAAc,sCAAsC,CAAC;AACrD,cAAc,0CAA0C,CAAC"}
|
|
@@ -61,8 +61,8 @@ export type HooksSettings<TContext extends HookContext = HookContext> = {
|
|
|
61
61
|
context?: TContext;
|
|
62
62
|
};
|
|
63
63
|
/**
|
|
64
|
-
* The `Hooks` class provides a convenient way to change and inspect arguments and return value of
|
|
65
|
-
* For example `Hooks` class can be used to log function arguments and return values. Note this class
|
|
64
|
+
* The `Hooks` class provides a convenient way to change and inspect arguments and return value of only sync functions.
|
|
65
|
+
* For example `Hooks` class can be used to log function arguments and return values. Note this class is immutable.
|
|
66
66
|
*
|
|
67
67
|
* Middlewares apply left to right: each wraps the next, with the leftmost being the outermost layer and the rightmost wrapping the original function.
|
|
68
68
|
*
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { getInvokableName, resolveInvokable, resolveOneOrMore, } from "../../../utilities/_module-exports.js";
|
|
5
5
|
/**
|
|
6
|
-
* The `Hooks` class provides a convenient way to change and inspect arguments and return value of
|
|
7
|
-
* For example `Hooks` class can be used to log function arguments and return values. Note this class
|
|
6
|
+
* The `Hooks` class provides a convenient way to change and inspect arguments and return value of only sync functions.
|
|
7
|
+
* For example `Hooks` class can be used to log function arguments and return values. Note this class is immutable.
|
|
8
8
|
*
|
|
9
9
|
* Middlewares apply left to right: each wraps the next, with the leftmost being the outermost layer and the rightmost wrapping the original function.
|
|
10
10
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../utilities/classes/namespace/namespace.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../src/utilities/classes/namespace/_module.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC"}
|
|
@@ -12,9 +12,7 @@ type KeySettings = {
|
|
|
12
12
|
keyDelimeter: string;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
17
|
-
* @group KeyPrefixer
|
|
15
|
+
* @internal
|
|
18
16
|
*/
|
|
19
17
|
export declare class Key {
|
|
20
18
|
private readonly prefixArr;
|
|
@@ -28,37 +26,60 @@ export declare class Key {
|
|
|
28
26
|
constructor(settings: KeySettings);
|
|
29
27
|
get original(): OneOrMore<string>;
|
|
30
28
|
get resolved(): string;
|
|
31
|
-
get
|
|
29
|
+
get namespaced(): string;
|
|
32
30
|
}
|
|
33
31
|
/**
|
|
34
32
|
*
|
|
35
33
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
36
|
-
* @group
|
|
34
|
+
* @group Namespace
|
|
37
35
|
*/
|
|
38
|
-
export type
|
|
36
|
+
export type NamespaceSettings = {
|
|
37
|
+
/**
|
|
38
|
+
* @default {":"}
|
|
39
|
+
*/
|
|
39
40
|
identifierDelimeter?: string;
|
|
41
|
+
/**
|
|
42
|
+
* @default {"/"}
|
|
43
|
+
*/
|
|
40
44
|
keyDelimeter?: string;
|
|
41
|
-
|
|
45
|
+
/**
|
|
46
|
+
* @default {"_rt"}
|
|
47
|
+
*/
|
|
42
48
|
rootIdentifier?: string;
|
|
43
|
-
groupIdentifier?: string;
|
|
44
49
|
};
|
|
45
50
|
/**
|
|
46
|
-
*
|
|
47
|
-
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
48
|
-
* @group KeyPrefixer
|
|
51
|
+
* @internal
|
|
49
52
|
*/
|
|
50
|
-
|
|
53
|
+
declare class InternalNamespace {
|
|
51
54
|
private readonly _rootPrefix;
|
|
52
55
|
private readonly identifierDelimeter;
|
|
53
56
|
private readonly keyDelimeter;
|
|
54
57
|
private readonly rootIdentifier;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
get
|
|
58
|
-
get resolvedRootPrefix(): string;
|
|
58
|
+
constructor(_rootPrefix: OneOrMore<string>, settings?: NamespaceSettings);
|
|
59
|
+
get original(): OneOrMore<string>;
|
|
60
|
+
get resolved(): string;
|
|
59
61
|
private validate;
|
|
60
62
|
private getKeyPrefixArray;
|
|
61
|
-
get
|
|
63
|
+
get namespaced(): string;
|
|
62
64
|
create(key: OneOrMore<string>): Key;
|
|
63
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* The `Namespace` class adds prefixes/suffixes to keys to avoid conflicts and group related items.
|
|
68
|
+
*
|
|
69
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
70
|
+
* @group Namespace
|
|
71
|
+
*/
|
|
72
|
+
export declare class Namespace {
|
|
73
|
+
private readonly root;
|
|
74
|
+
private readonly settings;
|
|
75
|
+
constructor(root: OneOrMore<string>, settings?: NamespaceSettings);
|
|
76
|
+
setIdentifierDelimeter(delimeter: string): Namespace;
|
|
77
|
+
setKeyDelimeter(delimeter: string): Namespace;
|
|
78
|
+
setRootIdentifier(identifier: string): Namespace;
|
|
79
|
+
appendRoot(str: OneOrMore<string>): Namespace;
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
_getInternal(): InternalNamespace;
|
|
84
|
+
}
|
|
64
85
|
export {};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
|
-
import { resolveOneOrMoreStr } from "../../../utilities/_module-exports.js";
|
|
4
|
+
import { resolveOneOrMoreStr, resolveOneOrMore, } from "../../../utilities/_module-exports.js";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
8
|
-
* @group KeyPrefixer
|
|
6
|
+
* @internal
|
|
9
7
|
*/
|
|
10
8
|
export class Key {
|
|
11
9
|
prefixArr;
|
|
@@ -29,7 +27,7 @@ export class Key {
|
|
|
29
27
|
get resolved() {
|
|
30
28
|
return resolveOneOrMoreStr(this.key);
|
|
31
29
|
}
|
|
32
|
-
get
|
|
30
|
+
get namespaced() {
|
|
33
31
|
return resolveOneOrMoreStr([
|
|
34
32
|
...this.prefixArr,
|
|
35
33
|
resolveOneOrMoreStr(this.key, this.keyDelimeter),
|
|
@@ -37,29 +35,25 @@ export class Key {
|
|
|
37
35
|
}
|
|
38
36
|
}
|
|
39
37
|
/**
|
|
40
|
-
*
|
|
41
|
-
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
42
|
-
* @group KeyPrefixer
|
|
38
|
+
* @internal
|
|
43
39
|
*/
|
|
44
|
-
|
|
40
|
+
class InternalNamespace {
|
|
45
41
|
_rootPrefix;
|
|
46
42
|
identifierDelimeter;
|
|
47
43
|
keyDelimeter;
|
|
48
44
|
rootIdentifier;
|
|
49
|
-
keyIdentifier;
|
|
50
45
|
constructor(_rootPrefix, settings = {}) {
|
|
51
46
|
this._rootPrefix = _rootPrefix;
|
|
52
|
-
const { identifierDelimeter = ":", keyDelimeter = "/",
|
|
47
|
+
const { identifierDelimeter = ":", keyDelimeter = "/", rootIdentifier = "_rt", } = settings;
|
|
53
48
|
this.rootIdentifier = rootIdentifier;
|
|
54
|
-
this.keyIdentifier = keyIdentifier;
|
|
55
49
|
this.identifierDelimeter = identifierDelimeter;
|
|
56
50
|
this.keyDelimeter = keyDelimeter;
|
|
57
51
|
this.validate(this._rootPrefix);
|
|
58
52
|
}
|
|
59
|
-
get
|
|
53
|
+
get original() {
|
|
60
54
|
return this._rootPrefix;
|
|
61
55
|
}
|
|
62
|
-
get
|
|
56
|
+
get resolved() {
|
|
63
57
|
return resolveOneOrMoreStr(this._rootPrefix);
|
|
64
58
|
}
|
|
65
59
|
validate(key) {
|
|
@@ -67,9 +61,6 @@ export class KeyPrefixer {
|
|
|
67
61
|
if (resolvedKey.includes(this.rootIdentifier)) {
|
|
68
62
|
throw new Error(`Resolved key "${resolvedKey}" cannot not include "${this.rootIdentifier}"`);
|
|
69
63
|
}
|
|
70
|
-
if (resolvedKey.includes(this.keyIdentifier)) {
|
|
71
|
-
throw new Error(`Resolved key "${resolvedKey}" cannot not include "${this.keyIdentifier}"`);
|
|
72
|
-
}
|
|
73
64
|
}
|
|
74
65
|
getKeyPrefixArray() {
|
|
75
66
|
return [
|
|
@@ -77,7 +68,7 @@ export class KeyPrefixer {
|
|
|
77
68
|
this.rootIdentifier,
|
|
78
69
|
];
|
|
79
70
|
}
|
|
80
|
-
get
|
|
71
|
+
get namespaced() {
|
|
81
72
|
return resolveOneOrMoreStr(this.getKeyPrefixArray(), this.identifierDelimeter);
|
|
82
73
|
}
|
|
83
74
|
create(key) {
|
|
@@ -90,4 +81,45 @@ export class KeyPrefixer {
|
|
|
90
81
|
});
|
|
91
82
|
}
|
|
92
83
|
}
|
|
93
|
-
|
|
84
|
+
/**
|
|
85
|
+
* The `Namespace` class adds prefixes/suffixes to keys to avoid conflicts and group related items.
|
|
86
|
+
*
|
|
87
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
88
|
+
* @group Namespace
|
|
89
|
+
*/
|
|
90
|
+
export class Namespace {
|
|
91
|
+
root;
|
|
92
|
+
settings;
|
|
93
|
+
constructor(root, settings = {}) {
|
|
94
|
+
this.root = root;
|
|
95
|
+
this.settings = settings;
|
|
96
|
+
}
|
|
97
|
+
setIdentifierDelimeter(delimeter) {
|
|
98
|
+
return new Namespace(this.root, {
|
|
99
|
+
...this.settings,
|
|
100
|
+
identifierDelimeter: delimeter,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
setKeyDelimeter(delimeter) {
|
|
104
|
+
return new Namespace(this.root, {
|
|
105
|
+
...this.settings,
|
|
106
|
+
keyDelimeter: delimeter,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
setRootIdentifier(identifier) {
|
|
110
|
+
return new Namespace(this.root, {
|
|
111
|
+
...this.settings,
|
|
112
|
+
rootIdentifier: identifier,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
appendRoot(str) {
|
|
116
|
+
return new Namespace([...resolveOneOrMore(this.root), ...resolveOneOrMore(str)], this.settings);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* @internal
|
|
120
|
+
*/
|
|
121
|
+
_getInternal() {
|
|
122
|
+
return new InternalNamespace(this.root, this.settings);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=namespace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.js","sourceRoot":"","sources":["../../../../src/utilities/classes/namespace/namespace.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,mBAAmB,EACnB,gBAAgB,GACnB,MAAM,iCAAiC,CAAC;AAazC;;GAEG;AACH,MAAM,OAAO,GAAG;IACK,SAAS,CAAqB;IAC9B,GAAG,CAAoB;IACvB,mBAAmB,CAAS;IAC5B,YAAY,CAAS;IAEtC;;;OAGG;IACH,YAAY,QAAqB;QAC7B,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,mBAAmB,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC;QACvE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,UAAU;QACV,OAAO,mBAAmB,CACtB;YACI,GAAG,IAAI,CAAC,SAAS;YACjB,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC;SACnD,EACD,IAAI,CAAC,mBAAmB,CAC3B,CAAC;IACN,CAAC;CACJ;AAwBD;;GAEG;AACH,MAAM,iBAAiB;IAME;IALJ,mBAAmB,CAAS;IAC5B,YAAY,CAAS;IACrB,cAAc,CAAS;IAExC,YACqB,WAA8B,EAC/C,WAA8B,EAAE;QADf,gBAAW,GAAX,WAAW,CAAmB;QAG/C,MAAM,EACF,m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;IACP,CAAC;CACJ;AAED;;;;;GAKG;AACH,MAAM,OAAO,SAAS;IAEG;IACA;IAFrB,YACqB,IAAuB,EACvB,WAA8B,EAAE;QADhC,SAAI,GAAJ,IAAI,CAAmB;QACvB,aAAQ,GAAR,QAAQ,CAAwB;IAClD,CAAC;IAEJ,sBAAsB,CAAC,SAAiB;QACpC,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE;YAC5B,GAAG,IAAI,CAAC,QAAQ;YAChB,mBAAmB,EAAE,SAAS;SACjC,CAAC,CAAC;IACP,CAAC;IAED,eAAe,CAAC,SAAiB;QAC7B,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE;YAC5B,GAAG,IAAI,CAAC,QAAQ;YAChB,YAAY,EAAE,SAAS;SAC1B,CAAC,CAAC;IACP,CAAC;IAED,iBAAiB,CAAC,UAAkB;QAChC,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE;YAC5B,GAAG,IAAI,CAAC,QAAQ;YAChB,cAAc,EAAE,UAAU;SAC7B,CAAC,CAAC;IACP,CAAC;IAED,UAAU,CAAC,GAAsB;QAC7B,OAAO,IAAI,SAAS,CAChB,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAC1D,IAAI,CAAC,QAAQ,CAChB,CAAC;IACN,CAAC;IAED;;OAEG;IACH,YAAY;QACR,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;CACJ"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { ISerializable } from "../../../serde/contracts/_module-exports.js";
|
|
5
5
|
/**
|
|
6
|
-
* The `TimeSpan` class is used for representing time interval
|
|
6
|
+
* The `TimeSpan` class is used for representing time interval.
|
|
7
7
|
* `TimeSpan` cannot be negative.
|
|
8
8
|
*
|
|
9
9
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
@@ -44,7 +44,6 @@ export declare class TimeSpan implements ISerializable<number> {
|
|
|
44
44
|
toMinutes(): number;
|
|
45
45
|
toHours(): number;
|
|
46
46
|
toDays(): number;
|
|
47
|
-
toUTCTimestamp(): number;
|
|
48
47
|
/**
|
|
49
48
|
* Will return endDate relative to a given `startDate` argument.
|
|
50
49
|
* @default {new Date()} - current date
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* The `TimeSpan` class is used for representing time interval
|
|
5
|
+
* The `TimeSpan` class is used for representing time interval.
|
|
6
6
|
* `TimeSpan` cannot be negative.
|
|
7
7
|
*
|
|
8
8
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
@@ -102,9 +102,6 @@ export class TimeSpan {
|
|
|
102
102
|
toDays() {
|
|
103
103
|
return Math.floor(this.milliseconds / TimeSpan.dayInMilliseconds);
|
|
104
104
|
}
|
|
105
|
-
toUTCTimestamp() {
|
|
106
|
-
return Math.round(this.toMilliseconds() / 1000);
|
|
107
|
-
}
|
|
108
105
|
/**
|
|
109
106
|
* Will return endDate relative to a given `startDate` argument.
|
|
110
107
|
* @default {new Date()} - current date
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-span.js","sourceRoot":"","sources":["../../../../src/utilities/classes/time-span/time-span.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;GAMG;AACH,MAAM,OAAO,QAAQ;IAUoB;IAT7B,MAAM,CAAC,oBAAoB,GAAG,IAAI,CAAC;IACnC,MAAM,CAAC,oBAAoB,GAAG,EAAE,GAAG,QAAQ,CAAC,oBAAoB,CAAC;IACjE,MAAM,CAAC,kBAAkB,GAAG,EAAE,GAAG,QAAQ,CAAC,oBAAoB,CAAC;IAC/D,MAAM,CAAC,iBAAiB,GAAG,EAAE,GAAG,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IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;OAGG;IACH,WAAW,CAAC,OAAO,GAAG,IAAI,IAAI,EAAE;QAC5B,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IAC/D,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export * from "../../utilities/functions/factory.js";
|
|
2
1
|
export * from "../../utilities/functions/get-constructor-name.js";
|
|
3
2
|
export * from "../../utilities/functions/invokable.js";
|
|
4
3
|
export * from "../../utilities/functions/is-nullable.js";
|
|
5
4
|
export * from "../../utilities/functions/object.js";
|
|
6
5
|
export * from "../../utilities/functions/lazy.js";
|
|
7
6
|
export * from "../../utilities/functions/resolve-one-or-more.js";
|
|
7
|
+
export * from "../../utilities/functions/result.js";
|
|
8
|
+
export * from "../../utilities/functions/validate.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from "../../utilities/functions/factory.js";
|
|
2
1
|
export * from "../../utilities/functions/get-constructor-name.js";
|
|
3
2
|
export * from "../../utilities/functions/invokable.js";
|
|
4
3
|
export * from "../../utilities/functions/is-nullable.js";
|
|
5
4
|
export * from "../../utilities/functions/object.js";
|
|
6
5
|
export * from "../../utilities/functions/lazy.js";
|
|
7
6
|
export * from "../../utilities/functions/resolve-one-or-more.js";
|
|
7
|
+
export * from "../../utilities/functions/result.js";
|
|
8
|
+
export * from "../../utilities/functions/validate.js";
|
|
8
9
|
//# sourceMappingURL=_module-exports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../src/utilities/functions/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc
|
|
1
|
+
{"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../src/utilities/functions/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,+CAA+C,CAAC;AAC9D,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC"}
|
|
@@ -7,6 +7,10 @@ import type { AsyncLazyable, Lazyable, Lazy, AsyncLazy } from "../../utilities/t
|
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export declare function isLazy<TValue>(lazyable: Lazyable<TValue>): lazyable is Lazy<TValue>;
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function isPromiseLike<TValue>(value: unknown): value is PromiseLike<TValue>;
|
|
10
14
|
/**
|
|
11
15
|
* @internal
|
|
12
16
|
*/
|
|
@@ -11,10 +11,16 @@ export function isLazy(lazyable) {
|
|
|
11
11
|
/**
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
|
-
export function
|
|
15
|
-
return (typeof
|
|
14
|
+
export function isPromiseLike(value) {
|
|
15
|
+
return (typeof value === "object" &&
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
17
|
-
typeof
|
|
17
|
+
typeof value?.then === "function");
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export function isLazyPromise(lazyable) {
|
|
23
|
+
return (isPromiseLike(lazyable) &&
|
|
18
24
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
19
25
|
typeof lazyable?.defer === "function");
|
|
20
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.js","sourceRoot":"","sources":["../../../src/utilities/functions/lazy.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,EACH,WAAW,EACX,gBAAgB,GACnB,MAAM,oCAAoC,C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AAC,QAAQ,CAAC,EAAE,CAAC;YAC1B,OAAO,MAAM,QAAQ,CAAC;QAC1B,CAAC;QACD,OAAO,MAAM,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC9C,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ResultFailure, ResultSuccess } from "../../utilities/types/_module.js";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
5
|
+
*/
|
|
6
|
+
export declare function resultFailure<TError = unknown>(error: TError): ResultFailure<TError>;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
10
|
+
*/
|
|
11
|
+
export declare function resultSuccess<TValue>(value: TValue): ResultSuccess<TValue>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
4
|
+
*/
|
|
5
|
+
export function resultFailure(error) {
|
|
6
|
+
return [null, error];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
11
|
+
*/
|
|
12
|
+
export function resultSuccess(value) {
|
|
13
|
+
return [value, null];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/utilities/functions/result.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,UAAU,aAAa,CACzB,KAAa;IAEb,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACzB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAS,KAAa;IAC/C,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
2
|
+
export declare class ValidationError extends Error {
|
|
3
|
+
constructor(issues: ReadonlyArray<StandardSchemaV1.Issue>);
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* @throws {ValidationError} {@link ValidationError}
|
|
7
|
+
*/
|
|
8
|
+
export declare function validate<TValue>(schema: StandardSchemaV1<TValue, TValue> | undefined, value: TValue): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class ValidationError extends Error {
|
|
2
|
+
constructor(issues) {
|
|
3
|
+
const jsonMessage = JSON.stringify(issues, null, 2);
|
|
4
|
+
super(`A validation error occured with the following issues:\n${jsonMessage}`);
|
|
5
|
+
this.name = ValidationError.name;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* @throws {ValidationError} {@link ValidationError}
|
|
10
|
+
*/
|
|
11
|
+
export async function validate(schema, value) {
|
|
12
|
+
const result = await schema?.["~standard"].validate(value);
|
|
13
|
+
if (result?.issues) {
|
|
14
|
+
throw new ValidationError(result.issues);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/utilities/functions/validate.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACtC,YAAY,MAA6C;QACrD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACpD,KAAK,CACD,0DAA0D,WAAW,EAAE,CAC1E,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;IACrC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC1B,MAAoD,EACpD,KAAa;IAEb,MAAM,MAAM,GAAG,MAAM,MAAM,EAAE,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3D,IAAI,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,MAAM,IAAI,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;AACL,CAAC"}
|
|
@@ -3,18 +3,21 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { NoneFunc } from "../../utilities/types/none-func.type.js";
|
|
5
5
|
import type { Promisable } from "../../utilities/types/promiseable.type.js";
|
|
6
|
+
import type { IInvokableObject, InvokableFn } from "../../utilities/types/invokable.type.js";
|
|
6
7
|
/**
|
|
7
8
|
*
|
|
8
9
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
9
10
|
*/
|
|
10
|
-
export type FactoryFn<TInput, TOutput> =
|
|
11
|
+
export type FactoryFn<TInput, TOutput> = InvokableFn<[
|
|
12
|
+
value: TInput
|
|
13
|
+
], NoneFunc<TOutput>>;
|
|
11
14
|
/**
|
|
12
15
|
*
|
|
13
16
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
14
17
|
*/
|
|
15
|
-
export type IFactoryObject<TInput, TOutput> =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
export type IFactoryObject<TInput, TOutput> = IInvokableObject<[
|
|
19
|
+
value: TInput
|
|
20
|
+
], NoneFunc<TOutput>>;
|
|
18
21
|
/**
|
|
19
22
|
*
|
|
20
23
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
@@ -24,26 +27,18 @@ export type Factory<TInput, TOutput> = FactoryFn<TInput, TOutput> | IFactoryObje
|
|
|
24
27
|
*
|
|
25
28
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
26
29
|
*/
|
|
27
|
-
export type
|
|
30
|
+
export type AsyncFactoryFn<TInput, TOutput> = InvokableFn<[
|
|
31
|
+
value: TInput
|
|
32
|
+
], Promisable<NoneFunc<TOutput>>>;
|
|
28
33
|
/**
|
|
29
34
|
*
|
|
30
35
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
31
36
|
*/
|
|
32
|
-
export type
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
36
|
-
*/
|
|
37
|
-
export type IAsyncFactoryObject<TInput, TOutput> = {
|
|
38
|
-
use(value: TInput): Promisable<NoneFunc<TOutput>>;
|
|
39
|
-
};
|
|
37
|
+
export type IAsyncFactoryObject<TInput, TOutput> = IInvokableObject<[
|
|
38
|
+
value: TInput
|
|
39
|
+
], Promisable<NoneFunc<TOutput>>>;
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
42
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
43
43
|
*/
|
|
44
44
|
export type AsyncFactory<TInput, TOutput> = AsyncFactoryFn<TInput, TOutput> | IAsyncFactoryObject<TInput, TOutput>;
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
48
|
-
*/
|
|
49
|
-
export type AsyncFactoryable<TInput, TOutput> = TOutput | AsyncFactory<TInput, TOutput>;
|
|
@@ -5,4 +5,14 @@
|
|
|
5
5
|
*
|
|
6
6
|
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
7
7
|
*/
|
|
8
|
-
export type
|
|
8
|
+
export type ResultFailure<TError = unknown> = [value: null, errror: TError];
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
12
|
+
*/
|
|
13
|
+
export type ResultSuccess<TValue> = [value: TValue, error: null];
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* IMPORT_PATH: `"@daiso-tech/core/utilities"`
|
|
17
|
+
*/
|
|
18
|
+
export type Result<TValue, TError = unknown> = ResultFailure<TError> | ResultSuccess<TValue>;
|