/
githubmirror
/
immutable-js
Обзор
Документация
Войти
/
githubmirror
/
immutable-js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v4.3.8
src/functional/get.js
12 строк
351 B
Lee Byron
Upgrade Prettier (#1817)
18 июн 2021, 02:30
Не верифицирован
18 июн 2021, 02:30
c02d769
Код
Авторство
О чём код?
import { isImmutable } from '../predicates/isImmutable'; import { has } from './has'; export function get(collection, key, notSetValue) { return isImmutable(collection) ? collection.get(key, notSetValue) : !has(collection, key) ? notSetValue : typeof collection.get === 'function' ? collection.get(key) : collection[key]; }