/
githubmirror
/
immutable-js
Обзор
Документация
Войти
/
githubmirror
/
immutable-js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/functional/hasIn.ts
17 строк
480 B
Julien Deniau
sort all imports via eslint
12 июн 2025, 01:23
12 июн 2025, 01:23
67a4fa9
Код
Авторство
О чём код?
import { NOT_SET } from '../TrieUtils'; import { getIn } from './getIn'; type GetInParameters = Parameters<typeof getIn>; /** * Returns true if the key path is defined in the provided collection. * * A functional alternative to `collection.hasIn(keypath)` which will also * work with plain Objects and Arrays. */ export function hasIn( collection: GetInParameters[0], keyPath: GetInParameters[1] ): boolean { return getIn(collection, keyPath, NOT_SET) !== NOT_SET; }