diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2019-12-18 21:26:23 -0500 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2019-12-18 21:26:23 -0500 |
commit | e6738bd3ec257b3f35e04bc5b73e3b6de93772fb (patch) | |
tree | 9341c65d9cf883d12152167876edd25cbd2d163f /lib | |
parent | de6d39cedeb4af0e54ca04583ad3fe33e2ef094a (diff) | |
download | patchfoo-e6738bd3ec257b3f35e04bc5b73e3b6de93772fb.tar.gz patchfoo-e6738bd3ec257b3f35e04bc5b73e3b6de93772fb.zip |
Search through JSON object keys
Diffstat (limited to 'lib')
-rw-r--r-- | lib/app.js | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 } } |