MCPcopy Create free account
hub / github.com/Starcounter-Jack/JSON-Patch / _objectKeys

Function _objectKeys

commonjs/helpers.js:25–43  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

23}
24exports.hasOwnProperty = hasOwnProperty;
25function _objectKeys(obj) {
26 if (Array.isArray(obj)) {
27 var keys_1 = new Array(obj.length);
28 for (var k = 0; k < keys_1.length; k++) {
29 keys_1[k] = "" + k;
30 }
31 return keys_1;
32 }
33 if (Object.keys) {
34 return Object.keys(obj);
35 }
36 var keys = [];
37 for (var i in obj) {
38 if (hasOwnProperty(obj, i)) {
39 keys.push(i);
40 }
41 }
42 return keys;
43}
44exports._objectKeys = _objectKeys;
45;
46/**

Callers 1

hasUndefinedFunction · 0.70

Calls 1

hasOwnPropertyFunction · 0.70

Tested by

no test coverage detected