@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.
@@ -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) => (props?: {
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
  };
@@ -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 (props) => {
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;
@@ -1 +1 @@
1
- {"version":3,"file":"create-decorator.js","sourceRoot":"","sources":["../../../../packages/@nx-ddd/core/src/create-decorator.ts"],"names":[],"mappings":";;AAAA,wDAoCC;AApCD,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,KAAuB,EAAE,EAAE;YACjC,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,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AAC;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
@@ -1 +1,2 @@
1
+ export * from './di';
1
2
  export * from './v2';
package/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./di"), exports);
4
5
  tslib_1.__exportStar(require("./v2"), exports);
5
6
  //# sourceMappingURL=index.js.map
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx-ddd/core",
3
- "version": "18.11.0",
3
+ "version": "18.12.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "homepage": "https://github.com/xx-machina/plaform/tree/main/packages/@nx-ddd/core",