Permalink
Cannot retrieve contributors at this time
32 lines (27 sloc)
823 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/object-keys/index.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var slice = Array.prototype.slice; | |
var isArgs = require('./isArguments'); | |
var origKeys = Object.keys; | |
var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation'); | |
var originalKeys = Object.keys; | |
keysShim.shim = function shimObjectKeys() { | |
if (Object.keys) { | |
var keysWorksWithArguments = (function () { | |
// Safari 5.0 bug | |
var args = Object.keys(arguments); | |
return args && args.length === arguments.length; | |
}(1, 2)); | |
if (!keysWorksWithArguments) { | |
Object.keys = function keys(object) { // eslint-disable-line func-name-matching | |
if (isArgs(object)) { | |
return originalKeys(slice.call(object)); | |
} | |
return originalKeys(object); | |
}; | |
} | |
} else { | |
Object.keys = keysShim; | |
} | |
return Object.keys || keysShim; | |
}; | |
module.exports = keysShim; |