UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

15 lines (12 loc) 433 B
import { findKey as findKey$1 } from '../../object/findKey.mjs'; import { identity } from '../function/identity.mjs'; import { isObject } from '../predicate/isObject.mjs'; import { iteratee } from '../util/iteratee.mjs'; function findKey(obj, predicate) { if (!isObject(obj)) { return undefined; } const iteratee$1 = iteratee(predicate ?? identity); return findKey$1(obj, iteratee$1); } export { findKey };