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

Function hasUndefined

commonjs/helpers.js:131–154  ·  view source on GitHub ↗

* Recursively checks whether an object has any undefined values inside.

(obj)

Source from the content-addressed store, hash-verified

129* Recursively checks whether an object has any undefined values inside.
130*/
131function hasUndefined(obj) {
132 if (obj === undefined) {
133 return true;
134 }
135 if (obj) {
136 if (Array.isArray(obj)) {
137 for (var i_1 = 0, len = obj.length; i_1 < len; i_1++) {
138 if (hasUndefined(obj[i_1])) {
139 return true;
140 }
141 }
142 }
143 else if (typeof obj === "object") {
144 var objKeys = _objectKeys(obj);
145 var objKeysLength = objKeys.length;
146 for (var i = 0; i < objKeysLength; i++) {
147 if (hasUndefined(obj[objKeys[i]])) {
148 return true;
149 }
150 }
151 }
152 }
153 return false;
154}
155exports.hasUndefined = hasUndefined;
156function patchErrorMessageFormatter(message, args) {
157 var messageParts = [message];

Callers

nothing calls this directly

Calls 1

_objectKeysFunction · 0.70

Tested by

no test coverage detected