aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-12-18 21:26:23 -0500
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-12-18 21:26:23 -0500
commite6738bd3ec257b3f35e04bc5b73e3b6de93772fb (patch)
tree9341c65d9cf883d12152167876edd25cbd2d163f /lib
parentde6d39cedeb4af0e54ca04583ad3fe33e2ef094a (diff)
downloadpatchfoo-e6738bd3ec257b3f35e04bc5b73e3b6de93772fb.tar.gz
patchfoo-e6738bd3ec257b3f35e04bc5b73e3b6de93772fb.zip
Search through JSON object keys
Diffstat (limited to 'lib')
-rw-r--r--lib/app.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/app.js b/lib/app.js
index 0eb576e..7caab05 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -252,8 +252,10 @@ function forSome(each) {
if (obj == null) return false
if (typeof obj === 'string') return each(obj)
if (Array.isArray(obj)) return obj.some(some)
- if (typeof obj === 'object')
- for (var k in obj) if (some(obj[k])) return true
+ if (typeof obj === 'object') for (var k in obj) {
+ if (each(k)) return true
+ if (some(obj[k])) return true
+ }
return false
}
}