UNPKG

@nestjs/core

Version:

The core of NestJS, a TypeScript framework for Node.js backends: modules, dependency injection and the request pipeline, on Express, Fastify or node:http.

12 lines (11 loc) • 387 B
/** * Similar to `Object.assign` but copying properties descriptors from `source` * as well. */ export function assignToObject(target, source) { Object.defineProperties(target, Object.keys(source).reduce((descriptors, key) => { descriptors[key] = Object.getOwnPropertyDescriptor(source, key); return descriptors; }, Object.create(null))); return target; }