array-slice-x
Advanced tools
Comparing version 2.0.0 to 2.1.0
45
index.js
/** | ||
* @file Cross-browser array slicer. | ||
* @version 2.0.0 | ||
* @version 2.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -18,8 +18,10 @@ * @copyright Xotic750 | ||
var splitString = require('has-boxed-string-x') === false; | ||
var isArguments = require('is-arguments'); | ||
var nativeSlice = Array.prototype.slice; | ||
var setRelative = function _seedRelative(value, length) { | ||
var setRelative = function _setRelative(value, length) { | ||
return value < 0 ? Math.max(length + value, 0) : Math.min(value, length); | ||
}; | ||
var $slice = function slice(array, start, end) { | ||
var internalSlice = function slice(array, start, end) { | ||
var object = toObject(array); | ||
@@ -46,2 +48,39 @@ var iterable = splitString && isString(object) ? object.split('') : object; | ||
var $slice; | ||
try { | ||
$slice = function slice(array, start, end) { | ||
var object = toObject(array); | ||
if (isArguments(object)) { | ||
return internalSlice(object, start, end); | ||
} | ||
var iterable = splitString && isString(object) ? object.split('') : object; | ||
return nativeSlice.apply(iterable, internalSlice(arguments, 1)); | ||
}; | ||
var str = $slice('ab'); | ||
if (str.length !== 2 || str[0] !== 'a' || str[1] !== 'b') { | ||
throw new Error('failed string'); | ||
} | ||
var obj = $slice({ 1: 1, length: 2 }); | ||
if (obj.length !== 2 || isUndefined(obj[0]) === false || 0 in obj || obj[1] !== 1) { | ||
throw new Error('failed object'); | ||
} | ||
var args = (function () { | ||
return arguments; | ||
}(void 0, 2)); | ||
if (args.length !== 2 || isUndefined(args[0]) === false || args[1] !== 2) { | ||
throw new Error('failed arguments'); | ||
} | ||
} catch (ignore) { | ||
// eslint-disable-next-line no-console | ||
console.error(ignore); | ||
$slice = internalSlice; | ||
} | ||
/** | ||
@@ -48,0 +87,0 @@ * The slice() method returns a shallow copy of a portion of an array into a new |
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.returnExports = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | ||
/** | ||
* @file Cross-browser array slicer. | ||
* @version 2.0.0 | ||
* @version 2.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -19,8 +19,10 @@ * @copyright Xotic750 | ||
var splitString = _dereq_('has-boxed-string-x') === false; | ||
var isArguments = _dereq_('is-arguments'); | ||
var nativeSlice = Array.prototype.slice; | ||
var setRelative = function _seedRelative(value, length) { | ||
var setRelative = function _setRelative(value, length) { | ||
return value < 0 ? Math.max(length + value, 0) : Math.min(value, length); | ||
}; | ||
var $slice = function slice(array, start, end) { | ||
var internalSlice = function slice(array, start, end) { | ||
var object = toObject(array); | ||
@@ -47,2 +49,39 @@ var iterable = splitString && isString(object) ? object.split('') : object; | ||
var $slice; | ||
try { | ||
$slice = function slice(array, start, end) { | ||
var object = toObject(array); | ||
if (isArguments(object)) { | ||
return internalSlice(object, start, end); | ||
} | ||
var iterable = splitString && isString(object) ? object.split('') : object; | ||
return nativeSlice.apply(iterable, internalSlice(arguments, 1)); | ||
}; | ||
var str = $slice('ab'); | ||
if (str.length !== 2 || str[0] !== 'a' || str[1] !== 'b') { | ||
throw new Error('failed string'); | ||
} | ||
var obj = $slice({ 1: 1, length: 2 }); | ||
if (obj.length !== 2 || isUndefined(obj[0]) === false || 0 in obj || obj[1] !== 1) { | ||
throw new Error('failed object'); | ||
} | ||
var args = (function () { | ||
return arguments; | ||
}(void 0, 2)); | ||
if (args.length !== 2 || isUndefined(args[0]) === false || args[1] !== 2) { | ||
throw new Error('failed arguments'); | ||
} | ||
} catch (ignore) { | ||
// eslint-disable-next-line no-console | ||
console.error(ignore); | ||
$slice = internalSlice; | ||
} | ||
/** | ||
@@ -80,3 +119,3 @@ * The slice() method returns a shallow copy of a portion of an array into a new | ||
},{"has-boxed-string-x":4,"is-string":11,"to-integer-x":18,"to-length-x":19,"to-object-x":20,"validate.io-undefined":21}],2:[function(_dereq_,module,exports){ | ||
},{"has-boxed-string-x":4,"is-arguments":5,"is-string":12,"to-integer-x":19,"to-length-x":20,"to-object-x":21,"validate.io-undefined":22}],2:[function(_dereq_,module,exports){ | ||
'use strict'; | ||
@@ -139,3 +178,3 @@ | ||
},{"foreach":3,"object-keys":15}],3:[function(_dereq_,module,exports){ | ||
},{"foreach":3,"object-keys":16}],3:[function(_dereq_,module,exports){ | ||
@@ -189,2 +228,31 @@ var hasOwn = Object.prototype.hasOwnProperty; | ||
},{}],5:[function(_dereq_,module,exports){ | ||
'use strict'; | ||
var toStr = Object.prototype.toString; | ||
var isStandardArguments = function isArguments(value) { | ||
return toStr.call(value) === '[object Arguments]'; | ||
}; | ||
var isLegacyArguments = function isArguments(value) { | ||
if (isStandardArguments(value)) { | ||
return true; | ||
} | ||
return value !== null && | ||
typeof value === 'object' && | ||
typeof value.length === 'number' && | ||
value.length >= 0 && | ||
toStr.call(value) !== '[object Array]' && | ||
toStr.call(value.callee) === '[object Function]'; | ||
}; | ||
var supportsStandardArguments = (function () { | ||
return isStandardArguments(arguments); | ||
}()); | ||
isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests | ||
module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments; | ||
},{}],6:[function(_dereq_,module,exports){ | ||
/** | ||
@@ -237,3 +305,3 @@ * @file ES6-compliant shim for Number.isFinite. | ||
},{"is-nan":7,"max-safe-integer":14}],6:[function(_dereq_,module,exports){ | ||
},{"is-nan":8,"max-safe-integer":15}],7:[function(_dereq_,module,exports){ | ||
'use strict'; | ||
@@ -247,3 +315,3 @@ | ||
},{}],7:[function(_dereq_,module,exports){ | ||
},{}],8:[function(_dereq_,module,exports){ | ||
'use strict'; | ||
@@ -267,3 +335,3 @@ | ||
},{"./implementation":6,"./polyfill":8,"./shim":9,"define-properties":2}],8:[function(_dereq_,module,exports){ | ||
},{"./implementation":7,"./polyfill":9,"./shim":10,"define-properties":2}],9:[function(_dereq_,module,exports){ | ||
'use strict'; | ||
@@ -280,3 +348,3 @@ | ||
},{"./implementation":6}],9:[function(_dereq_,module,exports){ | ||
},{"./implementation":7}],10:[function(_dereq_,module,exports){ | ||
'use strict'; | ||
@@ -295,3 +363,3 @@ | ||
},{"./polyfill":8,"define-properties":2}],10:[function(_dereq_,module,exports){ | ||
},{"./polyfill":9,"define-properties":2}],11:[function(_dereq_,module,exports){ | ||
/** | ||
@@ -327,3 +395,3 @@ * @file Checks if `value` is `null` or `undefined`. | ||
},{"lodash.isnull":12,"validate.io-undefined":21}],11:[function(_dereq_,module,exports){ | ||
},{"lodash.isnull":13,"validate.io-undefined":22}],12:[function(_dereq_,module,exports){ | ||
'use strict'; | ||
@@ -350,3 +418,3 @@ | ||
},{}],12:[function(_dereq_,module,exports){ | ||
},{}],13:[function(_dereq_,module,exports){ | ||
/** | ||
@@ -383,3 +451,3 @@ * lodash 3.0.0 (Custom Build) <https://lodash.com/> | ||
},{}],13:[function(_dereq_,module,exports){ | ||
},{}],14:[function(_dereq_,module,exports){ | ||
/** | ||
@@ -437,7 +505,7 @@ * @file ES6-compliant shim for Math.sign. | ||
},{"is-nan":7}],14:[function(_dereq_,module,exports){ | ||
},{"is-nan":8}],15:[function(_dereq_,module,exports){ | ||
'use strict'; | ||
module.exports = 9007199254740991; | ||
},{}],15:[function(_dereq_,module,exports){ | ||
},{}],16:[function(_dereq_,module,exports){ | ||
'use strict'; | ||
@@ -584,3 +652,3 @@ | ||
},{"./isArguments":16}],16:[function(_dereq_,module,exports){ | ||
},{"./isArguments":17}],17:[function(_dereq_,module,exports){ | ||
'use strict'; | ||
@@ -604,3 +672,3 @@ | ||
},{}],17:[function(_dereq_,module,exports){ | ||
},{}],18:[function(_dereq_,module,exports){ | ||
/** | ||
@@ -644,3 +712,3 @@ * @file ES6-compliant shim for RequireObjectCoercible. | ||
},{"is-nil-x":10}],18:[function(_dereq_,module,exports){ | ||
},{"is-nil-x":11}],19:[function(_dereq_,module,exports){ | ||
/** | ||
@@ -688,3 +756,3 @@ * @file ToInteger converts 'argument' to an integral numeric value. | ||
},{"is-finite-x":5,"is-nan":7,"math-sign-x":13}],19:[function(_dereq_,module,exports){ | ||
},{"is-finite-x":6,"is-nan":8,"math-sign-x":14}],20:[function(_dereq_,module,exports){ | ||
/** | ||
@@ -732,3 +800,3 @@ * @file ES6-compliant shim for ToLength. | ||
},{"max-safe-integer":14,"to-integer-x":18}],20:[function(_dereq_,module,exports){ | ||
},{"max-safe-integer":15,"to-integer-x":19}],21:[function(_dereq_,module,exports){ | ||
/** | ||
@@ -768,3 +836,3 @@ * @file ES6-compliant shim for ToObject. | ||
},{"require-object-coercible-x":17}],21:[function(_dereq_,module,exports){ | ||
},{"require-object-coercible-x":18}],22:[function(_dereq_,module,exports){ | ||
/** | ||
@@ -771,0 +839,0 @@ * |
!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).returnExports=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(_dereq_,module,exports){/** | ||
* @file Cross-browser array slicer. | ||
* @version 2.0.0 | ||
* @version 2.1.0 | ||
* @author Xotic750 <Xotic750@gmail.com> | ||
@@ -9,3 +9,3 @@ * @copyright Xotic750 | ||
*/ | ||
"use strict";var toObject=_dereq_("to-object-x"),toInteger=_dereq_("to-integer-x"),toLength=_dereq_("to-length-x"),isUndefined=_dereq_("validate.io-undefined"),isString=_dereq_("is-string"),splitString=!1===_dereq_("has-boxed-string-x"),setRelative=function _seedRelative(value,length){return value<0?Math.max(length+value,0):Math.min(value,length)};module.exports=function slice(array,start,end){var object=toObject(array),iterable=splitString&&isString(object)?object.split(""):object,length=toLength(iterable.length),k=setRelative(toInteger(start),length),relativeEnd=isUndefined(end)?length:toInteger(end),finalEnd=setRelative(relativeEnd,length),val=[];val.length=Math.max(finalEnd-k,0);for(var next=0;k<finalEnd;)k in iterable&&(val[next]=iterable[k]),next+=1,k+=1;return val}},{"has-boxed-string-x":4,"is-string":11,"to-integer-x":18,"to-length-x":19,"to-object-x":20,"validate.io-undefined":21}],2:[function(_dereq_,module,exports){"use strict";var keys=_dereq_("object-keys"),foreach=_dereq_("foreach"),hasSymbols="function"==typeof Symbol&&"symbol"==typeof Symbol(),toStr=Object.prototype.toString,isFunction=function(fn){return"function"==typeof fn&&"[object Function]"===toStr.call(fn)},supportsDescriptors=Object.defineProperty&&function(){var obj={};try{Object.defineProperty(obj,"x",{enumerable:!1,value:obj});for(var _ in obj)return!1;return obj.x===obj}catch(e){return!1}}(),defineProperty=function(object,name,value,predicate){(!(name in object)||isFunction(predicate)&&predicate())&&(supportsDescriptors?Object.defineProperty(object,name,{configurable:!0,enumerable:!1,value:value,writable:!0}):object[name]=value)},defineProperties=function(object,map){var predicates=arguments.length>2?arguments[2]:{},props=keys(map);hasSymbols&&(props=props.concat(Object.getOwnPropertySymbols(map))),foreach(props,function(name){defineProperty(object,name,map[name],predicates[name])})};defineProperties.supportsDescriptors=!!supportsDescriptors,module.exports=defineProperties},{foreach:3,"object-keys":15}],3:[function(_dereq_,module,exports){var hasOwn=Object.prototype.hasOwnProperty,toString=Object.prototype.toString;module.exports=function forEach(obj,fn,ctx){if("[object Function]"!==toString.call(fn))throw new TypeError("iterator must be a function");var l=obj.length;if(l===+l)for(var i=0;i<l;i++)fn.call(ctx,obj[i],i,obj);else for(var k in obj)hasOwn.call(obj,k)&&fn.call(ctx,obj[k],k,obj)}},{}],4:[function(_dereq_,module,exports){/** | ||
"use strict";var $slice,toObject=_dereq_("to-object-x"),toInteger=_dereq_("to-integer-x"),toLength=_dereq_("to-length-x"),isUndefined=_dereq_("validate.io-undefined"),isString=_dereq_("is-string"),splitString=!1===_dereq_("has-boxed-string-x"),isArguments=_dereq_("is-arguments"),nativeSlice=Array.prototype.slice,setRelative=function _setRelative(value,length){return value<0?Math.max(length+value,0):Math.min(value,length)},internalSlice=function slice(array,start,end){var object=toObject(array),iterable=splitString&&isString(object)?object.split(""):object,length=toLength(iterable.length),k=setRelative(toInteger(start),length),relativeEnd=isUndefined(end)?length:toInteger(end),finalEnd=setRelative(relativeEnd,length),val=[];val.length=Math.max(finalEnd-k,0);for(var next=0;k<finalEnd;)k in iterable&&(val[next]=iterable[k]),next+=1,k+=1;return val};try{var str=($slice=function slice(array,start,end){var object=toObject(array);if(isArguments(object))return internalSlice(object,start,end);var iterable=splitString&&isString(object)?object.split(""):object;return nativeSlice.apply(iterable,internalSlice(arguments,1))})("ab");if(2!==str.length||"a"!==str[0]||"b"!==str[1])throw new Error("failed string");var obj=$slice({1:1,length:2});if(2!==obj.length||!1===isUndefined(obj[0])||0 in obj||1!==obj[1])throw new Error("failed object");var args=function(){return arguments}(void 0,2);if(2!==args.length||!1===isUndefined(args[0])||2!==args[1])throw new Error("failed arguments")}catch(ignore){console.error(ignore),$slice=internalSlice}module.exports=$slice},{"has-boxed-string-x":4,"is-arguments":5,"is-string":12,"to-integer-x":19,"to-length-x":20,"to-object-x":21,"validate.io-undefined":22}],2:[function(_dereq_,module,exports){"use strict";var keys=_dereq_("object-keys"),foreach=_dereq_("foreach"),hasSymbols="function"==typeof Symbol&&"symbol"==typeof Symbol(),toStr=Object.prototype.toString,isFunction=function(fn){return"function"==typeof fn&&"[object Function]"===toStr.call(fn)},supportsDescriptors=Object.defineProperty&&function(){var obj={};try{Object.defineProperty(obj,"x",{enumerable:!1,value:obj});for(var _ in obj)return!1;return obj.x===obj}catch(e){return!1}}(),defineProperty=function(object,name,value,predicate){(!(name in object)||isFunction(predicate)&&predicate())&&(supportsDescriptors?Object.defineProperty(object,name,{configurable:!0,enumerable:!1,value:value,writable:!0}):object[name]=value)},defineProperties=function(object,map){var predicates=arguments.length>2?arguments[2]:{},props=keys(map);hasSymbols&&(props=props.concat(Object.getOwnPropertySymbols(map))),foreach(props,function(name){defineProperty(object,name,map[name],predicates[name])})};defineProperties.supportsDescriptors=!!supportsDescriptors,module.exports=defineProperties},{foreach:3,"object-keys":16}],3:[function(_dereq_,module,exports){var hasOwn=Object.prototype.hasOwnProperty,toString=Object.prototype.toString;module.exports=function forEach(obj,fn,ctx){if("[object Function]"!==toString.call(fn))throw new TypeError("iterator must be a function");var l=obj.length;if(l===+l)for(var i=0;i<l;i++)fn.call(ctx,obj[i],i,obj);else for(var k in obj)hasOwn.call(obj,k)&&fn.call(ctx,obj[k],k,obj)}},{}],4:[function(_dereq_,module,exports){/** | ||
* @file Check support of by-index access of string characters. | ||
@@ -18,3 +18,3 @@ * @version 1.0.0 | ||
*/ | ||
"use strict";var boxedString=Object("a");module.exports="a"===boxedString[0]&&0 in boxedString},{}],5:[function(_dereq_,module,exports){/** | ||
"use strict";var boxedString=Object("a");module.exports="a"===boxedString[0]&&0 in boxedString},{}],5:[function(_dereq_,module,exports){"use strict";var toStr=Object.prototype.toString,isStandardArguments=function isArguments(value){return"[object Arguments]"===toStr.call(value)},isLegacyArguments=function isArguments(value){return!!isStandardArguments(value)||null!==value&&"object"==typeof value&&"number"==typeof value.length&&value.length>=0&&"[object Array]"!==toStr.call(value)&&"[object Function]"===toStr.call(value.callee)},supportsStandardArguments=function(){return isStandardArguments(arguments)}();isStandardArguments.isLegacyArguments=isLegacyArguments,module.exports=supportsStandardArguments?isStandardArguments:isLegacyArguments},{}],6:[function(_dereq_,module,exports){/** | ||
* @file ES6-compliant shim for Number.isFinite. | ||
@@ -28,3 +28,3 @@ * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-number.isfinite|20.1.2.2 Number.isFinite ( number )} | ||
*/ | ||
"use strict";var $isFinite,$isNaN=_dereq_("is-nan");if("function"==typeof Number.isFinite){var MAX_SAFE_INTEGER=_dereq_("max-safe-integer");try{Number.isFinite(MAX_SAFE_INTEGER)&&!1===Number.isFinite(Infinity)&&($isFinite=Number.isFinite)}catch(ignore){}}module.exports=$isFinite||function isFinite(number){return!("number"!=typeof number||$isNaN(number)||number===Infinity||number===-Infinity)}},{"is-nan":7,"max-safe-integer":14}],6:[function(_dereq_,module,exports){"use strict";module.exports=function isNaN(value){return value!==value}},{}],7:[function(_dereq_,module,exports){"use strict";var define=_dereq_("define-properties"),implementation=_dereq_("./implementation");define(implementation,{getPolyfill:_dereq_("./polyfill"),implementation:implementation,shim:_dereq_("./shim")}),module.exports=implementation},{"./implementation":6,"./polyfill":8,"./shim":9,"define-properties":2}],8:[function(_dereq_,module,exports){"use strict";var implementation=_dereq_("./implementation");module.exports=function getPolyfill(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:implementation}},{"./implementation":6}],9:[function(_dereq_,module,exports){"use strict";var define=_dereq_("define-properties"),getPolyfill=_dereq_("./polyfill");module.exports=function shimNumberIsNaN(){var polyfill=getPolyfill();return define(Number,{isNaN:polyfill},{isNaN:function(){return Number.isNaN!==polyfill}}),polyfill}},{"./polyfill":8,"define-properties":2}],10:[function(_dereq_,module,exports){/** | ||
"use strict";var $isFinite,$isNaN=_dereq_("is-nan");if("function"==typeof Number.isFinite){var MAX_SAFE_INTEGER=_dereq_("max-safe-integer");try{Number.isFinite(MAX_SAFE_INTEGER)&&!1===Number.isFinite(Infinity)&&($isFinite=Number.isFinite)}catch(ignore){}}module.exports=$isFinite||function isFinite(number){return!("number"!=typeof number||$isNaN(number)||number===Infinity||number===-Infinity)}},{"is-nan":8,"max-safe-integer":15}],7:[function(_dereq_,module,exports){"use strict";module.exports=function isNaN(value){return value!==value}},{}],8:[function(_dereq_,module,exports){"use strict";var define=_dereq_("define-properties"),implementation=_dereq_("./implementation");define(implementation,{getPolyfill:_dereq_("./polyfill"),implementation:implementation,shim:_dereq_("./shim")}),module.exports=implementation},{"./implementation":7,"./polyfill":9,"./shim":10,"define-properties":2}],9:[function(_dereq_,module,exports){"use strict";var implementation=_dereq_("./implementation");module.exports=function getPolyfill(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:implementation}},{"./implementation":7}],10:[function(_dereq_,module,exports){"use strict";var define=_dereq_("define-properties"),getPolyfill=_dereq_("./polyfill");module.exports=function shimNumberIsNaN(){var polyfill=getPolyfill();return define(Number,{isNaN:polyfill},{isNaN:function(){return Number.isNaN!==polyfill}}),polyfill}},{"./polyfill":9,"define-properties":2}],11:[function(_dereq_,module,exports){/** | ||
* @file Checks if `value` is `null` or `undefined`. | ||
@@ -37,3 +37,3 @@ * @version 1.4.0 | ||
*/ | ||
"use strict";var isUndefined=_dereq_("validate.io-undefined"),isNull=_dereq_("lodash.isnull");module.exports=function isNil(value){return isNull(value)||isUndefined(value)}},{"lodash.isnull":12,"validate.io-undefined":21}],11:[function(_dereq_,module,exports){"use strict";var strValue=String.prototype.valueOf,tryStringObject=function tryStringObject(value){try{return strValue.call(value),!0}catch(e){return!1}},toStr=Object.prototype.toString,hasToStringTag="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;module.exports=function isString(value){return"string"==typeof value||"object"==typeof value&&(hasToStringTag?tryStringObject(value):"[object String]"===toStr.call(value))}},{}],12:[function(_dereq_,module,exports){module.exports=function isNull(value){return null===value}},{}],13:[function(_dereq_,module,exports){/** | ||
"use strict";var isUndefined=_dereq_("validate.io-undefined"),isNull=_dereq_("lodash.isnull");module.exports=function isNil(value){return isNull(value)||isUndefined(value)}},{"lodash.isnull":13,"validate.io-undefined":22}],12:[function(_dereq_,module,exports){"use strict";var strValue=String.prototype.valueOf,tryStringObject=function tryStringObject(value){try{return strValue.call(value),!0}catch(e){return!1}},toStr=Object.prototype.toString,hasToStringTag="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;module.exports=function isString(value){return"string"==typeof value||"object"==typeof value&&(hasToStringTag?tryStringObject(value):"[object String]"===toStr.call(value))}},{}],13:[function(_dereq_,module,exports){module.exports=function isNull(value){return null===value}},{}],14:[function(_dereq_,module,exports){/** | ||
* @file ES6-compliant shim for Math.sign. | ||
@@ -47,3 +47,3 @@ * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-math.sign|20.2.2.29 Math.sign(x)} | ||
*/ | ||
"use strict";var $sign,$isNaN=_dereq_("is-nan");if("function"==typeof Math.sign)try{1===Math.sign(10)&&-1===Math.sign(-10)&&0===Math.sign(0)&&($sign=Math.sign)}catch(ignore){}module.exports=$sign||function sign(x){var n=Number(x);return 0===n||$isNaN(n)?n:n>0?1:-1}},{"is-nan":7}],14:[function(_dereq_,module,exports){"use strict";module.exports=9007199254740991},{}],15:[function(_dereq_,module,exports){"use strict";var has=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,slice=Array.prototype.slice,isArgs=_dereq_("./isArguments"),isEnumerable=Object.prototype.propertyIsEnumerable,hasDontEnumBug=!isEnumerable.call({toString:null},"toString"),hasProtoEnumBug=isEnumerable.call(function(){},"prototype"),dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],equalsConstructorPrototype=function(o){var ctor=o.constructor;return ctor&&ctor.prototype===o},excludedKeys={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},hasAutomationEqualityBug=function(){if("undefined"==typeof window)return!1;for(var k in window)try{if(!excludedKeys["$"+k]&&has.call(window,k)&&null!==window[k]&&"object"==typeof window[k])try{equalsConstructorPrototype(window[k])}catch(e){return!0}}catch(e){return!0}return!1}(),equalsConstructorPrototypeIfNotBuggy=function(o){if("undefined"==typeof window||!hasAutomationEqualityBug)return equalsConstructorPrototype(o);try{return equalsConstructorPrototype(o)}catch(e){return!1}},keysShim=function keys(object){var isObject=null!==object&&"object"==typeof object,isFunction="[object Function]"===toStr.call(object),isArguments=isArgs(object),isString=isObject&&"[object String]"===toStr.call(object),theKeys=[];if(!isObject&&!isFunction&&!isArguments)throw new TypeError("Object.keys called on a non-object");var skipProto=hasProtoEnumBug&&isFunction;if(isString&&object.length>0&&!has.call(object,0))for(var i=0;i<object.length;++i)theKeys.push(String(i));if(isArguments&&object.length>0)for(var j=0;j<object.length;++j)theKeys.push(String(j));else for(var name in object)skipProto&&"prototype"===name||!has.call(object,name)||theKeys.push(String(name));if(hasDontEnumBug)for(var skipConstructor=equalsConstructorPrototypeIfNotBuggy(object),k=0;k<dontEnums.length;++k)skipConstructor&&"constructor"===dontEnums[k]||!has.call(object,dontEnums[k])||theKeys.push(dontEnums[k]);return theKeys};keysShim.shim=function shimObjectKeys(){if(Object.keys){if(!function(){return 2===(Object.keys(arguments)||"").length}(1,2)){var originalKeys=Object.keys;Object.keys=function keys(object){return originalKeys(isArgs(object)?slice.call(object):object)}}}else Object.keys=keysShim;return Object.keys||keysShim},module.exports=keysShim},{"./isArguments":16}],16:[function(_dereq_,module,exports){"use strict";var toStr=Object.prototype.toString;module.exports=function isArguments(value){var str=toStr.call(value),isArgs="[object Arguments]"===str;return isArgs||(isArgs="[object Array]"!==str&&null!==value&&"object"==typeof value&&"number"==typeof value.length&&value.length>=0&&"[object Function]"===toStr.call(value.callee)),isArgs}},{}],17:[function(_dereq_,module,exports){/** | ||
"use strict";var $sign,$isNaN=_dereq_("is-nan");if("function"==typeof Math.sign)try{1===Math.sign(10)&&-1===Math.sign(-10)&&0===Math.sign(0)&&($sign=Math.sign)}catch(ignore){}module.exports=$sign||function sign(x){var n=Number(x);return 0===n||$isNaN(n)?n:n>0?1:-1}},{"is-nan":8}],15:[function(_dereq_,module,exports){"use strict";module.exports=9007199254740991},{}],16:[function(_dereq_,module,exports){"use strict";var has=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,slice=Array.prototype.slice,isArgs=_dereq_("./isArguments"),isEnumerable=Object.prototype.propertyIsEnumerable,hasDontEnumBug=!isEnumerable.call({toString:null},"toString"),hasProtoEnumBug=isEnumerable.call(function(){},"prototype"),dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],equalsConstructorPrototype=function(o){var ctor=o.constructor;return ctor&&ctor.prototype===o},excludedKeys={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},hasAutomationEqualityBug=function(){if("undefined"==typeof window)return!1;for(var k in window)try{if(!excludedKeys["$"+k]&&has.call(window,k)&&null!==window[k]&&"object"==typeof window[k])try{equalsConstructorPrototype(window[k])}catch(e){return!0}}catch(e){return!0}return!1}(),equalsConstructorPrototypeIfNotBuggy=function(o){if("undefined"==typeof window||!hasAutomationEqualityBug)return equalsConstructorPrototype(o);try{return equalsConstructorPrototype(o)}catch(e){return!1}},keysShim=function keys(object){var isObject=null!==object&&"object"==typeof object,isFunction="[object Function]"===toStr.call(object),isArguments=isArgs(object),isString=isObject&&"[object String]"===toStr.call(object),theKeys=[];if(!isObject&&!isFunction&&!isArguments)throw new TypeError("Object.keys called on a non-object");var skipProto=hasProtoEnumBug&&isFunction;if(isString&&object.length>0&&!has.call(object,0))for(var i=0;i<object.length;++i)theKeys.push(String(i));if(isArguments&&object.length>0)for(var j=0;j<object.length;++j)theKeys.push(String(j));else for(var name in object)skipProto&&"prototype"===name||!has.call(object,name)||theKeys.push(String(name));if(hasDontEnumBug)for(var skipConstructor=equalsConstructorPrototypeIfNotBuggy(object),k=0;k<dontEnums.length;++k)skipConstructor&&"constructor"===dontEnums[k]||!has.call(object,dontEnums[k])||theKeys.push(dontEnums[k]);return theKeys};keysShim.shim=function shimObjectKeys(){if(Object.keys){if(!function(){return 2===(Object.keys(arguments)||"").length}(1,2)){var originalKeys=Object.keys;Object.keys=function keys(object){return originalKeys(isArgs(object)?slice.call(object):object)}}}else Object.keys=keysShim;return Object.keys||keysShim},module.exports=keysShim},{"./isArguments":17}],17:[function(_dereq_,module,exports){"use strict";var toStr=Object.prototype.toString;module.exports=function isArguments(value){var str=toStr.call(value),isArgs="[object Arguments]"===str;return isArgs||(isArgs="[object Array]"!==str&&null!==value&&"object"==typeof value&&"number"==typeof value.length&&value.length>=0&&"[object Function]"===toStr.call(value.callee)),isArgs}},{}],18:[function(_dereq_,module,exports){/** | ||
* @file ES6-compliant shim for RequireObjectCoercible. | ||
@@ -57,3 +57,3 @@ * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-requireobjectcoercible|7.2.1 RequireObjectCoercible ( argument )} | ||
*/ | ||
"use strict";var isNil=_dereq_("is-nil-x");module.exports=function RequireObjectCoercible(value){if(isNil(value))throw new TypeError("Cannot call method on "+value);return value}},{"is-nil-x":10}],18:[function(_dereq_,module,exports){/** | ||
"use strict";var isNil=_dereq_("is-nil-x");module.exports=function RequireObjectCoercible(value){if(isNil(value))throw new TypeError("Cannot call method on "+value);return value}},{"is-nil-x":11}],19:[function(_dereq_,module,exports){/** | ||
* @file ToInteger converts 'argument' to an integral numeric value. | ||
@@ -67,3 +67,3 @@ * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger|7.1.4 ToInteger ( argument )} | ||
*/ | ||
"use strict";var $isNaN=_dereq_("is-nan"),$isFinite=_dereq_("is-finite-x"),$sign=_dereq_("math-sign-x");module.exports=function ToInteger(value){var number=Number(value);return $isNaN(number)?0:0===number||!1===$isFinite(number)?number:$sign(number)*Math.floor(Math.abs(number))}},{"is-finite-x":5,"is-nan":7,"math-sign-x":13}],19:[function(_dereq_,module,exports){/** | ||
"use strict";var $isNaN=_dereq_("is-nan"),$isFinite=_dereq_("is-finite-x"),$sign=_dereq_("math-sign-x");module.exports=function ToInteger(value){var number=Number(value);return $isNaN(number)?0:0===number||!1===$isFinite(number)?number:$sign(number)*Math.floor(Math.abs(number))}},{"is-finite-x":6,"is-nan":8,"math-sign-x":14}],20:[function(_dereq_,module,exports){/** | ||
* @file ES6-compliant shim for ToLength. | ||
@@ -77,3 +77,3 @@ * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tolength|7.1.15 ToLength ( argument )} | ||
*/ | ||
"use strict";var toInteger=_dereq_("to-integer-x"),MAX_SAFE_INTEGER=_dereq_("max-safe-integer");module.exports=function ToLength(value){var len=toInteger(value);return len<=0?0:len>MAX_SAFE_INTEGER?MAX_SAFE_INTEGER:len}},{"max-safe-integer":14,"to-integer-x":18}],20:[function(_dereq_,module,exports){/** | ||
"use strict";var toInteger=_dereq_("to-integer-x"),MAX_SAFE_INTEGER=_dereq_("max-safe-integer");module.exports=function ToLength(value){var len=toInteger(value);return len<=0?0:len>MAX_SAFE_INTEGER?MAX_SAFE_INTEGER:len}},{"max-safe-integer":15,"to-integer-x":19}],21:[function(_dereq_,module,exports){/** | ||
* @file ES6-compliant shim for ToObject. | ||
@@ -87,2 +87,2 @@ * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-toobject|7.1.13 ToObject ( argument )} | ||
*/ | ||
"use strict";var $requireObjectCoercible=_dereq_("require-object-coercible-x");module.exports=function ToObject(value){return Object($requireObjectCoercible(value))}},{"require-object-coercible-x":17}],21:[function(_dereq_,module,exports){"use strict";module.exports=function isUndefined(value){return void 0===value}},{}]},{},[1])(1)}); | ||
"use strict";var $requireObjectCoercible=_dereq_("require-object-coercible-x");module.exports=function ToObject(value){return Object($requireObjectCoercible(value))}},{"require-object-coercible-x":18}],22:[function(_dereq_,module,exports){"use strict";module.exports=function isUndefined(value){return void 0===value}},{}]},{},[1])(1)}); |
{ | ||
"name": "array-slice-x", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Cross-browser array slicer.", | ||
@@ -33,2 +33,3 @@ "homepage": "https://github.com/Xotic750/array-slice-x", | ||
"has-boxed-string-x": "^1.0.0", | ||
"is-arguments": "^1.0.2", | ||
"is-string": "^1.0.4", | ||
@@ -35,0 +36,0 @@ "to-integer-x": "^1.4.0", |
@@ -26,3 +26,3 @@ <a href="https://travis-ci.org/Xotic750/array-slice-x" | ||
**Version**: 2.0.0 | ||
**Version**: 2.1.0 | ||
**Author**: Xotic750 <Xotic750@gmail.com> | ||
@@ -29,0 +29,0 @@ **License**: [MIT](<https://opensource.org/licenses/MIT>) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
72037
1132
7
+ Addedis-arguments@^1.0.2
+ Addedis-arguments@1.1.1(transitive)