@nx-ddd/core 18.11.0 → 18.12.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/create-decorator.d.ts +2 -2
- package/create-decorator.js +2 -1
- package/create-decorator.js.map +1 -1
- package/di.d.ts +9 -0
- package/di.js +13 -0
- package/di.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
package/create-decorator.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare function makeDecoratorFactories<T extends string, Annotation extends object, O extends {} = any>(annotationFactory?: (type: T, fieldName: string, propName: string, options: O) => Annotation, key?: string): {
|
|
2
|
-
createDecorator: (type: T, options?: O) => (
|
|
2
|
+
createDecorator: (type: T, options?: O) => (nameOrProps?: {
|
|
3
3
|
name?: string;
|
|
4
|
-
}) => (target: any, propName: string) => void;
|
|
4
|
+
} | string) => (target: any, propName: string) => void;
|
|
5
5
|
getAnnotations: (target: any) => Annotation[];
|
|
6
6
|
};
|
package/create-decorator.js
CHANGED
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.makeDecoratorFactories = makeDecoratorFactories;
|
|
4
4
|
function makeDecoratorFactories(annotationFactory = (type, fieldName, propName, options) => ({}), key = 'annotations') {
|
|
5
5
|
function createDecorator(type, options = {}) {
|
|
6
|
-
return (
|
|
6
|
+
return (nameOrProps) => {
|
|
7
|
+
const props = typeof nameOrProps === 'string' ? { name: nameOrProps } : nameOrProps;
|
|
7
8
|
return (target, propName) => {
|
|
8
9
|
var _a;
|
|
9
10
|
var _b;
|
package/create-decorator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-decorator.js","sourceRoot":"","sources":["../../../../packages/@nx-ddd/core/src/create-decorator.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"create-decorator.js","sourceRoot":"","sources":["../../../../packages/@nx-ddd/core/src/create-decorator.ts"],"names":[],"mappings":";;AAAA,wDAqCC;AArCD,SAAgB,sBAAsB,CAKpC,oBAAoB,CAClB,IAAO,EACP,SAAiB,EACjB,QAAgB,EAChB,OAAU,EACV,EAAE,CAAC,CAAC,EAAiB,CAAA,EACvB,MAAc,aAAa;IAE3B,SAAS,eAAe,CACtB,IAAO,EACP,UAAa,EAAO;QAEpB,OAAO,CAAC,WAAsC,EAAE,EAAE;YAChD,MAAM,KAAK,GAAG,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAC,IAAI,EAAE,WAAW,EAAC,CAAC,CAAC,CAAC,WAAW,CAAC;YAClF,OAAO,CAAC,MAAW,EAAE,QAAgB,EAAE,EAAE;;;gBACvC,MAAM,SAAS,GAAG,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,KAAI,QAAQ,CAAC;gBAC1C,4FAA4F;gBAC5F,MAAM,UAAU,GAAG,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;gBACzE,YAAA,MAAM,CAAC,WAAW,EAAC,GAAG,wCAAH,GAAG,IAAM,EAAE,EAAC;gBAC/B,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC3C,CAAC,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;IAED,SAAS,cAAc,CAAC,MAAW;;QACjC,OAAO,MAAA,MAAM,CAAC,GAAG,CAAC,mCAAI,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO;QACL,eAAe;QACf,cAAc;KACf,CAAC;AACJ,CAAC"}
|
package/di.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InjectionToken, InjectOptions } from "@angular/core";
|
|
2
|
+
export declare function makeDI<T>(name: string, options?: InjectOptions): {
|
|
3
|
+
token: InjectionToken<T>;
|
|
4
|
+
inject: () => T | null;
|
|
5
|
+
provide: (useFactory: () => T) => {
|
|
6
|
+
provide: InjectionToken<T>;
|
|
7
|
+
useFactory: () => T;
|
|
8
|
+
};
|
|
9
|
+
};
|
package/di.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeDI = makeDI;
|
|
4
|
+
const core_1 = require("@angular/core");
|
|
5
|
+
function makeDI(name, options = { optional: true }) {
|
|
6
|
+
const token = new core_1.InjectionToken(name);
|
|
7
|
+
return {
|
|
8
|
+
token,
|
|
9
|
+
inject: () => { var _a; return (_a = (0, core_1.inject)(token, options)) !== null && _a !== void 0 ? _a : null; },
|
|
10
|
+
provide: (useFactory) => ({ provide: token, useFactory }),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=di.js.map
|
package/di.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"di.js","sourceRoot":"","sources":["../../../../packages/@nx-ddd/core/src/di.ts"],"names":[],"mappings":";;AAEA,wBAcC;AAhBD,wCAAsE;AAEtE,SAAgB,MAAM,CAAI,IAAY,EAAE,UAAyB,EAAC,QAAQ,EAAE,IAAI,EAAC;IAQ/E,MAAM,KAAK,GAAG,IAAI,qBAAc,CAAI,IAAI,CAAC,CAAC;IAC1C,OAAO;QACL,KAAK;QACL,MAAM,EAAE,GAAG,EAAE,WAAC,OAAA,MAAA,IAAA,aAAM,EAAC,KAAK,EAAE,OAAO,CAAC,mCAAI,IAAI,CAAA,EAAA;QAC5C,OAAO,EAAE,CAAC,UAAmB,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;KACnE,CAAA;AACH,CAAC"}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/@nx-ddd/core/src/index.ts"],"names":[],"mappings":";;;AAAA,+CAAqB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/@nx-ddd/core/src/index.ts"],"names":[],"mappings":";;;AAAA,+CAAqB;AACrB,+CAAqB"}
|