plain-object-clone
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -1,2 +0,2 @@ | ||
declare function clone(object: any, base?: {}): {}; | ||
declare function clone(object: any, base?: any): any; | ||
declare const _default: typeof clone & { | ||
@@ -3,0 +3,0 @@ default: typeof clone; |
"use strict"; | ||
/* CLONE */ | ||
function clone(object, base) { | ||
if (base === void 0) { base = {}; } | ||
if (base === void 0) { base = object.constructor(); } | ||
for (var key in object) { | ||
@@ -6,0 +6,0 @@ var value = object[key]; |
{ | ||
"name": "plain-object-clone", | ||
"description": "Extremely fast function optimized for deep cloning json-serializable plain objects.", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "types": "dist/index.d.ts", |
/* CLONE */ | ||
function clone ( object, base = {} ) { | ||
function clone ( object, base = object.constructor () ) { | ||
@@ -6,0 +6,0 @@ for ( const key in object ) { |
6008