object-keys
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"additionalRules": [], | ||
"requireSemicolons": true, | ||
"disallowMultipleSpaces": true, | ||
"disallowIdentifierNames": [], | ||
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"], | ||
@@ -66,4 +72,34 @@ | ||
"mark": "'" | ||
} | ||
}, | ||
"disallowOperatorBeforeLineBreak": [], | ||
"requireSpaceBeforeKeywords": [ | ||
"do", | ||
"for", | ||
"if", | ||
"else", | ||
"switch", | ||
"case", | ||
"try", | ||
"catch", | ||
"finally", | ||
"while", | ||
"with", | ||
"return" | ||
], | ||
"validateAlignedFunctionParameters": { | ||
"lineBreakAfterOpeningBraces": true, | ||
"lineBreakBeforeClosingBraces": true | ||
}, | ||
"requirePaddingNewLinesBeforeExport": true, | ||
"validateNewlineAfterArrayElements": { | ||
"maximum": 7 | ||
}, | ||
"requirePaddingNewLinesAfterUseStrict": true | ||
} | ||
@@ -0,1 +1,7 @@ | ||
1.0.4 / 2015-05-23 | ||
================= | ||
* Fix a Safari 5.0 bug with `Object.keys` not working with `arguments` | ||
* Test on latest `node` and `io.js` | ||
* Update `jscs`, `tape`, `eslint`, `nsp`, `is`, `editorconfig-tools`, `covert` | ||
1.0.3 / 2015-01-06 | ||
@@ -2,0 +8,0 @@ ================= |
16
index.js
@@ -6,2 +6,3 @@ 'use strict'; | ||
var toStr = Object.prototype.toString; | ||
var slice = Array.prototype.slice; | ||
var isArgs = require('./isArguments'); | ||
@@ -66,2 +67,17 @@ var hasDontEnumBug = !({ 'toString': null }).propertyIsEnumerable('toString'); | ||
Object.keys = keysShim; | ||
} else { | ||
var keysWorksWithArguments = (function () { | ||
// Safari 5.0 bug | ||
return (Object.keys(arguments) || '').length === 2; | ||
}(1, 2)); | ||
if (!keysWorksWithArguments) { | ||
var originalKeys = Object.keys; | ||
Object.keys = function keys(object) { | ||
if (isArgs(object)) { | ||
return originalKeys(slice.call(object)); | ||
} else { | ||
return originalKeys(object); | ||
} | ||
}; | ||
} | ||
} | ||
@@ -68,0 +84,0 @@ return Object.keys || keysShim; |
@@ -9,10 +9,10 @@ 'use strict'; | ||
if (!isArgs) { | ||
isArgs = str !== '[object Array]' | ||
&& value !== null | ||
&& typeof value === 'object' | ||
&& typeof value.length === 'number' | ||
&& value.length >= 0 | ||
&& toStr.call(value.callee) === '[object Function]'; | ||
isArgs = str !== '[object Array]' && | ||
value !== null && | ||
typeof value === 'object' && | ||
typeof value.length === 'number' && | ||
value.length >= 0 && | ||
toStr.call(value.callee) === '[object Function]'; | ||
} | ||
return isArgs; | ||
}; |
{ | ||
"name": "object-keys", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"author": "Jordan Harband", | ||
@@ -30,11 +30,11 @@ "description": "An Object.keys replacement, in case Object.keys is not available. From https://github.com/es-shims/es5-shim", | ||
"devDependencies": { | ||
"foreach": "~2.0.5", | ||
"is": "~2.2.0", | ||
"tape": "~3.0.3", | ||
"indexof": "~0.0.1", | ||
"covert": "1.0.0", | ||
"jscs": "~1.9.0", | ||
"editorconfig-tools": "~0.0.1", | ||
"nsp": "~0.5.2", | ||
"eslint": "~0.11.0" | ||
"foreach": "^2.0.5", | ||
"is": "^3.0.1", | ||
"tape": "^4.0.0", | ||
"indexof": "^0.0.1", | ||
"covert": "^1.1.0", | ||
"jscs": "^1.13.1", | ||
"editorconfig-tools": "^0.1.1", | ||
"nsp": "^1.0.1", | ||
"eslint": "^0.21.0" | ||
}, | ||
@@ -41,0 +41,0 @@ "testling": { |
Sorry, the diff of this file is not supported yet
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
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
20831
159