Rename someObj to someValues.

This commit is contained in:
John-David Dalton
2017-04-03 10:14:20 -07:00
parent ca2fd5c64a
commit 571e752a42

View File

@@ -11,17 +11,17 @@
* else `false`. * else `false`.
* @example * @example
* *
* some([null, 0, 'yes', false], Boolean) * someValues({ 'a': 0, 'b': 'yes', 'c': false }, Boolean)
* // => true * // => true
*/ */
function someObj(object, predicate) { function someValues(object, predicate) {
let result const props = Object.keys(Object(object))
for (key of props) {
Object.keys(object).forEach((key) => { if (predicate(object[key], key, object)) {
result = predicate(object[key], key, object) return true
return !result }
}) }
return !!result return false
} }
export default someObj export default someValues