Sha256: 4004588aa7a3769d8c34ef9a837e1632237487e53ed57caec51bfcc6668f2c29

Contents?: true

Size: 823 Bytes

Versions: 125

Compression:

Stored size: 823 Bytes

Contents

'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;

Version data entries

125 entries across 124 versions & 14 rubygems

Version Path
immosquare-cleaner-0.1.52 node_modules/object-keys/index.js
immosquare-cleaner-0.1.51 node_modules/object-keys/index.js
immosquare-cleaner-0.1.50 node_modules/object-keys/index.js
immosquare-cleaner-0.1.49 node_modules/object-keys/index.js
immosquare-cleaner-0.1.48 node_modules/object-keys/index.js
immosquare-cleaner-0.1.47 node_modules/object-keys/index.js
immosquare-cleaner-0.1.46 node_modules/object-keys/index.js
immosquare-cleaner-0.1.45 node_modules/object-keys/index.js
immosquare-cleaner-0.1.44 node_modules/object-keys/index.js
immosquare-cleaner-0.1.43 node_modules/object-keys/index.js
immosquare-cleaner-0.1.42 node_modules/object-keys/index.js
immosquare-cleaner-0.1.41 node_modules/object-keys/index.js
immosquare-cleaner-0.1.40 node_modules/object-keys/index.js
immosquare-cleaner-0.1.39 node_modules/object-keys/index.js
immosquare-cleaner-0.1.38 node_modules/object-keys/index.js
optimacms-0.1.61 spec/dummy/node_modules/object-keys/index.js
immosquare-cleaner-0.1.32 node_modules/object-keys/index.js
immosquare-cleaner-0.1.31 node_modules/object-keys/index.js
immosquare-cleaner-0.1.30 node_modules/object-keys/index.js
immosquare-cleaner-0.1.29 node_modules/object-keys/index.js