mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-02 22:22:19 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
1
web/node_modules/klona/lite/index.d.ts
generated
vendored
Normal file
1
web/node_modules/klona/lite/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export function klona<T>(input: T): T;
|
53
web/node_modules/klona/lite/index.js
generated
vendored
Normal file
53
web/node_modules/klona/lite/index.js
generated
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
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 (tmp.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 Date]') {
|
||||
return new Date(+x);
|
||||
}
|
||||
|
||||
if (str === '[object RegExp]') {
|
||||
tmp = new RegExp(x.source, x.flags);
|
||||
tmp.lastIndex = x.lastIndex;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
exports.klona = klona;
|
1
web/node_modules/klona/lite/index.min.js
generated
vendored
Normal file
1
web/node_modules/klona/lite/index.min.js
generated
vendored
Normal 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,n,r=Object.prototype.toString.call(t);if("[object Object]"===r){if(t.constructor!==Object&&"function"==typeof t.constructor)for(o in n=new t.constructor,t)n.hasOwnProperty(o)&&n[o]!==t[o]&&(n[o]=e(t[o]));else for(o in n={},t)"__proto__"===o?Object.defineProperty(n,o,{value:e(t[o]),configurable:!0,enumerable:!0,writable:!0}):n[o]=e(t[o]);return n}if("[object Array]"===r){for(o=t.length,n=Array(o);o--;)n[o]=e(t[o]);return n}return"[object Date]"===r?new Date(+t):"[object RegExp]"===r?((n=new RegExp(t.source,t.flags)).lastIndex=t.lastIndex,n):t}}));
|
51
web/node_modules/klona/lite/index.mjs
generated
vendored
Normal file
51
web/node_modules/klona/lite/index.mjs
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
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 (tmp.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 Date]') {
|
||||
return new Date(+x);
|
||||
}
|
||||
|
||||
if (str === '[object RegExp]') {
|
||||
tmp = new RegExp(x.source, x.flags);
|
||||
tmp.lastIndex = x.lastIndex;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue