json-fetcher
Advanced tools
Comparing version 1.0.1 to 1.0.2
import { qs } from 'qs'; | ||
const copy = (obj) => { | ||
let newObj; | ||
if(obj.prototype) { | ||
newObj = Object.create(obj.prototype) | ||
} else { | ||
newObj = {}; | ||
} | ||
Object.keys(obj).forEach(key => { | ||
if(obj instanceof Object) { | ||
newObj[key] = copy(obj[key]); | ||
} else { | ||
newObj[key] = obj[key]; | ||
} | ||
}); | ||
return newObj; | ||
return JSON.parse(JSON.stringify(obj)); | ||
} | ||
@@ -19,0 +5,0 @@ |
{ | ||
"name": "json-fetcher", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
64916
133