Updated the files.
This commit is contained in:
parent
1553e6b971
commit
753967d4f5
23418 changed files with 3784666 additions and 0 deletions
83
my-app/node_modules/klona/dist/index.js
generated
vendored
Executable file
83
my-app/node_modules/klona/dist/index.js
generated
vendored
Executable file
|
@ -0,0 +1,83 @@
|
|||
function klona(x) {
|
||||
if (typeof x !== 'object') return x;
|
||||
|
||||
var k, tmp, str=Object.prototype.toString.call(x);
|
||||
|
||||
if (str === '[object Object]') {
|
||||
if (x.constructor !== Object && typeof x.constructor === 'function') {
|
||||
tmp = new x.constructor();
|
||||
for (k in x) {
|
||||
if (x.hasOwnProperty(k) && tmp[k] !== x[k]) {
|
||||
tmp[k] = klona(x[k]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tmp = {}; // null
|
||||
for (k in x) {
|
||||
if (k === '__proto__') {
|
||||
Object.defineProperty(tmp, k, {
|
||||
value: klona(x[k]),
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
});
|
||||
} else {
|
||||
tmp[k] = klona(x[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
if (str === '[object Array]') {
|
||||
k = x.length;
|
||||
for (tmp=Array(k); k--;) {
|
||||
tmp[k] = klona(x[k]);
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
if (str === '[object Set]') {
|
||||
tmp = new Set;
|
||||
x.forEach(function (val) {
|
||||
tmp.add(klona(val));
|
||||
});
|
||||
return tmp;
|
||||
}
|
||||
|
||||
if (str === '[object Map]') {
|
||||
tmp = new Map;
|
||||
x.forEach(function (val, key) {
|
||||
tmp.set(klona(key), klona(val));
|
||||
});
|
||||
return tmp;
|
||||
}
|
||||
|
||||
if (str === '[object Date]') {
|
||||
return new Date(+x);
|
||||
}
|
||||
|
||||
if (str === '[object RegExp]') {
|
||||
tmp = new RegExp(x.source, x.flags);
|
||||
tmp.lastIndex = x.lastIndex;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
if (str === '[object DataView]') {
|
||||
return new x.constructor( klona(x.buffer) );
|
||||
}
|
||||
|
||||
if (str === '[object ArrayBuffer]') {
|
||||
return x.slice(0);
|
||||
}
|
||||
|
||||
// ArrayBuffer.isView(x)
|
||||
// ~> `new` bcuz `Buffer.slice` => ref
|
||||
if (str.slice(-6) === 'Array]') {
|
||||
return new x.constructor(x);
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
exports.klona = klona;
|
1
my-app/node_modules/klona/dist/index.min.js
generated
vendored
Executable file
1
my-app/node_modules/klona/dist/index.min.js
generated
vendored
Executable file
|
@ -0,0 +1 @@
|
|||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.klona={})}(this,(function(e){e.klona=function e(t){if("object"!=typeof t)return t;var o,r,n=Object.prototype.toString.call(t);if("[object Object]"===n){if(t.constructor!==Object&&"function"==typeof t.constructor)for(o in r=new t.constructor,t)t.hasOwnProperty(o)&&r[o]!==t[o]&&(r[o]=e(t[o]));else for(o in r={},t)"__proto__"===o?Object.defineProperty(r,o,{value:e(t[o]),configurable:!0,enumerable:!0,writable:!0}):r[o]=e(t[o]);return r}if("[object Array]"===n){for(o=t.length,r=Array(o);o--;)r[o]=e(t[o]);return r}return"[object Set]"===n?(r=new Set,t.forEach((function(t){r.add(e(t))})),r):"[object Map]"===n?(r=new Map,t.forEach((function(t,o){r.set(e(o),e(t))})),r):"[object Date]"===n?new Date(+t):"[object RegExp]"===n?((r=new RegExp(t.source,t.flags)).lastIndex=t.lastIndex,r):"[object DataView]"===n?new t.constructor(e(t.buffer)):"[object ArrayBuffer]"===n?t.slice(0):"Array]"===n.slice(-6)?new t.constructor(t):t}}));
|
81
my-app/node_modules/klona/dist/index.mjs
generated
vendored
Executable file
81
my-app/node_modules/klona/dist/index.mjs
generated
vendored
Executable file
|
@ -0,0 +1,81 @@
|
|||
export function klona(x) {
|
||||
if (typeof x !== 'object') return x;
|
||||
|
||||
var k, tmp, str=Object.prototype.toString.call(x);
|
||||
|
||||
if (str === '[object Object]') {
|
||||
if (x.constructor !== Object && typeof x.constructor === 'function') {
|
||||
tmp = new x.constructor();
|
||||
for (k in x) {
|
||||
if (x.hasOwnProperty(k) && tmp[k] !== x[k]) {
|
||||
tmp[k] = klona(x[k]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tmp = {}; // null
|
||||
for (k in x) {
|
||||
if (k === '__proto__') {
|
||||
Object.defineProperty(tmp, k, {
|
||||
value: klona(x[k]),
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
});
|
||||
} else {
|
||||
tmp[k] = klona(x[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
if (str === '[object Array]') {
|
||||
k = x.length;
|
||||
for (tmp=Array(k); k--;) {
|
||||
tmp[k] = klona(x[k]);
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
if (str === '[object Set]') {
|
||||
tmp = new Set;
|
||||
x.forEach(function (val) {
|
||||
tmp.add(klona(val));
|
||||
});
|
||||
return tmp;
|
||||
}
|
||||
|
||||
if (str === '[object Map]') {
|
||||
tmp = new Map;
|
||||
x.forEach(function (val, key) {
|
||||
tmp.set(klona(key), klona(val));
|
||||
});
|
||||
return tmp;
|
||||
}
|
||||
|
||||
if (str === '[object Date]') {
|
||||
return new Date(+x);
|
||||
}
|
||||
|
||||
if (str === '[object RegExp]') {
|
||||
tmp = new RegExp(x.source, x.flags);
|
||||
tmp.lastIndex = x.lastIndex;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
if (str === '[object DataView]') {
|
||||
return new x.constructor( klona(x.buffer) );
|
||||
}
|
||||
|
||||
if (str === '[object ArrayBuffer]') {
|
||||
return x.slice(0);
|
||||
}
|
||||
|
||||
// ArrayBuffer.isView(x)
|
||||
// ~> `new` bcuz `Buffer.slice` => ref
|
||||
if (str.slice(-6) === 'Array]') {
|
||||
return new x.constructor(x);
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue