@nx-ddd/core 18.2.1 → 18.5.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 +6 -0
- package/create-decorator.js +27 -0
- package/create-decorator.js.map +1 -0
- package/package.json +1 -1
- package/v2.d.ts +0 -1
- package/v2.js +0 -1
- package/v2.js.map +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
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?: {
|
|
3
|
+
name?: string;
|
|
4
|
+
}) => (target: any, propName: string) => void;
|
|
5
|
+
getAnnotations: (target: any) => Annotation[];
|
|
6
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeDecoratorFactories = makeDecoratorFactories;
|
|
4
|
+
function makeDecoratorFactories(annotationFactory = (type, fieldName, propName, options) => ({}), key = 'annotations') {
|
|
5
|
+
function createDecorator(type, options = {}) {
|
|
6
|
+
return (props) => {
|
|
7
|
+
return (target, propName) => {
|
|
8
|
+
var _a;
|
|
9
|
+
var _b;
|
|
10
|
+
const fieldName = (props === null || props === void 0 ? void 0 : props.name) || propName;
|
|
11
|
+
// const ANNOTATION: Annotation = {type, fieldName, propName, childType: options.childType};
|
|
12
|
+
const annotation = annotationFactory(type, fieldName, propName, options);
|
|
13
|
+
(_a = (_b = target.constructor)[key]) !== null && _a !== void 0 ? _a : (_b[key] = []);
|
|
14
|
+
target.constructor[key].push(annotation);
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function getAnnotations(target) {
|
|
19
|
+
var _a;
|
|
20
|
+
return (_a = target[key]) !== null && _a !== void 0 ? _a : [];
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
createDecorator,
|
|
24
|
+
getAnnotations,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=create-decorator.js.map
|
|
@@ -0,0 +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,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/package.json
CHANGED
package/v2.d.ts
CHANGED
package/v2.js
CHANGED
|
@@ -5,7 +5,6 @@ exports.bootstrapServer = bootstrapServer;
|
|
|
5
5
|
exports.bootstrap = bootstrap;
|
|
6
6
|
exports.ngBootstrap = ngBootstrap;
|
|
7
7
|
const tslib_1 = require("tslib");
|
|
8
|
-
require("@angular/compiler");
|
|
9
8
|
const core_1 = require("@angular/core");
|
|
10
9
|
const platform_server_1 = require("@angular/platform-server");
|
|
11
10
|
let ExampleService = class ExampleService {
|
package/v2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2.js","sourceRoot":"","sources":["../../../../packages/@nx-ddd/core/src/v2.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"v2.js","sourceRoot":"","sources":["../../../../packages/@nx-ddd/core/src/v2.ts"],"names":[],"mappings":";;;AAmBA,0CAKC;AAGD,8BAEC;AAED,kCAmBC;;AAlDD,wCAA6H;AAC7H,8DAAwE;AAGjE,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,KAAK;QACH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;CACF,CAAA;AAJY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,iBAAU,EAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC;GACpB,cAAc,CAI1B;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QACL,YAAO,GAAG,IAAA,aAAM,EAAC,cAAc,CAAC,CAAC;IAKnC,CAAC;IAHC,aAAa;QACX,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACF,CAAA;AANY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,eAAQ,EAAC,EAAE,OAAO,EAAE,CAAC,8BAAY,CAAC,EAAE,CAAC;GACzB,YAAY,CAMxB;AAED,SAAsB,eAAe;iEACnC,UAAqB,EACrB,YAA8B,EAAE;QAEhC,OAAO,IAAA,gCAAc,EAAC,SAAS,CAAC,CAAC,eAAe,CAAC,UAAU,EAAE,EAAC,MAAM,EAAE,MAAM,EAAC,CAAC,CAAC;IACjF,CAAC;CAAA;AAGD,SAAgB,S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