Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected transform(dto: any, data: any) {
if (!isObject(data) || isFalse(dto)) {
return data;
}
if (!isFunction(dto)) {
return data.constructor !== Object ? classToPlain(data) : data;
}
return data instanceof dto
? classToPlain(data)
: classToPlain(classToPlainFromExist(data, new dto()));
}