@nx-ddd/core 19.0.0-preview.3 → 19.0.0-preview.30

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/di.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { InjectionToken, InjectOptions } from "@angular/core";
2
- export declare function makeDI<T>(name: string, options?: InjectOptions): {
2
+ export interface DiToken<T> {
3
3
  token: InjectionToken<T>;
4
4
  inject: () => T | null;
5
5
  provide: (useFactory: () => T) => {
6
6
  provide: InjectionToken<T>;
7
7
  useFactory: () => T;
8
8
  };
9
- };
9
+ }
10
+ export declare function makeDI<T>(name: string, options?: InjectOptions): DiToken<T>;
@@ -0,0 +1,11 @@
1
+ const NG_INJECTOR = '[@nx-ddd/core] Ng Injector';
2
+ function provideNgInjector(useFactory) {
3
+ return { provide: NG_INJECTOR, useFactory };
4
+ }
5
+
6
+ /**
7
+ * Generated bundle index. Do not edit.
8
+ */
9
+
10
+ export { NG_INJECTOR, provideNgInjector };
11
+ //# sourceMappingURL=nx-ddd-core-nest-interop.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nx-ddd-core-nest-interop.mjs","sources":["../../../../../packages/@nx-ddd/core/src/lib/nest-interop/nest-interop.ts","../../../../../packages/@nx-ddd/core/src/lib/nest-interop/nx-ddd-core-nest-interop.ts"],"sourcesContent":["import { Injector } from '@angular/core';\nimport type { InjectionToken } from '@nestjs/common';\n\nexport const NG_INJECTOR: InjectionToken<Injector> = '[@nx-ddd/core] Ng Injector';\nexport function provideNgInjector(useFactory: () => Injector | Promise<Injector>): any {\n return { provide: NG_INJECTOR, useFactory };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAGO,MAAM,WAAW,GAA6B;AAC/C,SAAU,iBAAiB,CAAC,UAA8C,EAAA;AAC9E,IAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE;AAC7C;;ACNA;;AAEG;;;;"}
@@ -0,0 +1,267 @@
1
+ import { set } from 'lodash-es';
2
+ import dayjs from 'dayjs';
3
+ import { registerDecorator, validateSync } from 'class-validator';
4
+ import { plainToInstance as plainToInstance$1 } from 'class-transformer';
5
+ import * as i0 from '@angular/core';
6
+ import { InjectionToken, inject, Injectable, NgModule, Injector } from '@angular/core';
7
+ import { ServerModule, platformServer } from '@angular/platform-server';
8
+
9
+ function walkObj(obj, options, paths = []) {
10
+ // callbackの結果がfalseのときは再帰を止める
11
+ const [stop, _value] = options.overwrite(paths, obj);
12
+ if (stop)
13
+ return options.callback(paths, _value);
14
+ if (obj instanceof Array) {
15
+ obj.forEach((item, index) => walkObj(item, options, [...paths, index.toString()]));
16
+ }
17
+ else if (obj instanceof Object) {
18
+ Object.entries(obj).forEach(([key, value]) => walkObj(value, options, [...paths, key]));
19
+ }
20
+ else if (obj instanceof Function) {
21
+ // 何もしない
22
+ }
23
+ else {
24
+ options.callback(paths, obj);
25
+ }
26
+ }
27
+ function reconstruct(obj, overwrite = () => [false]) {
28
+ const newObj = {};
29
+ walkObj(obj, {
30
+ callback: (paths, value) => {
31
+ if (typeof value === 'undefined')
32
+ return;
33
+ set(newObj, paths.join('.'), value);
34
+ },
35
+ overwrite,
36
+ });
37
+ return newObj;
38
+ }
39
+ function reconstructAsISOString(obj) {
40
+ return reconstruct(obj, (paths, value) => {
41
+ if (dayjs.isDayjs(value)) {
42
+ if (value.isValid())
43
+ return [true, value.toISOString()];
44
+ return [true, null];
45
+ }
46
+ return [false];
47
+ });
48
+ }
49
+ function flattenExcludeDayjs(obj) {
50
+ const newObj = {};
51
+ walkObj(obj, {
52
+ callback: (paths, value) => {
53
+ if (typeof value === 'undefined')
54
+ return;
55
+ newObj[paths.join('.')] = value;
56
+ },
57
+ overwrite: (paths, value) => {
58
+ if (dayjs.isDayjs(value)) {
59
+ if (!value.isValid()) {
60
+ return [true, null];
61
+ }
62
+ return [true, value.toISOString()];
63
+ }
64
+ return [false];
65
+ },
66
+ });
67
+ return newObj;
68
+ }
69
+
70
+ function deepForEach(input, fn) {
71
+ input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));
72
+ }
73
+
74
+ function IsDayjs(validationOptions) {
75
+ return function (object, propertyName) {
76
+ registerDecorator({
77
+ name: 'isDayjs',
78
+ target: object.constructor,
79
+ propertyName: propertyName,
80
+ options: validationOptions,
81
+ validator: {
82
+ validate(value, args) {
83
+ return dayjs.isDayjs(value);
84
+ }
85
+ }
86
+ });
87
+ };
88
+ }
89
+
90
+ const EMPTY_OBJ = {};
91
+ const EMPTY_ARRAY = [];
92
+
93
+ function plainToInstanceWithValid(cls, plain) {
94
+ const instance = plainToInstance(cls, plain);
95
+ const errors = validateSync(instance);
96
+ if (errors.length)
97
+ throw errors;
98
+ return instance;
99
+ }
100
+ function plainToInstance(cls, plain) {
101
+ return plainToInstance$1(cls, reconstructAsISOString(plain));
102
+ }
103
+
104
+ /**
105
+ * @license
106
+ * Copyright Google LLC All Rights Reserved.
107
+ *
108
+ * Use of this source code is governed by an MIT-style license that can be
109
+ * found in the LICENSE file at https://angular.io/license
110
+ */
111
+ function getClosureSafeProperty(objWithPropertyToExtract) {
112
+ for (const key in objWithPropertyToExtract) {
113
+ if (objWithPropertyToExtract[key] === getClosureSafeProperty) {
114
+ return key;
115
+ }
116
+ }
117
+ throw Error('Could not find renamed property on target object.');
118
+ }
119
+ /**
120
+ * Sets properties on a target object from a source object, but only if
121
+ * the property doesn't already exist on the target object.
122
+ * @param target The target to set properties on
123
+ * @param source The source of the property keys and values to set
124
+ */
125
+ function fillProperties(target, source) {
126
+ for (const key in source) {
127
+ if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {
128
+ target[key] = source[key];
129
+ }
130
+ }
131
+ }
132
+
133
+ /**
134
+ * @license
135
+ * Copyright Google LLC All Rights Reserved.
136
+ *
137
+ * Use of this source code is governed by an MIT-style license that can be
138
+ * found in the LICENSE file at https://angular.io/license
139
+ */
140
+ function stringify(token) {
141
+ if (typeof token === 'string') {
142
+ return token;
143
+ }
144
+ if (Array.isArray(token)) {
145
+ return '[' + token.map(stringify).join(', ') + ']';
146
+ }
147
+ if (token == null) {
148
+ return '' + token;
149
+ }
150
+ if (token.overriddenName) {
151
+ return `${token.overriddenName}`;
152
+ }
153
+ if (token.name) {
154
+ return `${token.name}`;
155
+ }
156
+ const res = token.toString();
157
+ if (res == null) {
158
+ return '' + res;
159
+ }
160
+ const newLineIndex = res.indexOf('\n');
161
+ return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
162
+ }
163
+ /**
164
+ * Concatenates two strings with separator, allocating new strings only when necessary.
165
+ *
166
+ * @param before before string.
167
+ * @param separator separator string.
168
+ * @param after after string.
169
+ * @returns concatenated string.
170
+ */
171
+ function concatStringsWithSpace(before, after) {
172
+ return (before == null || before === '') ?
173
+ (after === null ? '' : after) :
174
+ ((after == null || after === '') ? before : before + ' ' + after);
175
+ }
176
+
177
+ function makeDecoratorFactories(annotationFactory = (type, fieldName, propName, options) => ({}), key = 'annotations') {
178
+ function createDecorator(type, options = {}) {
179
+ return (nameOrProps) => {
180
+ const props = typeof nameOrProps === 'string' ? { name: nameOrProps } : nameOrProps;
181
+ return (target, propName) => {
182
+ const fieldName = props?.name || propName;
183
+ // const ANNOTATION: Annotation = {type, fieldName, propName, childType: options.childType};
184
+ const annotation = annotationFactory(type, fieldName, propName, options);
185
+ target.constructor[key] ??= [];
186
+ target.constructor[key].push(annotation);
187
+ };
188
+ };
189
+ }
190
+ function getAnnotations(target) {
191
+ return target[key] ?? [];
192
+ }
193
+ return {
194
+ createDecorator,
195
+ getAnnotations,
196
+ };
197
+ }
198
+
199
+ function makeDI(name, options = { optional: true }) {
200
+ const token = new InjectionToken(name);
201
+ return {
202
+ token,
203
+ inject: () => inject(token, options) ?? null,
204
+ provide: (useFactory) => ({ provide: token, useFactory }),
205
+ };
206
+ }
207
+
208
+ class ExampleService {
209
+ hello() {
210
+ console.debug('hello');
211
+ }
212
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ExampleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
213
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ExampleService, providedIn: 'root' });
214
+ }
215
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ExampleService, decorators: [{
216
+ type: Injectable,
217
+ args: [{ providedIn: 'root' }]
218
+ }] });
219
+ class CommonModule {
220
+ service = inject(ExampleService);
221
+ ngDoBootstrap() {
222
+ this.service.hello();
223
+ }
224
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: CommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
225
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.4", ngImport: i0, type: CommonModule, imports: [ServerModule] });
226
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: CommonModule, imports: [ServerModule] });
227
+ }
228
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: CommonModule, decorators: [{
229
+ type: NgModule,
230
+ args: [{ imports: [ServerModule] }]
231
+ }] });
232
+ async function bootstrapServer(moduleType, providers = []) {
233
+ return platformServer(providers).bootstrapModule(moduleType, { ngZone: 'noop' });
234
+ }
235
+ function bootstrap(providers = []) {
236
+ return ngBootstrap(providers);
237
+ }
238
+ function ngBootstrap(providers = []) {
239
+ return new Promise((resolve) => {
240
+ class AppModule {
241
+ injector = inject(Injector);
242
+ async ngDoBootstrap() {
243
+ resolve(this.injector);
244
+ }
245
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AppModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
246
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.4", ngImport: i0, type: AppModule, imports: [ServerModule] });
247
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AppModule, providers: providers, imports: [ServerModule] });
248
+ }
249
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AppModule, decorators: [{
250
+ type: NgModule,
251
+ args: [{
252
+ imports: [
253
+ ServerModule,
254
+ ],
255
+ providers: providers,
256
+ }]
257
+ }] });
258
+ bootstrapServer(AppModule);
259
+ });
260
+ }
261
+
262
+ /**
263
+ * Generated bundle index. Do not edit.
264
+ */
265
+
266
+ export { CommonModule, EMPTY_ARRAY, EMPTY_OBJ, ExampleService, IsDayjs, bootstrap, bootstrapServer, concatStringsWithSpace, deepForEach, fillProperties, flattenExcludeDayjs, getClosureSafeProperty, makeDI, makeDecoratorFactories, ngBootstrap, plainToInstance, plainToInstanceWithValid, reconstruct, reconstructAsISOString, stringify, walkObj };
267
+ //# sourceMappingURL=nx-ddd-core.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nx-ddd-core.mjs","sources":["../../../../../packages/@nx-ddd/core/src/lib/util/walk-obj/walk-obj.ts","../../../../../packages/@nx-ddd/core/src/lib/util/array_utils.ts","../../../../../packages/@nx-ddd/core/src/lib/util/class-validators.ts","../../../../../packages/@nx-ddd/core/src/lib/util/empty.ts","../../../../../packages/@nx-ddd/core/src/lib/util/plain-to-instance-with-valid.ts","../../../../../packages/@nx-ddd/core/src/lib/util/property.ts","../../../../../packages/@nx-ddd/core/src/lib/util/stringify.ts","../../../../../packages/@nx-ddd/core/src/lib/create-decorator.ts","../../../../../packages/@nx-ddd/core/src/lib/di.ts","../../../../../packages/@nx-ddd/core/src/lib/v2.ts","../../../../../packages/@nx-ddd/core/src/lib/nx-ddd-core.ts"],"sourcesContent":["import { set } from 'lodash-es';\nimport dayjs from 'dayjs';\n\ntype OverwriteFunction = (paths: string[], value: any) => [boolean, any] | [boolean];\n\nexport function walkObj<T>(obj: T, options: {\n callback: (paths: string[], value: any) => void,\n overwrite: OverwriteFunction,\n}, paths: string[] = []) {\n // callbackの結果がfalseのときは再帰を止める\n const [stop, _value] = options.overwrite(paths, obj);\n if (stop) return options.callback(paths, _value);\n\n if (obj instanceof Array) {\n obj.forEach((item, index) => walkObj(item, options, [...paths, index.toString()]));\n } else if (obj instanceof Object) {\n Object.entries(obj).forEach(([key, value]) => walkObj(value, options, [...paths, key]));\n } else if (obj instanceof Function) {\n // 何もしない\n } else {\n options.callback(paths, obj);\n }\n}\n\nexport function reconstruct<T, K = object>(obj: T, overwrite: OverwriteFunction = () => [false]): K {\n const newObj = {};\n walkObj(obj, {\n callback: (paths: string[], value) => {\n if (typeof value === 'undefined') return;\n set(newObj, paths.join('.'), value)\n },\n overwrite,\n });\n return newObj as K;\n}\n\ntype ReconstructAsISOString<T> = {\n [K in keyof T]: T[K] extends dayjs.Dayjs ? string | null : T[K];\n}\n\nexport function reconstructAsISOString<T>(obj: T): ReconstructAsISOString<T> {\n return reconstruct(obj, (paths, value) => {\n if (dayjs.isDayjs(value)) {\n if (value.isValid()) return [true, value.toISOString()];\n return [true, null];\n }\n return [false];\n }) as ReconstructAsISOString<T>;\n}\n\ntype FlattenExcludeDayjs<T> = {\n [K in keyof T]: T[K] extends dayjs.Dayjs ? string : T[K];\n}\n\nexport function flattenExcludeDayjs<T>(obj: T): FlattenExcludeDayjs<T> {\n const newObj = {};\n walkObj(obj, {\n callback: (paths: string[], value) => {\n if (typeof value === 'undefined') return;\n newObj[paths.join('.')] = value;\n },\n overwrite: (paths, value) => {\n if (dayjs.isDayjs(value)) {\n if (!value.isValid()) {\n return [true, null];\n }\n return [true, value.toISOString()];\n }\n return [false];\n },\n });\n return newObj as FlattenExcludeDayjs<T>;\n}\n","export function deepForEach<T>(input: (T|any[])[], fn: (value: T) => void): void {\n input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));\n}\n","import { registerDecorator, ValidationOptions, ValidationArguments } from 'class-validator';\nimport dayjs from 'dayjs';\n\nexport function IsDayjs(validationOptions?: ValidationOptions) {\n return function (object: Object, propertyName: string) {\n registerDecorator({\n name: 'isDayjs',\n target: object.constructor,\n propertyName: propertyName,\n options: validationOptions,\n validator: {\n validate(value: any, args: ValidationArguments) {\n return dayjs.isDayjs(value);\n }\n }\n });\n };\n}\n","export const EMPTY_OBJ: {} = {};\nexport const EMPTY_ARRAY: any[] = [];\n","import { ClassConstructor, plainToInstance as _plainToInstance } from 'class-transformer';\nimport { validateSync } from 'class-validator';\nimport { reconstructAsISOString } from './walk-obj';\n\nexport function plainToInstanceWithValid<T extends object>(cls: ClassConstructor<T>, plain: object): T {\n const instance = plainToInstance(cls, plain);\n const errors = validateSync(instance);\n if (errors.length) throw errors;\n return instance;\n}\n\nexport function plainToInstance<T extends object>(cls: ClassConstructor<T>, plain: object) {\n return _plainToInstance(cls, reconstructAsISOString(plain));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function getClosureSafeProperty<T>(objWithPropertyToExtract: T): string {\n for (const key in objWithPropertyToExtract) {\n if (objWithPropertyToExtract[key] === getClosureSafeProperty as any) {\n return key;\n }\n }\n throw Error('Could not find renamed property on target object.');\n}\n\n/**\n * Sets properties on a target object from a source object, but only if\n * the property doesn't already exist on the target object.\n * @param target The target to set properties on\n * @param source The source of the property keys and values to set\n */\nexport function fillProperties(target: {[key: string]: string}, source: {[key: string]: string}) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n export function stringify(token: any): string {\n if (typeof token === 'string') {\n return token;\n }\n\n if (Array.isArray(token)) {\n return '[' + token.map(stringify).join(', ') + ']';\n }\n\n if (token == null) {\n return '' + token;\n }\n\n if (token.overriddenName) {\n return `${token.overriddenName}`;\n }\n\n if (token.name) {\n return `${token.name}`;\n }\n\n const res = token.toString();\n\n if (res == null) {\n return '' + res;\n }\n\n const newLineIndex = res.indexOf('\\n');\n return newLineIndex === -1 ? res : res.substring(0, newLineIndex);\n}\n\n/**\n * Concatenates two strings with separator, allocating new strings only when necessary.\n *\n * @param before before string.\n * @param separator separator string.\n * @param after after string.\n * @returns concatenated string.\n */\nexport function concatStringsWithSpace(before: string|null, after: string|null): string {\n return (before == null || before === '') ?\n (after === null ? '' : after) :\n ((after == null || after === '') ? before : before + ' ' + after);\n}","export function makeDecoratorFactories<\n T extends string,\n Annotation extends object,\n O extends {} = any,\n>(\n annotationFactory = (\n type: T,\n fieldName: string,\n propName: string,\n options: O,\n ) => ({} as Annotation),\n key = 'annotations',\n) {\n function createDecorator(\n type: T,\n options: O = {} as O,\n ) {\n return (nameOrProps?: {name?: string} | string) => {\n const props = typeof nameOrProps === 'string' ? {name: nameOrProps} : nameOrProps;\n return (target: any, propName: string) => {\n const fieldName = props?.name || propName;\n // const ANNOTATION: Annotation = {type, fieldName, propName, childType: options.childType};\n const annotation = annotationFactory(type, fieldName, propName, options);\n target.constructor[key] ??= [];\n target.constructor[key].push(annotation);\n };\n };\n }\n\n function getAnnotations(target: any): Annotation[] {\n return target[key] ?? [];\n }\n\n return {\n createDecorator,\n getAnnotations, \n };\n}\n","import { inject, InjectionToken, InjectOptions } from \"@angular/core\";\n\nexport interface DiToken<T> {\n token: InjectionToken<T>;\n inject: () => T | null;\n provide: (useFactory: () => T) => {\n provide: InjectionToken<T>,\n useFactory: () => T\n };\n}\n\nexport function makeDI<T>(name: string, options: InjectOptions = {optional: true}): DiToken<T> {\n const token = new InjectionToken<T>(name);\n return {\n token,\n inject: () => inject(token, options) ?? null,\n provide: (useFactory: () => T) => ({ provide: token, useFactory }),\n }\n}\n","import { EnvironmentProviders, Injectable, Injector, NgModule, Provider, StaticProvider, Type, inject } from '@angular/core';\nimport { ServerModule, platformServer } from '@angular/platform-server';\n\n@Injectable({providedIn: 'root'})\nexport class ExampleService {\n hello() {\n console.debug('hello');\n }\n}\n\n@NgModule({ imports: [ServerModule] })\nexport class CommonModule {\n service = inject(ExampleService);\n\n ngDoBootstrap() {\n this.service.hello();\n }\n}\n\nexport async function bootstrapServer(\n moduleType: Type<any>,\n providers: StaticProvider[] = []\n) {\n return platformServer(providers).bootstrapModule(moduleType, {ngZone: 'noop'});\n}\n\n\nexport function bootstrap(providers: Array<Provider | EnvironmentProviders> = []): Promise<Injector> {\n return ngBootstrap(providers);\n}\n\nexport function ngBootstrap(providers: Array<Provider | EnvironmentProviders> = []): Promise<Injector> {\n return new Promise((resolve) => {\n\n @NgModule({\n imports: [\n ServerModule,\n ],\n providers: providers as never as Provider[],\n })\n class AppModule {\n readonly injector = inject(Injector);\n \n async ngDoBootstrap(): Promise<void> {\n resolve(this.injector);\n }\n }\n\n bootstrapServer(AppModule);\n });\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["_plainToInstance"],"mappings":";;;;;;;;AAKM,SAAU,OAAO,CAAI,GAAM,EAAE,OAGlC,EAAE,QAAkB,EAAE,EAAA;;AAErB,IAAA,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;AACpD,IAAA,IAAI,IAAI;QAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;AAEhD,IAAA,IAAI,GAAG,YAAY,KAAK,EAAE;QACxB,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;;AAC7E,SAAA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GAAA;AACjB,gBAAA,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;;+GAJpB,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAT,YAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,SAAS,YAJX,YAAY,CAAA,EAAA,CAAA;gHAIV,SAAS,EAAA,SAAA,EAFF,SAAgC,EAAA,OAAA,EAAA,CAFzC,YAAY,CAAA,EAAA,CAAA;;mGAIV,SAAS,EAAA,UAAA,EAAA,CAAA;0BANd,QAAQ;AAAC,oBAAA,IAAA,EAAA,CAAA;AACR,4BAAA,OAAO,EAAE;gCACP,YAAY;AACb,6BAAA;AACD,4BAAA,SAAS,EAAE,SAAgC;AAC5C,yBAAA;;QASD,eAAe,CAAC,SAAS,CAAC;AAC3B,KAAA,CAAC;AACJ;;AClDA;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
+ export * from './util';
2
+ export * from './create-decorator';
1
3
  export * from './di';
2
4
  export * from './v2';
@@ -0,0 +1 @@
1
+ export * from './nest-interop';
package/package.json CHANGED
@@ -1,13 +1,7 @@
1
1
  {
2
2
  "name": "@nx-ddd/core",
3
- "version": "19.0.0-preview.3",
4
- "main": "./index.js",
5
- "types": "./index.d.ts",
6
- "homepage": "https://github.com/xx-machina/plaform/tree/main/packages/@nx-ddd/core",
7
- "repository": {
8
- "type": "git",
9
- "url": "https://github.com/xx-machina/plaform.git"
10
- },
3
+ "version": "19.0.0-preview.30",
4
+ "license": "MIT",
11
5
  "peerDependencies": {
12
6
  "@angular/core": "19.1.4",
13
7
  "@angular/platform-server": "19.1.4",
@@ -15,9 +9,25 @@
15
9
  "class-transformer": "^0.5.1",
16
10
  "class-validator": "^0.14.0",
17
11
  "dayjs": "1.11.13",
18
- "lodash-es": "^4.17.15",
12
+ "lodash-es": "^4.17.15"
13
+ },
14
+ "dependencies": {
19
15
  "tslib": "^2.3.0"
20
16
  },
21
- "dependencies": {},
22
- "type": "commonjs"
17
+ "module": "fesm2022/nx-ddd-core.mjs",
18
+ "typings": "index.d.ts",
19
+ "exports": {
20
+ "./package.json": {
21
+ "default": "./package.json"
22
+ },
23
+ ".": {
24
+ "types": "./index.d.ts",
25
+ "default": "./fesm2022/nx-ddd-core.mjs"
26
+ },
27
+ "./nest-interop": {
28
+ "types": "./nest-interop/index.d.ts",
29
+ "default": "./fesm2022/nx-ddd-core-nest-interop.mjs"
30
+ }
31
+ },
32
+ "sideEffects": false
23
33
  }
package/util/index.d.ts CHANGED
@@ -1 +1,7 @@
1
+ export * from './walk-obj';
2
+ export * from './array_utils';
3
+ export * from './class-validators';
4
+ export * from './empty';
1
5
  export * from './plain-to-instance-with-valid';
6
+ export * from './property';
7
+ export * from './stringify';
package/v2.d.ts CHANGED
@@ -1,10 +1,17 @@
1
1
  import { EnvironmentProviders, Injector, Provider, StaticProvider, Type } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "@angular/platform-server";
2
4
  export declare class ExampleService {
3
5
  hello(): void;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<ExampleService, never>;
7
+ static ɵprov: i0.ɵɵInjectableDeclaration<ExampleService>;
4
8
  }
5
9
  export declare class CommonModule {
6
10
  service: ExampleService;
7
11
  ngDoBootstrap(): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<CommonModule, never>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CommonModule, never, [typeof i1.ServerModule], never>;
14
+ static ɵinj: i0.ɵɵInjectorDeclaration<CommonModule>;
8
15
  }
9
16
  export declare function bootstrapServer(moduleType: Type<any>, providers?: StaticProvider[]): Promise<import("@angular/core").NgModuleRef<any>>;
10
17
  export declare function bootstrap(providers?: Array<Provider | EnvironmentProviders>): Promise<Injector>;
package/README.md DELETED
@@ -1,42 +0,0 @@
1
- # NxDDD Core
2
- `@nx-ddd/core` is a wrapper library that allows the use of Angular's hierarchical injector in backend or CLI environments.
3
-
4
- ## Install
5
- ```sh
6
- $ npm i @nx-ddd/core
7
- ```
8
-
9
- ## Usage
10
-
11
- ```ts
12
- import '@angular/compiler';
13
- import { Injectable } from '@angular/core';
14
- import { bootstrap } from './index';
15
-
16
- @Injectable()
17
- export abstract class Repository {
18
- abstract name: string;
19
- }
20
-
21
- @Injectable()
22
- export class RepositoryImpl extends Repository {
23
- name = 'RepositoryImpl.name';
24
- }
25
-
26
- @Injectable({providedIn: 'root'})
27
- export class AppService {
28
- constructor(public repository: Repository) { }
29
- }
30
-
31
- async function main() {
32
- const injector = await bootstrap([
33
- // Inject RepositoryImpl
34
- { provide: Repository, useClass: RepositoryImpl},
35
- ]);
36
- const app = injector.get(AppService);
37
- console.debug('app.repository.name:', app.repository.name);
38
- }
39
- ```
40
-
41
- ## LISENCE
42
- MIT
@@ -1,28 +0,0 @@
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 (nameOrProps) => {
7
- const props = typeof nameOrProps === 'string' ? { name: nameOrProps } : nameOrProps;
8
- return (target, propName) => {
9
- var _a;
10
- var _b;
11
- const fieldName = (props === null || props === void 0 ? void 0 : props.name) || propName;
12
- // const ANNOTATION: Annotation = {type, fieldName, propName, childType: options.childType};
13
- const annotation = annotationFactory(type, fieldName, propName, options);
14
- (_a = (_b = target.constructor)[key]) !== null && _a !== void 0 ? _a : (_b[key] = []);
15
- target.constructor[key].push(annotation);
16
- };
17
- };
18
- }
19
- function getAnnotations(target) {
20
- var _a;
21
- return (_a = target[key]) !== null && _a !== void 0 ? _a : [];
22
- }
23
- return {
24
- createDecorator,
25
- getAnnotations,
26
- };
27
- }
28
- //# sourceMappingURL=create-decorator.js.map
@@ -1 +0,0 @@
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,GAAG,GAAG,aAAa;IAEnB,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.js DELETED
@@ -1,13 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
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.js DELETED
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./di"), exports);
5
- tslib_1.__exportStar(require("./v2"), exports);
6
- //# sourceMappingURL=index.js.map
package/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/@nx-ddd/core/src/index.ts"],"names":[],"mappings":";;;AAAA,+CAAqB;AACrB,+CAAqB"}
package/nest-interop.js DELETED
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NG_INJECTOR = void 0;
4
- exports.provideNgInjector = provideNgInjector;
5
- exports.NG_INJECTOR = '[@nx-ddd/core] Ng Injector';
6
- function provideNgInjector(useFactory) {
7
- return { provide: exports.NG_INJECTOR, useFactory };
8
- }
9
- //# sourceMappingURL=nest-interop.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nest-interop.js","sourceRoot":"","sources":["../../../../packages/@nx-ddd/core/src/nest-interop.ts"],"names":[],"mappings":";;;AAIA,8CAEC;AAHY,QAAA,WAAW,GAA6B,4BAA4B,CAAC;AAClF,SAAgB,iBAAiB,CAAC,UAA8C;IAC9E,OAAO,EAAE,OAAO,EAAE,mBAAW,EAAE,UAAU,EAAE,CAAC;AAC9C,CAAC"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deepForEach = deepForEach;
4
- function deepForEach(input, fn) {
5
- input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));
6
- }
7
- //# sourceMappingURL=array_utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array_utils.js","sourceRoot":"","sources":["../../../../../packages/@nx-ddd/core/src/util/array_utils.ts"],"names":[],"mappings":";;AAAA,kCAEC;AAFD,SAAgB,WAAW,CAAI,KAAkB,EAAE,EAAsB;IACvE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACpF,CAAC"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IsDayjs = IsDayjs;
4
- const tslib_1 = require("tslib");
5
- const class_validator_1 = require("class-validator");
6
- const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
7
- function IsDayjs(validationOptions) {
8
- return function (object, propertyName) {
9
- (0, class_validator_1.registerDecorator)({
10
- name: 'isDayjs',
11
- target: object.constructor,
12
- propertyName: propertyName,
13
- options: validationOptions,
14
- validator: {
15
- validate(value, args) {
16
- return dayjs_1.default.isDayjs(value);
17
- }
18
- }
19
- });
20
- };
21
- }
22
- //# sourceMappingURL=class-validators.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"class-validators.js","sourceRoot":"","sources":["../../../../../packages/@nx-ddd/core/src/util/class-validators.ts"],"names":[],"mappings":";;AAGA,0BAcC;;AAjBD,qDAA4F;AAC5F,0DAA0B;AAE1B,SAAgB,OAAO,CAAC,iBAAqC;IAC3D,OAAO,UAAU,MAAc,EAAE,YAAoB;QACnD,IAAA,mCAAiB,EAAC;YAChB,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,iBAAiB;YAC1B,SAAS,EAAE;gBACT,QAAQ,CAAC,KAAU,EAAE,IAAyB;oBAC5C,OAAO,eAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC9B,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
package/util/empty.js DELETED
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EMPTY_ARRAY = exports.EMPTY_OBJ = void 0;
4
- exports.EMPTY_OBJ = {};
5
- exports.EMPTY_ARRAY = [];
6
- //# sourceMappingURL=empty.js.map
package/util/empty.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"empty.js","sourceRoot":"","sources":["../../../../../packages/@nx-ddd/core/src/util/empty.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAO,EAAE,CAAC;AACnB,QAAA,WAAW,GAAU,EAAE,CAAC"}
package/util/index.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./plain-to-instance-with-valid"), exports);
5
- //# sourceMappingURL=index.js.map
package/util/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/@nx-ddd/core/src/util/index.ts"],"names":[],"mappings":";;;AAAA,yEAA+C"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.plainToInstanceWithValid = plainToInstanceWithValid;
4
- exports.plainToInstance = plainToInstance;
5
- const class_transformer_1 = require("class-transformer");
6
- const class_validator_1 = require("class-validator");
7
- const walk_obj_1 = require("./walk-obj");
8
- function plainToInstanceWithValid(cls, plain) {
9
- const instance = plainToInstance(cls, plain);
10
- const errors = (0, class_validator_1.validateSync)(instance);
11
- if (errors.length)
12
- throw errors;
13
- return instance;
14
- }
15
- function plainToInstance(cls, plain) {
16
- return (0, class_transformer_1.plainToInstance)(cls, (0, walk_obj_1.reconstructAsISOString)(plain));
17
- }
18
- //# sourceMappingURL=plain-to-instance-with-valid.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plain-to-instance-with-valid.js","sourceRoot":"","sources":["../../../../../packages/@nx-ddd/core/src/util/plain-to-instance-with-valid.ts"],"names":[],"mappings":";;AAIA,4DAKC;AAED,0CAEC;AAbD,yDAA0F;AAC1F,qDAA+C;AAC/C,yCAAoD;AAEpD,SAAgB,wBAAwB,CAAmB,GAAwB,EAAE,KAAa;IAC9F,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,IAAA,8BAAY,EAAC,QAAQ,CAAC,CAAC;IACtC,IAAI,MAAM,CAAC,MAAM;QAAE,MAAM,MAAM,CAAC;IAChC,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED,SAAgB,eAAe,CAAmB,GAAwB,EAAE,KAAa;IACrF,OAAO,IAAA,mCAAgB,EAAC,GAAG,EAAE,IAAA,iCAAsB,EAAC,KAAK,CAAC,CAAC,CAAC;AAChE,CAAC"}
package/util/property.js DELETED
@@ -1,33 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.getClosureSafeProperty = getClosureSafeProperty;
11
- exports.fillProperties = fillProperties;
12
- function getClosureSafeProperty(objWithPropertyToExtract) {
13
- for (const key in objWithPropertyToExtract) {
14
- if (objWithPropertyToExtract[key] === getClosureSafeProperty) {
15
- return key;
16
- }
17
- }
18
- throw Error('Could not find renamed property on target object.');
19
- }
20
- /**
21
- * Sets properties on a target object from a source object, but only if
22
- * the property doesn't already exist on the target object.
23
- * @param target The target to set properties on
24
- * @param source The source of the property keys and values to set
25
- */
26
- function fillProperties(target, source) {
27
- for (const key in source) {
28
- if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {
29
- target[key] = source[key];
30
- }
31
- }
32
- }
33
- //# sourceMappingURL=property.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"property.js","sourceRoot":"","sources":["../../../../../packages/@nx-ddd/core/src/util/property.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,wDAOC;AAQD,wCAMC;AArBD,SAAgB,sBAAsB,CAAI,wBAA2B;IACnE,KAAK,MAAM,GAAG,IAAI,wBAAwB,EAAE,CAAC;QAC3C,IAAI,wBAAwB,CAAC,GAAG,CAAC,KAAK,sBAA6B,EAAE,CAAC;YACpE,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC;IACD,MAAM,KAAK,CAAC,mDAAmD,CAAC,CAAC;AACnE,CAAC;AAED;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,MAA+B,EAAE,MAA+B;IAC7F,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9D,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;AACH,CAAC"}
package/util/stringify.js DELETED
@@ -1,48 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.stringify = stringify;
11
- exports.concatStringsWithSpace = concatStringsWithSpace;
12
- function stringify(token) {
13
- if (typeof token === 'string') {
14
- return token;
15
- }
16
- if (Array.isArray(token)) {
17
- return '[' + token.map(stringify).join(', ') + ']';
18
- }
19
- if (token == null) {
20
- return '' + token;
21
- }
22
- if (token.overriddenName) {
23
- return `${token.overriddenName}`;
24
- }
25
- if (token.name) {
26
- return `${token.name}`;
27
- }
28
- const res = token.toString();
29
- if (res == null) {
30
- return '' + res;
31
- }
32
- const newLineIndex = res.indexOf('\n');
33
- return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
34
- }
35
- /**
36
- * Concatenates two strings with separator, allocating new strings only when necessary.
37
- *
38
- * @param before before string.
39
- * @param separator separator string.
40
- * @param after after string.
41
- * @returns concatenated string.
42
- */
43
- function concatStringsWithSpace(before, after) {
44
- return (before == null || before === '') ?
45
- (after === null ? '' : after) :
46
- ((after == null || after === '') ? before : before + ' ' + after);
47
- }
48
- //# sourceMappingURL=stringify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stringify.js","sourceRoot":"","sources":["../../../../../packages/@nx-ddd/core/src/util/stringify.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEF,8BA6BA;AAUD,wDAIC;AA3CA,SAAgB,SAAS,CAAC,KAAU;IACnC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK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C;AACxE,CAAC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./walk-obj"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/@nx-ddd/core/src/util/walk-obj/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"}
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.walkObj = walkObj;
4
- exports.reconstruct = reconstruct;
5
- exports.reconstructAsISOString = reconstructAsISOString;
6
- exports.flattenExcludeDayjs = flattenExcludeDayjs;
7
- const tslib_1 = require("tslib");
8
- const lodash_es_1 = require("lodash-es");
9
- const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
10
- function walkObj(obj, options, paths = []) {
11
- // callbackの結果がfalseのときは再帰を止める
12
- const [stop, _value] = options.overwrite(paths, obj);
13
- if (stop)
14
- return options.callback(paths, _value);
15
- if (obj instanceof Array) {
16
- obj.forEach((item, index) => walkObj(item, options, [...paths, index.toString()]));
17
- }
18
- else if (obj instanceof Object) {
19
- Object.entries(obj).forEach(([key, value]) => walkObj(value, options, [...paths, key]));
20
- }
21
- else if (obj instanceof Function) {
22
- // 何もしない
23
- }
24
- else {
25
- options.callback(paths, obj);
26
- }
27
- }
28
- function reconstruct(obj, overwrite = () => [false]) {
29
- const newObj = {};
30
- walkObj(obj, {
31
- callback: (paths, value) => {
32
- if (typeof value === 'undefined')
33
- return;
34
- (0, lodash_es_1.set)(newObj, paths.join('.'), value);
35
- },
36
- overwrite,
37
- });
38
- return newObj;
39
- }
40
- function reconstructAsISOString(obj) {
41
- return reconstruct(obj, (paths, value) => {
42
- if (dayjs_1.default.isDayjs(value)) {
43
- if (value.isValid())
44
- return [true, value.toISOString()];
45
- return [true, null];
46
- }
47
- return [false];
48
- });
49
- }
50
- function flattenExcludeDayjs(obj) {
51
- const newObj = {};
52
- walkObj(obj, {
53
- callback: (paths, value) => {
54
- if (typeof value === 'undefined')
55
- return;
56
- newObj[paths.join('.')] = value;
57
- },
58
- overwrite: (paths, value) => {
59
- if (dayjs_1.default.isDayjs(value)) {
60
- if (!value.isValid()) {
61
- return [true, null];
62
- }
63
- return [true, value.toISOString()];
64
- }
65
- return [false];
66
- },
67
- });
68
- return newObj;
69
- }
70
- //# sourceMappingURL=walk-obj.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"walk-obj.js","sourceRoot":"","sources":["../../../../../../packages/@nx-ddd/core/src/util/walk-obj/walk-obj.ts"],"names":[],"mappings":";;AAKA,0BAiBC;AAED,kCAUC;AAMD,wDAQC;AAMD,kDAkBC;;AAxED,yCAAgC;AAChC,0DAA0B;AAI1B,SAAgB,OAAO,CAAI,GAAM,EAAE,OAGlC,EAAE,QAAkB,EAAE;IACrB,8BAA8B;IAC9B,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACrD,IAAI,IAAI;QAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEjD,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;QACzB,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;IACrF,CAAC;SAAM,IAAI,GAAG,YAAY,MAAM,EAAE,CAAC;QACjC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,GAAG,KAAK,EAAE,GAAG,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ACzC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAClC,CAAC;QACD,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAC1B,IAAI,eAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;oBACrB,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBACtB,CAAC;gBACD,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;YACrC,CAAC;YACD,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,MAAgC,CAAC;AAC1C,CAAC"}
package/v2.js DELETED
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommonModule = exports.ExampleService = void 0;
4
- exports.bootstrapServer = bootstrapServer;
5
- exports.bootstrap = bootstrap;
6
- exports.ngBootstrap = ngBootstrap;
7
- const tslib_1 = require("tslib");
8
- const core_1 = require("@angular/core");
9
- const platform_server_1 = require("@angular/platform-server");
10
- let ExampleService = class ExampleService {
11
- hello() {
12
- console.debug('hello');
13
- }
14
- };
15
- exports.ExampleService = ExampleService;
16
- exports.ExampleService = ExampleService = tslib_1.__decorate([
17
- (0, core_1.Injectable)({ providedIn: 'root' })
18
- ], ExampleService);
19
- let CommonModule = class CommonModule {
20
- constructor() {
21
- this.service = (0, core_1.inject)(ExampleService);
22
- }
23
- ngDoBootstrap() {
24
- this.service.hello();
25
- }
26
- };
27
- exports.CommonModule = CommonModule;
28
- exports.CommonModule = CommonModule = tslib_1.__decorate([
29
- (0, core_1.NgModule)({ imports: [platform_server_1.ServerModule] })
30
- ], CommonModule);
31
- function bootstrapServer(moduleType_1) {
32
- return tslib_1.__awaiter(this, arguments, void 0, function* (moduleType, providers = []) {
33
- return (0, platform_server_1.platformServer)(providers).bootstrapModule(moduleType, { ngZone: 'noop' });
34
- });
35
- }
36
- function bootstrap(providers = []) {
37
- return ngBootstrap(providers);
38
- }
39
- function ngBootstrap(providers = []) {
40
- return new Promise((resolve) => {
41
- let AppModule = class AppModule {
42
- constructor() {
43
- this.injector = (0, core_1.inject)(core_1.Injector);
44
- }
45
- ngDoBootstrap() {
46
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
47
- resolve(this.injector);
48
- });
49
- }
50
- };
51
- AppModule = tslib_1.__decorate([
52
- (0, core_1.NgModule)({
53
- imports: [
54
- platform_server_1.ServerModule,
55
- ],
56
- providers: providers,
57
- })
58
- ], AppModule);
59
- bootstrapServer(AppModule);
60
- });
61
- }
62
- //# sourceMappingURL=v2.js.map
package/v2.js.map DELETED
@@ -1 +0,0 @@
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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