1 line
985 B
JSON
1 line
985 B
JSON
|
{"ast":null,"code":"'use strict';\n\nvar slice = Array.prototype.slice;\n\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) {\n return origKeys(o);\n} : require('./implementation');\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n if (Object.keys) {\n var keysWorksWithArguments = function () {\n // Safari 5.0 bug\n var args = Object.keys(arguments);\n return args && args.length === arguments.length;\n }(1, 2);\n\n if (!keysWorksWithArguments) {\n Object.keys = function keys(object) {\n // eslint-disable-line func-name-matching\n if (isArgs(object)) {\n return originalKeys(slice.call(object));\n }\n\n return originalKeys(object);\n };\n }\n } else {\n Object.keys = keysShim;\n }\n\n return Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;","map":null,"metadata":{},"sourceType":"script"}
|