mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-16 21:11:52 +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
10
web/node_modules/es5-ext/array/#/concat/implement.js
generated
vendored
Normal file
10
web/node_modules/es5-ext/array/#/concat/implement.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(Array.prototype, "concat", {
|
||||
value: require("./shim"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
3
web/node_modules/es5-ext/array/#/concat/index.js
generated
vendored
Normal file
3
web/node_modules/es5-ext/array/#/concat/index.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? Array.prototype.concat : require("./shim");
|
5
web/node_modules/es5-ext/array/#/concat/is-implemented.js
generated
vendored
Normal file
5
web/node_modules/es5-ext/array/#/concat/is-implemented.js
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
var SubArray = require("../../_sub-array-dummy-safe");
|
||||
|
||||
module.exports = function () { return new SubArray().concat("foo") instanceof SubArray; };
|
44
web/node_modules/es5-ext/array/#/concat/shim.js
generated
vendored
Normal file
44
web/node_modules/es5-ext/array/#/concat/shim.js
generated
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
"use strict";
|
||||
|
||||
var isPlainArray = require("../../is-plain-array")
|
||||
, toPosInt = require("../../../number/to-pos-integer")
|
||||
, isObject = require("../../../object/is-object")
|
||||
, isConcatSpreadable = require("es6-symbol").isConcatSpreadable
|
||||
, isArray = Array.isArray
|
||||
, concat = Array.prototype.concat
|
||||
, forEach = Array.prototype.forEach
|
||||
, isSpreadable;
|
||||
|
||||
isSpreadable = function (value) {
|
||||
if (!value) return false;
|
||||
if (!isObject(value)) return false;
|
||||
if (value[isConcatSpreadable] !== undefined) {
|
||||
return Boolean(value[isConcatSpreadable]);
|
||||
}
|
||||
return isArray(value);
|
||||
};
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
module.exports = function (item/*, …items*/) {
|
||||
var result;
|
||||
if (!this || !isArray(this) || isPlainArray(this)) {
|
||||
return concat.apply(this, arguments);
|
||||
}
|
||||
result = new this.constructor();
|
||||
if (isSpreadable(this)) {
|
||||
forEach.call(this, function (val, i) { result[i] = val; });
|
||||
} else {
|
||||
result[0] = this;
|
||||
}
|
||||
forEach.call(arguments, function (arg) {
|
||||
var base;
|
||||
if (isSpreadable(arg)) {
|
||||
base = result.length;
|
||||
result.length += toPosInt(arg.length);
|
||||
forEach.call(arg, function (val, i) { result[base + i] = val; });
|
||||
return;
|
||||
}
|
||||
result.push(arg);
|
||||
});
|
||||
return result;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue