.idea
node_modules
@discordjs
abort-controller
asynckit
better-js-class
bignumber.js
combined-stream
core-util-is
cps
delayed-stream
discord-anti-spam
discord.js
event-target-shim
inherits
isarray
mime-db
mime-types
mysql
node-fetch
node-mysql
prism-media
process-nextick-args
readable-stream
safe-buffer
setimmediate
sqlstring
string_decoder
tweetnacl
underscore
amd
cjs
_baseCreate.js
_baseIteratee.js
_cb.js
_chainResult.js
_collectNonEnumProps.js
_createAssigner.js
_createEscaper.js
_createIndexFinder.js
_createPredicateIndexFinder.js
_createReduce.js
_createSizePropertyCheck.js
_deepGet.js
_escapeMap.js
_executeBound.js
_flatten.js
_getByteLength.js
_getLength.js
_group.js
_has.js
_hasObjectTag.js
_isArrayLike.js
_isBufferLike.js
_keyInObj.js
_methodFingerprint.js
_optimizeCb.js
_setup.js
_shallowProperty.js
_stringTagBug.js
_tagTester.js
_toBufferView.js
_toPath.js
_unescapeMap.js
after.js
allKeys.js
before.js
bind.js
bindAll.js
chain.js
chunk.js
clone.js
compact.js
compose.js
constant.js
contains.js
countBy.js
create.js
debounce.js
defaults.js
defer.js
delay.js
difference.js
each.js
escape.js
every.js
extend.js
extendOwn.js
filter.js
find.js
findIndex.js
findKey.js
findLastIndex.js
findWhere.js
first.js
flatten.js
functions.js
get.js
groupBy.js
has.js
identity.js
index-default.js
index.js
indexBy.js
indexOf.js
initial.js
intersection.js
invert.js
invoke.js
isArguments.js
isArray.js
isArrayBuffer.js
isBoolean.js
isDataView.js
isDate.js
isElement.js
isEmpty.js
isEqual.js
isError.js
isFinite.js
isFunction.js
isMap.js
isMatch.js
isNaN.js
isNull.js
isNumber.js
isObject.js
isRegExp.js
isSet.js
isString.js
isSymbol.js
isTypedArray.js
isUndefined.js
isWeakMap.js
isWeakSet.js
iteratee.js
keys.js
last.js
lastIndexOf.js
map.js
mapObject.js
matcher.js
max.js
memoize.js
min.js
mixin.js
negate.js
noop.js
now.js
object.js
omit.js
once.js
pairs.js
partial.js
partition.js
pick.js
pluck.js
property.js
propertyOf.js
random.js
range.js
reduce.js
reduceRight.js
reject.js
rest.js
restArguments.js
result.js
sample.js
shuffle.js
size.js
some.js
sortBy.js
sortedIndex.js
tap.js
template.js
templateSettings.js
throttle.js
times.js
toArray.js
toPath.js
underscore-array-methods.js
underscore.js
unescape.js
union.js
uniq.js
uniqueId.js
unzip.js
values.js
where.js
without.js
wrap.js
zip.js
modules
LICENSE
README.md
package.json
underscore-esm-min.js
underscore-esm-min.js.map
underscore-esm.js
underscore-esm.js.map
underscore-min.js
underscore-min.js.map
underscore.js
underscore.js.map
util-deprecate
ws
config.json
index.js
package-lock.json
package.json
woam-antispam-bot.iml
15 lines
406 B
JavaScript
15 lines
406 B
JavaScript
var keys = require('./keys.js');
|
|
var _cb = require('./_cb.js');
|
|
|
|
// Returns the first key on an object that passes a truth test.
|
|
function findKey(obj, predicate, context) {
|
|
predicate = _cb(predicate, context);
|
|
var _keys = keys(obj), key;
|
|
for (var i = 0, length = _keys.length; i < length; i++) {
|
|
key = _keys[i];
|
|
if (predicate(obj[key], key, obj)) return key;
|
|
}
|
|
}
|
|
|
|
module.exports = findKey;
|