MCPcopy
hub / github.com/nestjs/nest / applyProperties

Method applyProperties

packages/core/injector/injector.ts:837–847  ·  view source on GitHub ↗
(
    instance: T,
    properties: PropertyDependency[],
  )

Source from the content-addressed store, hash-verified

835 }
836
837 public applyProperties<T = any>(
838 instance: T,
839 properties: PropertyDependency[],
840 ): void {
841 if (!isObject(instance)) {
842 return undefined;
843 }
844 iterate(properties)
845 .filter(item => !isNil(item.instance))
846 .forEach(item => (instance[item.key] = item.instance));
847 }
848
849 public async instantiateClass<T = any>(
850 instances: any[],

Callers 3

callbackMethod · 0.95
callbackFunction · 0.80
injector.spec.tsFile · 0.80

Calls 2

isObjectFunction · 0.90
isNilFunction · 0.90

Tested by

no test coverage detected