diff --git a/src/util/OrmUtils.ts b/src/util/OrmUtils.ts index 3d9e2cccc9..87aad7ea68 100644 --- a/src/util/OrmUtils.ts +++ b/src/util/OrmUtils.ts @@ -1,4 +1,5 @@ import { ObjectLiteral } from "../common/ObjectLiteral"; +import { URL } from "url"; export class OrmUtils { @@ -82,7 +83,8 @@ export class OrmUtils { && !(value instanceof Set) && !(value instanceof Date) && !(value instanceof Buffer) - && !(value instanceof RegExp)) { + && !(value instanceof RegExp) + && !(value instanceof URL)) { if (!target[key]) Object.assign(target, { [key]: Object.create(Object.getPrototypeOf(value)) }); this.mergeDeep(target[key], value); @@ -192,7 +194,8 @@ export class OrmUtils { (x instanceof Date && y instanceof Date) || (x instanceof RegExp && y instanceof RegExp) || (x instanceof String && y instanceof String) || - (x instanceof Number && y instanceof Number)) + (x instanceof Number && y instanceof Number) || + (x instanceof URL && y instanceof URL)) return x.toString() === y.toString(); // At last checking prototypes as good as we can