Updated the files.
This commit is contained in:
parent
1553e6b971
commit
753967d4f5
23418 changed files with 3784666 additions and 0 deletions
1
my-app/node_modules/klona/full/index.d.ts
generated
vendored
Executable file
1
my-app/node_modules/klona/full/index.d.ts
generated
vendored
Executable file
|
@ -0,0 +1 @@
|
|||
export function klona<T>(input: T): T;
|
55
my-app/node_modules/klona/full/index.js
generated
vendored
Executable file
55
my-app/node_modules/klona/full/index.js
generated
vendored
Executable file
|
@ -0,0 +1,55 @@
|
|||
function set(obj, key, val) {
|
||||
if (typeof val.value === 'object') val.value = klona(val.value);
|
||||
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {
|
||||
Object.defineProperty(obj, key, val);
|
||||
} else obj[key] = val.value;
|
||||
}
|
||||
|
||||
function klona(x) {
|
||||
if (typeof x !== 'object') return x;
|
||||
|
||||
var i=0, k, list, tmp, str=Object.prototype.toString.call(x);
|
||||
|
||||
if (str === '[object Object]') {
|
||||
tmp = Object.create(x.__proto__ || null);
|
||||
} else if (str === '[object Array]') {
|
||||
tmp = Array(x.length);
|
||||
} else if (str === '[object Set]') {
|
||||
tmp = new Set;
|
||||
x.forEach(function (val) {
|
||||
tmp.add(klona(val));
|
||||
});
|
||||
} else if (str === '[object Map]') {
|
||||
tmp = new Map;
|
||||
x.forEach(function (val, key) {
|
||||
tmp.set(klona(key), klona(val));
|
||||
});
|
||||
} else if (str === '[object Date]') {
|
||||
tmp = new Date(+x);
|
||||
} else if (str === '[object RegExp]') {
|
||||
tmp = new RegExp(x.source, x.flags);
|
||||
} else if (str === '[object DataView]') {
|
||||
tmp = new x.constructor( klona(x.buffer) );
|
||||
} else if (str === '[object ArrayBuffer]') {
|
||||
tmp = x.slice(0);
|
||||
} else if (str.slice(-6) === 'Array]') {
|
||||
// ArrayBuffer.isView(x)
|
||||
// ~> `new` bcuz `Buffer.slice` => ref
|
||||
tmp = new x.constructor(x);
|
||||
}
|
||||
|
||||
if (tmp) {
|
||||
for (list=Object.getOwnPropertySymbols(x); i < list.length; i++) {
|
||||
set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
|
||||
}
|
||||
|
||||
for (i=0, list=Object.getOwnPropertyNames(x); i < list.length; i++) {
|
||||
if (Object.hasOwnProperty.call(tmp, k=list[i]) && tmp[k] === x[k]) continue;
|
||||
set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
|
||||
}
|
||||
}
|
||||
|
||||
return tmp || x;
|
||||
}
|
||||
|
||||
exports.klona = klona;
|
1
my-app/node_modules/klona/full/index.min.js
generated
vendored
Executable file
1
my-app/node_modules/klona/full/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){function t(e,t,r){"object"==typeof r.value&&(r.value=o(r.value)),r.enumerable&&!r.get&&!r.set&&r.configurable&&r.writable&&"__proto__"!==t?e[t]=r.value:Object.defineProperty(e,t,r)}function o(e){if("object"!=typeof e)return e;var r,n,c,a=0,f=Object.prototype.toString.call(e);if("[object Object]"===f?c=Object.create(e.__proto__||null):"[object Array]"===f?c=Array(e.length):"[object Set]"===f?(c=new Set,e.forEach((function(e){c.add(o(e))}))):"[object Map]"===f?(c=new Map,e.forEach((function(e,t){c.set(o(t),o(e))}))):"[object Date]"===f?c=new Date(+e):"[object RegExp]"===f?c=new RegExp(e.source,e.flags):"[object DataView]"===f?c=new e.constructor(o(e.buffer)):"[object ArrayBuffer]"===f?c=e.slice(0):"Array]"===f.slice(-6)&&(c=new e.constructor(e)),c){for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t(c,n[a],Object.getOwnPropertyDescriptor(e,n[a]));for(a=0,n=Object.getOwnPropertyNames(e);a<n.length;a++)Object.hasOwnProperty.call(c,r=n[a])&&c[r]===e[r]||t(c,r,Object.getOwnPropertyDescriptor(e,r))}return c||e}e.klona=o}));
|
53
my-app/node_modules/klona/full/index.mjs
generated
vendored
Executable file
53
my-app/node_modules/klona/full/index.mjs
generated
vendored
Executable file
|
@ -0,0 +1,53 @@
|
|||
function set(obj, key, val) {
|
||||
if (typeof val.value === 'object') val.value = klona(val.value);
|
||||
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {
|
||||
Object.defineProperty(obj, key, val);
|
||||
} else obj[key] = val.value;
|
||||
}
|
||||
|
||||
export function klona(x) {
|
||||
if (typeof x !== 'object') return x;
|
||||
|
||||
var i=0, k, list, tmp, str=Object.prototype.toString.call(x);
|
||||
|
||||
if (str === '[object Object]') {
|
||||
tmp = Object.create(x.__proto__ || null);
|
||||
} else if (str === '[object Array]') {
|
||||
tmp = Array(x.length);
|
||||
} else if (str === '[object Set]') {
|
||||
tmp = new Set;
|
||||
x.forEach(function (val) {
|
||||
tmp.add(klona(val));
|
||||
});
|
||||
} else if (str === '[object Map]') {
|
||||
tmp = new Map;
|
||||
x.forEach(function (val, key) {
|
||||
tmp.set(klona(key), klona(val));
|
||||
});
|
||||
} else if (str === '[object Date]') {
|
||||
tmp = new Date(+x);
|
||||
} else if (str === '[object RegExp]') {
|
||||
tmp = new RegExp(x.source, x.flags);
|
||||
} else if (str === '[object DataView]') {
|
||||
tmp = new x.constructor( klona(x.buffer) );
|
||||
} else if (str === '[object ArrayBuffer]') {
|
||||
tmp = x.slice(0);
|
||||
} else if (str.slice(-6) === 'Array]') {
|
||||
// ArrayBuffer.isView(x)
|
||||
// ~> `new` bcuz `Buffer.slice` => ref
|
||||
tmp = new x.constructor(x);
|
||||
}
|
||||
|
||||
if (tmp) {
|
||||
for (list=Object.getOwnPropertySymbols(x); i < list.length; i++) {
|
||||
set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
|
||||
}
|
||||
|
||||
for (i=0, list=Object.getOwnPropertyNames(x); i < list.length; i++) {
|
||||
if (Object.hasOwnProperty.call(tmp, k=list[i]) && tmp[k] === x[k]) continue;
|
||||
set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
|
||||
}
|
||||
}
|
||||
|
||||
return tmp || x;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue