@decaf-ts/core 0.7.54 → 0.7.55
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/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/utils/utils.d.ts +13 -0
- package/lib/esm/utils/utils.js +16 -0
- package/lib/esm/utils/utils.js.map +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/utils/utils.cjs +17 -0
- package/lib/utils/utils.d.ts +13 -0
- package/lib/utils/utils.js.map +1 -1
- package/package.json +1 -1
package/lib/esm/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export * from "./ram";
|
|
|
20
20
|
* @const VERSION
|
|
21
21
|
* @memberOf module:core
|
|
22
22
|
*/
|
|
23
|
-
export declare const VERSION = "0.7.
|
|
23
|
+
export declare const VERSION = "0.7.54";
|
|
24
24
|
/**
|
|
25
25
|
* @description Stores the current package version
|
|
26
26
|
* @summary A constant representing the version of the core package
|
package/lib/esm/index.js
CHANGED
|
@@ -27,7 +27,7 @@ export * from "./ram/index.js";
|
|
|
27
27
|
* @const VERSION
|
|
28
28
|
* @memberOf module:core
|
|
29
29
|
*/
|
|
30
|
-
export const VERSION = "0.7.
|
|
30
|
+
export const VERSION = "0.7.54";
|
|
31
31
|
/**
|
|
32
32
|
* @description Stores the current package version
|
|
33
33
|
* @summary A constant representing the version of the core package
|
package/lib/esm/utils/utils.d.ts
CHANGED
|
@@ -4,3 +4,16 @@ import { Constructor } from "@decaf-ts/decoration";
|
|
|
4
4
|
export declare function injectableServiceKey(name: string | symbol | Constructor): string;
|
|
5
5
|
export declare function promiseSequence<T>(tasks: (() => Promise<T>)[]): Promise<T[]>;
|
|
6
6
|
export declare function isOperationBlocked(ModelConstructor: ModelConstructor<any>, op: CrudOperations): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* @description Normalizes imports to handle both CommonJS and ESModule formats.
|
|
9
|
+
* @summary Utility function to handle module import differences between formats.
|
|
10
|
+
*
|
|
11
|
+
* @template T - Type of the imported module.
|
|
12
|
+
* @param {Promise<T>} importPromise - Promise returned by dynamic import.
|
|
13
|
+
* @return {Promise<T>} Normalized module.
|
|
14
|
+
*
|
|
15
|
+
* @function normalizeImport
|
|
16
|
+
*
|
|
17
|
+
* @memberOf module:core
|
|
18
|
+
*/
|
|
19
|
+
export declare function normalizeImport<T>(importPromise: Promise<T>): Promise<T>;
|
package/lib/esm/utils/utils.js
CHANGED
|
@@ -17,4 +17,20 @@ export function isOperationBlocked(ModelConstructor, op) {
|
|
|
17
17
|
const { handler, args } = (Metadata.get(ModelConstructor, OperationKeys.REFLECT + OperationKeys.BLOCK) || {});
|
|
18
18
|
return !handler ? false : (handler(...args, op) ?? false);
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* @description Normalizes imports to handle both CommonJS and ESModule formats.
|
|
22
|
+
* @summary Utility function to handle module import differences between formats.
|
|
23
|
+
*
|
|
24
|
+
* @template T - Type of the imported module.
|
|
25
|
+
* @param {Promise<T>} importPromise - Promise returned by dynamic import.
|
|
26
|
+
* @return {Promise<T>} Normalized module.
|
|
27
|
+
*
|
|
28
|
+
* @function normalizeImport
|
|
29
|
+
*
|
|
30
|
+
* @memberOf module:core
|
|
31
|
+
*/
|
|
32
|
+
export async function normalizeImport(importPromise) {
|
|
33
|
+
// CommonJS's `module.exports` is wrapped as `default` in ESModule.
|
|
34
|
+
return importPromise.then((m) => (m.default || m));
|
|
35
|
+
}
|
|
20
36
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAe,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE7D,M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CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAM,CAAC,CAAC;AAC/D,CAAC"}
|
package/lib/index.cjs
CHANGED
|
@@ -44,7 +44,7 @@ __exportStar(require("./ram/index.cjs"), exports);
|
|
|
44
44
|
* @const VERSION
|
|
45
45
|
* @memberOf module:core
|
|
46
46
|
*/
|
|
47
|
-
exports.VERSION = "0.7.
|
|
47
|
+
exports.VERSION = "0.7.54";
|
|
48
48
|
/**
|
|
49
49
|
* @description Stores the current package version
|
|
50
50
|
* @summary A constant representing the version of the core package
|
package/lib/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export * from "./ram";
|
|
|
20
20
|
* @const VERSION
|
|
21
21
|
* @memberOf module:core
|
|
22
22
|
*/
|
|
23
|
-
export declare const VERSION = "0.7.
|
|
23
|
+
export declare const VERSION = "0.7.54";
|
|
24
24
|
/**
|
|
25
25
|
* @description Stores the current package version
|
|
26
26
|
* @summary A constant representing the version of the core package
|
package/lib/utils/utils.cjs
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.injectableServiceKey = injectableServiceKey;
|
|
4
4
|
exports.promiseSequence = promiseSequence;
|
|
5
5
|
exports.isOperationBlocked = isOperationBlocked;
|
|
6
|
+
exports.normalizeImport = normalizeImport;
|
|
6
7
|
const db_decorators_1 = require("@decaf-ts/db-decorators");
|
|
7
8
|
const db_decorators_2 = require("@decaf-ts/db-decorators");
|
|
8
9
|
const decoration_1 = require("@decaf-ts/decoration");
|
|
@@ -22,4 +23,20 @@ function isOperationBlocked(ModelConstructor, op) {
|
|
|
22
23
|
const { handler, args } = (decoration_1.Metadata.get(ModelConstructor, db_decorators_2.OperationKeys.REFLECT + db_decorators_2.OperationKeys.BLOCK) || {});
|
|
23
24
|
return !handler ? false : (handler(...args, op) ?? false);
|
|
24
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* @description Normalizes imports to handle both CommonJS and ESModule formats.
|
|
28
|
+
* @summary Utility function to handle module import differences between formats.
|
|
29
|
+
*
|
|
30
|
+
* @template T - Type of the imported module.
|
|
31
|
+
* @param {Promise<T>} importPromise - Promise returned by dynamic import.
|
|
32
|
+
* @return {Promise<T>} Normalized module.
|
|
33
|
+
*
|
|
34
|
+
* @function normalizeImport
|
|
35
|
+
*
|
|
36
|
+
* @memberOf module:core
|
|
37
|
+
*/
|
|
38
|
+
async function normalizeImport(importPromise) {
|
|
39
|
+
// CommonJS's `module.exports` is wrapped as `default` in ESModule.
|
|
40
|
+
return importPromise.then((m) => (m.default || m));
|
|
41
|
+
}
|
|
25
42
|
//# sourceMappingURL=utils.js.map
|
package/lib/utils/utils.d.ts
CHANGED
|
@@ -4,3 +4,16 @@ import { Constructor } from "@decaf-ts/decoration";
|
|
|
4
4
|
export declare function injectableServiceKey(name: string | symbol | Constructor): string;
|
|
5
5
|
export declare function promiseSequence<T>(tasks: (() => Promise<T>)[]): Promise<T[]>;
|
|
6
6
|
export declare function isOperationBlocked(ModelConstructor: ModelConstructor<any>, op: CrudOperations): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* @description Normalizes imports to handle both CommonJS and ESModule formats.
|
|
9
|
+
* @summary Utility function to handle module import differences between formats.
|
|
10
|
+
*
|
|
11
|
+
* @template T - Type of the imported module.
|
|
12
|
+
* @param {Promise<T>} importPromise - Promise returned by dynamic import.
|
|
13
|
+
* @return {Promise<T>} Normalized module.
|
|
14
|
+
*
|
|
15
|
+
* @function normalizeImport
|
|
16
|
+
*
|
|
17
|
+
* @memberOf module:core
|
|
18
|
+
*/
|
|
19
|
+
export declare function normalizeImport<T>(importPromise: Promise<T>): Promise<T>;
|
package/lib/utils/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":";;AAKA,oDASC;AAED,0CAKC;AAED,gDAiBC;
|
|
1
|
+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