@nx-ddd/core 19.51.0 → 19.81.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.
@@ -5,7 +5,6 @@ import { plainToInstance as plainToInstance$1 } from 'class-transformer';
5
5
  import { InjectionToken, inject, makeEnvironmentProviders, ɵINJECTOR_SCOPE as _INJECTOR_SCOPE, provideZonelessChangeDetection, createEnvironmentInjector } from '@angular/core';
6
6
 
7
7
  function walkObj(obj, options, paths = []) {
8
- // callbackの結果がfalseのときは再帰を止める
9
8
  const [stop, _value] = options.overwrite(paths, obj);
10
9
  if (stop)
11
10
  return options.callback(paths, _value);
@@ -16,7 +15,7 @@ function walkObj(obj, options, paths = []) {
16
15
  Object.entries(obj).forEach(([key, value]) => walkObj(value, options, [...paths, key]));
17
16
  }
18
17
  else if (obj instanceof Function) {
19
- // 何もしない
18
+ void 0;
20
19
  }
21
20
  else {
22
21
  options.callback(paths, obj);
@@ -99,13 +98,6 @@ function plainToInstance(cls, plain) {
99
98
  return plainToInstance$1(cls, reconstructAsISOString(plain));
100
99
  }
101
100
 
102
- /**
103
- * @license
104
- * Copyright Google LLC All Rights Reserved.
105
- *
106
- * Use of this source code is governed by an MIT-style license that can be
107
- * found in the LICENSE file at https://angular.io/license
108
- */
109
101
  function getClosureSafeProperty(objWithPropertyToExtract) {
110
102
  for (const key in objWithPropertyToExtract) {
111
103
  if (objWithPropertyToExtract[key] === getClosureSafeProperty) {
@@ -114,12 +106,6 @@ function getClosureSafeProperty(objWithPropertyToExtract) {
114
106
  }
115
107
  throw Error('Could not find renamed property on target object.');
116
108
  }
117
- /**
118
- * Sets properties on a target object from a source object, but only if
119
- * the property doesn't already exist on the target object.
120
- * @param target The target to set properties on
121
- * @param source The source of the property keys and values to set
122
- */
123
109
  function fillProperties(target, source) {
124
110
  for (const key in source) {
125
111
  if (Object.prototype.hasOwnProperty.call(source, key) && !Object.prototype.hasOwnProperty.call(target, key)) {
@@ -128,13 +114,6 @@ function fillProperties(target, source) {
128
114
  }
129
115
  }
130
116
 
131
- /**
132
- * @license
133
- * Copyright Google LLC All Rights Reserved.
134
- *
135
- * Use of this source code is governed by an MIT-style license that can be
136
- * found in the LICENSE file at https://angular.io/license
137
- */
138
117
  function stringify(token) {
139
118
  if (typeof token === 'string') {
140
119
  return token;
@@ -158,14 +137,6 @@ function stringify(token) {
158
137
  const newLineIndex = res.indexOf('\n');
159
138
  return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
160
139
  }
161
- /**
162
- * Concatenates two strings with separator, allocating new strings only when necessary.
163
- *
164
- * @param before before string.
165
- * @param separator separator string.
166
- * @param after after string.
167
- * @returns concatenated string.
168
- */
169
140
  function concatStringsWithSpace(before, after) {
170
141
  return (before == null || before === '') ?
171
142
  (after === null ? '' : after) :
@@ -178,28 +149,12 @@ function makeDecoratorFactories(annotationFactory = (type, fieldName, propName,
178
149
  const props = typeof nameOrProps === 'string' ? { name: nameOrProps } : nameOrProps;
179
150
  return (target, propName) => {
180
151
  const fieldName = props?.name || propName;
181
- // const ANNOTATION: Annotation = {type, fieldName, propName, childType: options.childType};
182
152
  const annotation = annotationFactory(type, fieldName, propName, options);
183
153
  target.constructor[key] ??= [];
184
154
  target.constructor[key].push(annotation);
185
155
  };
186
156
  };
187
157
  }
188
- // function createClassDecorator(
189
- // type: T,
190
- // options: O = {} as O,
191
- // ) {
192
- // return (nameOrProps?: {name?: string} | string) => {
193
- // const props = typeof nameOrProps === 'string' ? {name: nameOrProps} : nameOrProps;
194
- // return (target: any) => {
195
- // const fieldName = props?.name || target.name;
196
- // // const ANNOTATION: Annotation = {type, fieldName, propName: '', childType: options.childType};
197
- // const annotation = annotationFactory(type, fieldName, '', options);
198
- // target[key] ??= [];
199
- // target[key].push(annotation);
200
- // };
201
- // };
202
- // }
203
158
  function addAnnotation(target, annotation) {
204
159
  target[key] ??= [];
205
160
  target[key].push(annotation);
@@ -240,8 +195,6 @@ function bootstrap(providers = []) {
240
195
  }
241
196
  function ngBootstrap(providers = []) {
242
197
  const envProviders = providers.map(p => isEnvironmentProviders(p) ? p : makeEnvironmentProviders([p]));
243
- // INJECTOR_SCOPE を 'root' に設定して providedIn: 'root' のサービスを解決可能にする
244
- // provideZonelessChangeDetection で ChangeDetectionScheduler 等の内部サービスを提供
245
198
  envProviders.push(makeEnvironmentProviders([
246
199
  { provide: _INJECTOR_SCOPE, useValue: 'root' },
247
200
  ]));
@@ -1 +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: Record<string, unknown> = {};\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: Record<string, never> = {};\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 (Object.prototype.hasOwnProperty.call(source, key) && !Object.prototype.hasOwnProperty.call(target, 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 object = 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 createClassDecorator(\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) => {\n // const fieldName = props?.name || target.name;\n // // const ANNOTATION: Annotation = {type, fieldName, propName: '', childType: options.childType};\n // const annotation = annotationFactory(type, fieldName, '', options);\n // target[key] ??= [];\n // target[key].push(annotation);\n // };\n // };\n // }\n\n function addAnnotation(target: any, annotation: Annotation) {\n target[key] ??= [];\n target[key].push(annotation);\n }\n\n function getAnnotations(target: any): Annotation[] {\n return target[key] ?? [];\n }\n\n function createClassDecorator<Props extends { name: string }>(type: string) {\n return (nameOrProps: Props | string) => {\n const props = typeof nameOrProps === 'string' ? { name: nameOrProps } : nameOrProps;\n return (target: any) => {\n const name = props?.name || target.name;\n const annotation = { type, name, props };\n addAnnotation(target, annotation as any);\n };\n };\n }\n\n return {\n createDecorator,\n createPropsDecorator: createDecorator,\n createClassDecorator,\n addAnnotation,\n getAnnotations, \n };\n}\n","import { inject, InjectionToken, InjectOptions } from \"@angular/core\";\n\nexport interface DiToken<T> {\n token: InjectionToken<T>;\n inject: (options?: InjectOptions) => 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: (options?: InjectOptions) => inject(token, options ?? _options) ?? null,\n provide: (useFactory: () => T) => ({ provide: token, useFactory }),\n }\n}\n","import { createEnvironmentInjector, EnvironmentProviders, Injector, makeEnvironmentProviders, Provider, provideZonelessChangeDetection, ɵINJECTOR_SCOPE as INJECTOR_SCOPE } from '@angular/core';\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 const envProviders = providers.map(p =>\n isEnvironmentProviders(p) ? p : makeEnvironmentProviders([p])\n );\n // INJECTOR_SCOPE を 'root' に設定して providedIn: 'root' のサービスを解決可能にする\n // provideZonelessChangeDetection で ChangeDetectionScheduler 等の内部サービスを提供\n envProviders.push(makeEnvironmentProviders([\n { provide: INJECTOR_SCOPE, useValue: 'root' },\n ]));\n envProviders.push(provideZonelessChangeDetection());\n const injector = createEnvironmentInjector(envProviders, null!);\n return Promise.resolve(injector);\n}\n\nfunction isEnvironmentProviders(p: Provider | EnvironmentProviders): p is EnvironmentProviders {\n return 'ɵproviders' in (p as any);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["_plainToInstance","INJECTOR_SCOPE"],"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,EAA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D,IAAA,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;AAClC;AAEA,SAAS,sBAAsB,CAAC,CAAkC,EAAA;IAChE,OAAO,YAAY,IAAK,CAAS;AACnC;;ACtBA;;AAEG;;;;"}
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 \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 void 0;\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: Record<string, unknown> = {};\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: Record<string, never> = {};\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\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\nexport function fillProperties(target: {[key: string]: string}, source: {[key: string]: string}) {\n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key) && !Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = source[key];\n }\n }\n}\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\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 object = 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 \n const annotation = annotationFactory(type, fieldName, propName, options);\n target.constructor[key] ??= [];\n target.constructor[key].push(annotation);\n };\n };\n }\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n function addAnnotation(target: any, annotation: Annotation) {\n target[key] ??= [];\n target[key].push(annotation);\n }\n\n function getAnnotations(target: any): Annotation[] {\n return target[key] ?? [];\n }\n\n function createClassDecorator<Props extends { name: string }>(type: string) {\n return (nameOrProps: Props | string) => {\n const props = typeof nameOrProps === 'string' ? { name: nameOrProps } : nameOrProps;\n return (target: any) => {\n const name = props?.name || target.name;\n const annotation = { type, name, props };\n addAnnotation(target, annotation as any);\n };\n };\n }\n\n return {\n createDecorator,\n createPropsDecorator: createDecorator,\n createClassDecorator,\n addAnnotation,\n getAnnotations, \n };\n}\n","import { inject, InjectionToken, InjectOptions } from \"@angular/core\";\n\nexport interface DiToken<T> {\n token: InjectionToken<T>;\n inject: (options?: InjectOptions) => 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: (options?: InjectOptions) => inject(token, options ?? _options) ?? null,\n provide: (useFactory: () => T) => ({ provide: token, useFactory }),\n }\n}\n","import { createEnvironmentInjector, EnvironmentProviders, Injector, makeEnvironmentProviders, Provider, provideZonelessChangeDetection, ɵINJECTOR_SCOPE as INJECTOR_SCOPE } from '@angular/core';\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 const envProviders = providers.map(p =>\n isEnvironmentProviders(p) ? p : makeEnvironmentProviders([p])\n );\n \n \n envProviders.push(makeEnvironmentProviders([\n { provide: INJECTOR_SCOPE, useValue: 'root' },\n ]));\n envProviders.push(provideZonelessChangeDetection());\n const injector = createEnvironmentInjector(envProviders, null!);\n return Promise.resolve(injector);\n}\n\nfunction isEnvironmentProviders(p: Provider | EnvironmentProviders): p is EnvironmentProviders {\n return 'ɵproviders' in (p as any);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names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AGD,IAAA,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC;AACzC,QAAA,EAAE,OAAO,EAAEC,eAAc,EAAE,QAAQ,EAAE,MAAM,EAAE;AAC9C,KAAA,CAAC,CAAC;AACH,IAAA,YAAY,CAAC,IAAI,CAAC,8BAA8B,EAAE,CAAC;IACnD,MAAM,QAAQ,GAAG,yBAAyB,CAAC,YAAY,EAAE,IAAK,CAAC;AAC/D,IAAA,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;AAClC;AAEA,SAAS,sBAAsB,CAAC,CAAkC,EAAA;IAChE,OAAO,YAAY,IAAK,CAAS;AACnC;;ACtBA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx-ddd/core",
3
- "version": "19.51.0",
3
+ "version": "19.81.0",
4
4
  "license": "MIT",
5
5
  "peerDependencies": {
6
6
  "@angular/core": "19.1.4"
@@ -28,42 +28,14 @@ declare const EMPTY_ARRAY: any[];
28
28
  declare function plainToInstanceWithValid<T extends object>(cls: ClassConstructor<T>, plain: object): T;
29
29
  declare function plainToInstance<T extends object>(cls: ClassConstructor<T>, plain: object): T;
30
30
 
31
- /**
32
- * @license
33
- * Copyright Google LLC All Rights Reserved.
34
- *
35
- * Use of this source code is governed by an MIT-style license that can be
36
- * found in the LICENSE file at https://angular.io/license
37
- */
38
31
  declare function getClosureSafeProperty<T>(objWithPropertyToExtract: T): string;
39
- /**
40
- * Sets properties on a target object from a source object, but only if
41
- * the property doesn't already exist on the target object.
42
- * @param target The target to set properties on
43
- * @param source The source of the property keys and values to set
44
- */
45
32
  declare function fillProperties(target: {
46
33
  [key: string]: string;
47
34
  }, source: {
48
35
  [key: string]: string;
49
36
  }): void;
50
37
 
51
- /**
52
- * @license
53
- * Copyright Google LLC All Rights Reserved.
54
- *
55
- * Use of this source code is governed by an MIT-style license that can be
56
- * found in the LICENSE file at https://angular.io/license
57
- */
58
38
  declare function stringify(token: any): string;
59
- /**
60
- * Concatenates two strings with separator, allocating new strings only when necessary.
61
- *
62
- * @param before before string.
63
- * @param separator separator string.
64
- * @param after after string.
65
- * @returns concatenated string.
66
- */
67
39
  declare function concatStringsWithSpace(before: string | null, after: string | null): string;
68
40
 
69
41
  declare function makeDecoratorFactories<T extends string, Annotation extends object, O extends object = any>(annotationFactory?: (type: T, fieldName: string, propName: string, options: O) => Annotation, key?: string): {
@@ -1 +1 @@
1
- {"version":3,"file":"nx-ddd-core.d.ts","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"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;AAGA;AAEA;AACE;;AAED;AAgBD;AAYA;;;AAIA;AAUA;AACG;;AAGH;;ACtDA;;ACGA;;ACHA;AACA;;ACGA;AAOA;;ACXA;;;;;;AAMG;AAEH;AASA;;;;;AAKG;AACH;AAAwC;AAAsB;AAAW;;;ACvBzE;;;;;;AAMG;AAEF;AA+BD;;;;;;;AAOG;AACH;;AC/CA;;;AAiByC;;;AAAA;AAqCT;;;AATC;;AA2BhC;;ACtEK;AACJ;;AAEA;AACE;;;AAGH;AAED;;ACTA;AAIA;;;"}
1
+ {"version":3,"file":"nx-ddd-core.d.ts","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"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;AAGA;AAEA;AACE;;AAED;AAgBD;AAYA;;;AAIA;AAUA;AACG;;AAGH;;ACtDA;;ACGA;;ACHA;AACA;;ACGA;AAOA;;ACTA;AAUA;AAAwC;AAAsB;AAAW;;;ACVxE;AAgCD;;AClCA;;;AAiByC;;;AAAA;AAqCT;;;AATC;;AA2BhC;;ACtEK;AACJ;;AAEA;AACE;;;AAGH;AAED;;ACTA;AAIA;;;"}