Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

object-keys-x

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-keys-x - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

56

index.js
/**
* @file An ES6 Object.keys shim.
* @version 1.2.0
* @version 1.3.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -12,36 +12,40 @@ * @copyright Xotic750

var isArguments = require('is-arguments');
var toObject = require('to-object-x');
var originalKeys = Object.keys;
var keysWorksWithArguments = false;
var keysHasArgumentsLengthBug = true;
var worksWithPrimitives = false;
var toObject;
if (Boolean(originalKeys) === false) {
try {
var arr = originalKeys({ a: 1, b: 2 });
if (arr.length !== 2 || arr[0] !== 'a' || arr[1] !== 'b') {
throw new Error('failed keys');
}
} catch (ignore) {
originalKeys = require('object-keys');
}
try {
keysWorksWithArguments = (function () {
// Safari 5.0 bug
return originalKeys(arguments).length === 2;
}(1, 2));
var keysWorksWithArguments = (function () {
// Safari 5.0 bug
return originalKeys(arguments).length === 2;
}(1, 2));
keysHasArgumentsLengthBug = (function () {
var argKeys = originalKeys(arguments);
return arguments.length !== 1 || argKeys.length !== 1 || argKeys[0] !== 1;
}(1));
var keysHasArgumentsLengthBug = (function () {
var argKeys = originalKeys(arguments);
return arguments.length !== 1 || argKeys.length !== 1 || argKeys[0] !== 1;
}(1));
worksWithPrimitives = (function () {
return originalKeys(1).length === 0;
}(1));
} catch (e) {}
var objectKeys;
if (keysWorksWithArguments === false || keysHasArgumentsLengthBug || worksWithPrimitives === false) {
var slice = require('array-slice-x');
var isArguments = require('is-arguments');
toObject = require('to-object-x');
if (!keysWorksWithArguments || keysHasArgumentsLengthBug) {
var arraySlice = Array.prototype.slice;
objectKeys = function keys(object) {
return originalKeys(isArguments(object) ? slice(object) : toObject(object));
var obj = toObject(object);
if (isArguments(object)) {
return originalKeys(arraySlice.call(obj));
}
return originalKeys(obj);
};
} else {
objectKeys = function keys(object) {
return originalKeys(toObject(object));
};
}

@@ -71,2 +75,2 @@

*/
module.exports = objectKeys || originalKeys;
module.exports = objectKeys;
(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 An ES6 Object.keys shim.
* @version 1.2.0
* @version 1.3.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -13,36 +13,40 @@ * @copyright Xotic750

var isArguments = _dereq_('is-arguments');
var toObject = _dereq_('to-object-x');
var originalKeys = Object.keys;
var keysWorksWithArguments = false;
var keysHasArgumentsLengthBug = true;
var worksWithPrimitives = false;
var toObject;
if (Boolean(originalKeys) === false) {
try {
var arr = originalKeys({ a: 1, b: 2 });
if (arr.length !== 2 || arr[0] !== 'a' || arr[1] !== 'b') {
throw new Error('failed keys');
}
} catch (ignore) {
originalKeys = _dereq_('object-keys');
}
try {
keysWorksWithArguments = (function () {
// Safari 5.0 bug
return originalKeys(arguments).length === 2;
}(1, 2));
var keysWorksWithArguments = (function () {
// Safari 5.0 bug
return originalKeys(arguments).length === 2;
}(1, 2));
keysHasArgumentsLengthBug = (function () {
var argKeys = originalKeys(arguments);
return arguments.length !== 1 || argKeys.length !== 1 || argKeys[0] !== 1;
}(1));
var keysHasArgumentsLengthBug = (function () {
var argKeys = originalKeys(arguments);
return arguments.length !== 1 || argKeys.length !== 1 || argKeys[0] !== 1;
}(1));
worksWithPrimitives = (function () {
return originalKeys(1).length === 0;
}(1));
} catch (e) {}
var objectKeys;
if (keysWorksWithArguments === false || keysHasArgumentsLengthBug || worksWithPrimitives === false) {
var slice = _dereq_('array-slice-x');
var isArguments = _dereq_('is-arguments');
toObject = _dereq_('to-object-x');
if (!keysWorksWithArguments || keysHasArgumentsLengthBug) {
var arraySlice = Array.prototype.slice;
objectKeys = function keys(object) {
return originalKeys(isArguments(object) ? slice(object) : toObject(object));
var obj = toObject(object);
if (isArguments(object)) {
return originalKeys(arraySlice.call(obj));
}
return originalKeys(obj);
};
} else {
objectKeys = function keys(object) {
return originalKeys(toObject(object));
};
}

@@ -72,192 +76,9 @@

*/
module.exports = objectKeys || originalKeys;
module.exports = objectKeys;
},{"array-slice-x":2,"is-arguments":6,"object-keys":17,"to-object-x":22}],2:[function(_dereq_,module,exports){
/**
* @file Cross-browser array slicer.
* @version 2.0.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module array-slice-x
*/
},{"is-arguments":2,"object-keys":5,"to-object-x":8}],2:[function(_dereq_,module,exports){
'use strict';
var toObject = _dereq_('to-object-x');
var toInteger = _dereq_('to-integer-x');
var toLength = _dereq_('to-length-x');
var isUndefined = _dereq_('validate.io-undefined');
var isString = _dereq_('is-string');
var splitString = _dereq_('has-boxed-string-x') === false;
var setRelative = function _seedRelative(value, length) {
return value < 0 ? Math.max(length + value, 0) : Math.min(value, length);
};
var $slice = function slice(array, start, end) {
var object = toObject(array);
var iterable = splitString && isString(object) ? object.split('') : object;
var length = toLength(iterable.length);
var k = setRelative(toInteger(start), length);
var relativeEnd = isUndefined(end) ? length : toInteger(end);
var finalEnd = setRelative(relativeEnd, length);
var val = [];
val.length = Math.max(finalEnd - k, 0);
var next = 0;
while (k < finalEnd) {
if (k in iterable) {
val[next] = iterable[k];
}
next += 1;
k += 1;
}
return val;
};
/**
* The slice() method returns a shallow copy of a portion of an array into a new
* array object selected from begin to end (end not included). The original
* array will not be modified.
*
* @param {Array|Object} array - The array to slice.
* @param {number} [start] - Zero-based index at which to begin extraction.
* A negative index can be used, indicating an offset from the end of the
* sequence. slice(-2) extracts the last two elements in the sequence.
* If begin is undefined, slice begins from index 0.
* @param {number} [end] - Zero-based index before which to end extraction.
* Slice extracts up to but not including end. For example, slice(1,4)
* extracts the second element through the fourth element (elements indexed
* 1, 2, and 3).
* A negative index can be used, indicating an offset from the end of the
* sequence. slice(2,-1) extracts the third element through the second-to-last
* element in the sequence.
* If end is omitted, slice extracts through the end of the
* sequence (arr.length).
* If end is greater than the length of the sequence, slice extracts through
* the end of the sequence (arr.length).
* @returns {Array} A new array containing the extracted elements.
* @example
* var slice = require('array-slice-x');
* var fruits = ['Banana', 'Orange', 'Lemon', 'Apple', 'Mango'];
* var citrus = slice(fruits, 1, 3);
*
* // fruits contains ['Banana', 'Orange', 'Lemon', 'Apple', 'Mango']
* // citrus contains ['Orange','Lemon']
*/
module.exports = $slice;
},{"has-boxed-string-x":5,"is-string":13,"to-integer-x":20,"to-length-x":21,"to-object-x":22,"validate.io-undefined":23}],3:[function(_dereq_,module,exports){
'use strict';
var keys = _dereq_('object-keys');
var foreach = _dereq_('foreach');
var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol';
var toStr = Object.prototype.toString;
var isFunction = function (fn) {
return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
};
var arePropertyDescriptorsSupported = function () {
var obj = {};
try {
Object.defineProperty(obj, 'x', { enumerable: false, value: obj });
/* eslint-disable no-unused-vars, no-restricted-syntax */
for (var _ in obj) { return false; }
/* eslint-enable no-unused-vars, no-restricted-syntax */
return obj.x === obj;
} catch (e) { /* this is IE 8. */
return false;
}
};
var supportsDescriptors = Object.defineProperty && arePropertyDescriptorsSupported();
var defineProperty = function (object, name, value, predicate) {
if (name in object && (!isFunction(predicate) || !predicate())) {
return;
}
if (supportsDescriptors) {
Object.defineProperty(object, name, {
configurable: true,
enumerable: false,
value: value,
writable: true
});
} else {
object[name] = value;
}
};
var defineProperties = function (object, map) {
var predicates = arguments.length > 2 ? arguments[2] : {};
var props = keys(map);
if (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":4,"object-keys":17}],4:[function(_dereq_,module,exports){
var hasOwn = Object.prototype.hasOwnProperty;
var toString = Object.prototype.toString;
module.exports = function forEach (obj, fn, ctx) {
if (toString.call(fn) !== '[object Function]') {
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) {
if (hasOwn.call(obj, k)) {
fn.call(ctx, obj[k], k, obj);
}
}
}
};
},{}],5:[function(_dereq_,module,exports){
/**
* @file Check support of by-index access of string characters.
* @version 1.0.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module has-boxed-string-x
*/
'use strict';
var boxedString = Object('a');
/**
* Check failure of by-index access of string characters (IE < 9)
* and failure of `0 in boxedString` (Rhino).
*
* `true` if no failure; otherwise `false`.
*
* @type boolean
*/
module.exports = boxedString[0] === 'a' && (0 in boxedString);
},{}],6:[function(_dereq_,module,exports){
'use strict';
var toStr = Object.prototype.toString;
var isStandardArguments = function isArguments(value) {

@@ -287,106 +108,4 @@ return toStr.call(value) === '[object Arguments]';

},{}],7:[function(_dereq_,module,exports){
},{}],3:[function(_dereq_,module,exports){
/**
* @file ES6-compliant shim for Number.isFinite.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-number.isfinite|20.1.2.2 Number.isFinite ( number )}
* @version 1.3.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module is-finite-x
*/
'use strict';
var $isNaN = _dereq_('is-nan');
var $isFinite;
if (typeof Number.isFinite === 'function') {
var MAX_SAFE_INTEGER = _dereq_('max-safe-integer');
try {
if (Number.isFinite(MAX_SAFE_INTEGER) && Number.isFinite(Infinity) === false) {
$isFinite = Number.isFinite;
}
} catch (ignore) {}
}
/**
* This method determines whether the passed value is a finite number.
*
* @param {*} number - The value to be tested for finiteness.
* @returns {boolean} A Boolean indicating whether or not the given value is a finite number.
* @example
* var numIsFinite = require('is-finite-x');
*
* numIsFinite(Infinity); // false
* numIsFinite(NaN); // false
* numIsFinite(-Infinity); // false
*
* numIsFinite(0); // true
* numIsFinite(2e64); // true
*
* numIsFinite('0'); // false, would've been true with
* // global isFinite('0')
* numIsFinite(null); // false, would've been true with
*/
module.exports = $isFinite || function isFinite(number) {
return !(typeof number !== 'number' || $isNaN(number) || number === Infinity || number === -Infinity);
};
},{"is-nan":9,"max-safe-integer":16}],8:[function(_dereq_,module,exports){
'use strict';
/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */
module.exports = function isNaN(value) {
return value !== value;
};
},{}],9:[function(_dereq_,module,exports){
'use strict';
var define = _dereq_('define-properties');
var implementation = _dereq_('./implementation');
var getPolyfill = _dereq_('./polyfill');
var shim = _dereq_('./shim');
/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */
define(implementation, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = implementation;
},{"./implementation":8,"./polyfill":10,"./shim":11,"define-properties":3}],10:[function(_dereq_,module,exports){
'use strict';
var implementation = _dereq_('./implementation');
module.exports = function getPolyfill() {
if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) {
return Number.isNaN;
}
return implementation;
};
},{"./implementation":8}],11:[function(_dereq_,module,exports){
'use strict';
var define = _dereq_('define-properties');
var getPolyfill = _dereq_('./polyfill');
/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */
module.exports = function shimNumberIsNaN() {
var polyfill = getPolyfill();
define(Number, { isNaN: polyfill }, { isNaN: function () { return Number.isNaN !== polyfill; } });
return polyfill;
};
},{"./polyfill":10,"define-properties":3}],12:[function(_dereq_,module,exports){
/**
* @file Checks if `value` is `null` or `undefined`.

@@ -421,25 +140,3 @@ * @version 1.4.0

},{"lodash.isnull":14,"validate.io-undefined":23}],13:[function(_dereq_,module,exports){
'use strict';
var strValue = String.prototype.valueOf;
var tryStringObject = function tryStringObject(value) {
try {
strValue.call(value);
return true;
} catch (e) {
return false;
}
};
var toStr = Object.prototype.toString;
var strClass = '[object String]';
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
module.exports = function isString(value) {
if (typeof value === 'string') { return true; }
if (typeof value !== 'object') { return false; }
return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass;
};
},{}],14:[function(_dereq_,module,exports){
},{"lodash.isnull":4,"validate.io-undefined":9}],4:[function(_dereq_,module,exports){
/**

@@ -476,62 +173,5 @@ * lodash 3.0.0 (Custom Build) <https://lodash.com/>

},{}],15:[function(_dereq_,module,exports){
/**
* @file ES6-compliant shim for Math.sign.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-math.sign|20.2.2.29 Math.sign(x)}
* @version 1.3.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module math-sign-x
*/
},{}],5:[function(_dereq_,module,exports){
'use strict';
var $isNaN = _dereq_('is-nan');
var $sign;
if (typeof Math.sign === 'function') {
try {
if (Math.sign(10) === 1 && Math.sign(-10) === -1 && Math.sign(0) === 0) {
$sign = Math.sign;
}
} catch (ignore) {}
}
/**
* This method returns the sign of a number, indicating whether the number is positive,
* negative or zero.
*
* @param {*} x - A number.
* @returns {number} A number representing the sign of the given argument. If the argument
* is a positive number, negative number, positive zero or negative zero, the function will
* return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned.
* @example
* var mathSign = require('math-sign-x');
*
* mathSign(3); // 1
* mathSign(-3); // -1
* mathSign('-3'); // -1
* mathSign(0); // 0
* mathSign(-0); // -0
* mathSign(NaN); // NaN
* mathSign('foo'); // NaN
* mathSign(); // NaN
*/
module.exports = $sign || function sign(x) {
var n = Number(x);
if (n === 0 || $isNaN(n)) {
return n;
}
return n > 0 ? 1 : -1;
};
},{"is-nan":9}],16:[function(_dereq_,module,exports){
'use strict';
module.exports = 9007199254740991;
},{}],17:[function(_dereq_,module,exports){
'use strict';
// modified from https://github.com/es-shims/es5-shim

@@ -676,3 +316,3 @@ var has = Object.prototype.hasOwnProperty;

},{"./isArguments":18}],18:[function(_dereq_,module,exports){
},{"./isArguments":6}],6:[function(_dereq_,module,exports){
'use strict';

@@ -696,3 +336,3 @@

},{}],19:[function(_dereq_,module,exports){
},{}],7:[function(_dereq_,module,exports){
/**

@@ -736,90 +376,4 @@ * @file ES6-compliant shim for RequireObjectCoercible.

},{"is-nil-x":12}],20:[function(_dereq_,module,exports){
},{"is-nil-x":3}],8:[function(_dereq_,module,exports){
/**
* @file ToInteger converts 'argument' to an integral numeric value.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger|7.1.4 ToInteger ( argument )}
* @version 1.4.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module to-integer-x
*/
'use strict';
var $isNaN = _dereq_('is-nan');
var $isFinite = _dereq_('is-finite-x');
var $sign = _dereq_('math-sign-x');
/**
* Converts `value` to an integer.
*
* @param {*} value - The value to convert.
* @returns {number} Returns the converted integer.
*
* @example
* var toInteger = require('to-integer-x');
* toInteger(3); // 3
* toInteger(Number.MIN_VALUE); // 0
* toInteger(Infinity); // 1.7976931348623157e+308
* toInteger('3'); // 3
*/
module.exports = function ToInteger(value) {
var number = Number(value);
if ($isNaN(number)) {
return 0;
}
if (number === 0 || $isFinite(number) === false) {
return number;
}
return $sign(number) * Math.floor(Math.abs(number));
};
},{"is-finite-x":7,"is-nan":9,"math-sign-x":15}],21:[function(_dereq_,module,exports){
/**
* @file ES6-compliant shim for ToLength.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tolength|7.1.15 ToLength ( argument )}
* @version 1.4.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module to-length-x
*/
'use strict';
var toInteger = _dereq_('to-integer-x');
var MAX_SAFE_INTEGER = _dereq_('max-safe-integer');
/**
* Converts `value` to an integer suitable for use as the length of an
* array-like object.
*
* @param {*} value - The value to convert.
* @returns {number} Returns the converted integer.
* @example
* var toLength = require('to-length-x');
* toLength(3); // 3
* toLength(Number.MIN_VALUE); // 0
* toLength(Infinity); // Number.MAX_SAFE_INTEGER
* toLength('3'); // 3
*/
module.exports = function ToLength(value) {
var len = toInteger(value);
// includes converting -0 to +0
if (len <= 0) {
return 0;
}
if (len > MAX_SAFE_INTEGER) {
return MAX_SAFE_INTEGER;
}
return len;
};
},{"max-safe-integer":16,"to-integer-x":20}],22:[function(_dereq_,module,exports){
/**
* @file ES6-compliant shim for ToObject.

@@ -858,3 +412,3 @@ * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-toobject|7.1.13 ToObject ( argument )}

},{"require-object-coercible-x":19}],23:[function(_dereq_,module,exports){
},{"require-object-coercible-x":7}],9:[function(_dereq_,module,exports){
/**

@@ -861,0 +415,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 An ES6 Object.keys shim.
* @version 1.2.0
* @version 1.3.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -9,28 +9,3 @@ * @copyright Xotic750

*/
"use strict";var toObject,originalKeys=Object.keys,keysWorksWithArguments=!1,keysHasArgumentsLengthBug=!0,worksWithPrimitives=!1;!1===Boolean(originalKeys)&&(originalKeys=_dereq_("object-keys"));try{keysWorksWithArguments=function(){return 2===originalKeys(arguments).length}(1,2),keysHasArgumentsLengthBug=function(){var argKeys=originalKeys(arguments);return 1!==arguments.length||1!==argKeys.length||1!==argKeys[0]}(1),worksWithPrimitives=0===originalKeys(1).length}catch(e){}var objectKeys;if(!1===keysWorksWithArguments||keysHasArgumentsLengthBug||!1===worksWithPrimitives){var slice=_dereq_("array-slice-x"),isArguments=_dereq_("is-arguments");toObject=_dereq_("to-object-x"),objectKeys=function keys(object){return originalKeys(isArguments(object)?slice(object):toObject(object))}}module.exports=objectKeys||originalKeys},{"array-slice-x":2,"is-arguments":6,"object-keys":17,"to-object-x":22}],2:[function(_dereq_,module,exports){/**
* @file Cross-browser array slicer.
* @version 2.0.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module array-slice-x
*/
"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":5,"is-string":13,"to-integer-x":20,"to-length-x":21,"to-object-x":22,"validate.io-undefined":23}],3:[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:4,"object-keys":17}],4:[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)}},{}],5:[function(_dereq_,module,exports){/**
* @file Check support of by-index access of string characters.
* @version 1.0.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module has-boxed-string-x
*/
"use strict";var boxedString=Object("a");module.exports="a"===boxedString[0]&&0 in boxedString},{}],6:[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},{}],7:[function(_dereq_,module,exports){/**
* @file ES6-compliant shim for Number.isFinite.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-number.isfinite|20.1.2.2 Number.isFinite ( number )}
* @version 1.3.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module is-finite-x
*/
"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":9,"max-safe-integer":16}],8:[function(_dereq_,module,exports){"use strict";module.exports=function isNaN(value){return value!==value}},{}],9:[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":8,"./polyfill":10,"./shim":11,"define-properties":3}],10:[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":8}],11:[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":10,"define-properties":3}],12:[function(_dereq_,module,exports){/**
"use strict";var isArguments=_dereq_("is-arguments"),toObject=_dereq_("to-object-x"),originalKeys=Object.keys;try{var arr=originalKeys({a:1,b:2});if(2!==arr.length||"a"!==arr[0]||"b"!==arr[1])throw new Error("failed keys")}catch(ignore){originalKeys=_dereq_("object-keys")}var objectKeys,keysWorksWithArguments=function(){return 2===originalKeys(arguments).length}(1,2),keysHasArgumentsLengthBug=function(){var argKeys=originalKeys(arguments);return 1!==arguments.length||1!==argKeys.length||1!==argKeys[0]}(1);if(!keysWorksWithArguments||keysHasArgumentsLengthBug){var arraySlice=Array.prototype.slice;objectKeys=function keys(object){var obj=toObject(object);return originalKeys(isArguments(object)?arraySlice.call(obj):obj)}}else objectKeys=function keys(object){return originalKeys(toObject(object))};module.exports=objectKeys},{"is-arguments":2,"object-keys":5,"to-object-x":8}],2:[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},{}],3:[function(_dereq_,module,exports){/**
* @file Checks if `value` is `null` or `undefined`.

@@ -43,12 +18,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":14,"validate.io-undefined":23}],13:[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))}},{}],14:[function(_dereq_,module,exports){module.exports=function isNull(value){return null===value}},{}],15:[function(_dereq_,module,exports){/**
* @file ES6-compliant shim for Math.sign.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-math.sign|20.2.2.29 Math.sign(x)}
* @version 1.3.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module 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":9}],16:[function(_dereq_,module,exports){"use strict";module.exports=9007199254740991},{}],17:[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":18}],18:[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}},{}],19:[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":4,"validate.io-undefined":9}],4:[function(_dereq_,module,exports){module.exports=function isNull(value){return null===value}},{}],5:[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":6}],6:[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}},{}],7:[function(_dereq_,module,exports){/**
* @file ES6-compliant shim for RequireObjectCoercible.

@@ -62,21 +28,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":12}],20:[function(_dereq_,module,exports){/**
* @file ToInteger converts 'argument' to an integral numeric value.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger|7.1.4 ToInteger ( argument )}
* @version 1.4.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module to-integer-x
*/
"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":7,"is-nan":9,"math-sign-x":15}],21:[function(_dereq_,module,exports){/**
* @file ES6-compliant shim for ToLength.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tolength|7.1.15 ToLength ( argument )}
* @version 1.4.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module to-length-x
*/
"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":16,"to-integer-x":20}],22:[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":3}],8:[function(_dereq_,module,exports){/**
* @file ES6-compliant shim for ToObject.

@@ -90,2 +38,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":19}],23:[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":7}],9:[function(_dereq_,module,exports){"use strict";module.exports=function isUndefined(value){return void 0===value}},{}]},{},[1])(1)});
{
"name": "object-keys-x",
"version": "1.2.0",
"version": "1.3.0",
"description": "An ES6 Object.keys shim.",

@@ -33,3 +33,2 @@ "homepage": "https://github.com/Xotic750/object-keys-x",

"dependencies": {
"array-slice-x": "^2.0.0",
"is-arguments": "^1.0.2",

@@ -36,0 +35,0 @@ "object-keys": "^1.0.11",

@@ -26,3 +26,3 @@ <a href="https://travis-ci.org/Xotic750/object-keys-x"

**Version**: 1.2.0
**Version**: 1.3.0
**Author**: Xotic750 <Xotic750@gmail.com>

@@ -29,0 +29,0 @@ **License**: [MIT](&lt;https://opensource.org/licenses/MIT&gt;)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc