Skip to main content
Module

x/rambda/hasPath-spec.ts

Faster and smaller alternative to Ramda
Go to Latest
File
import {hasPath} from 'rambda'
describe('R.hasPath', () => { it('string path', () => { const obj = {a: {b: 1}} const result = hasPath('a.b', obj) const curriedResult = hasPath('a.c')(obj) result // $ExpectType boolean curriedResult // $ExpectType boolean }) it('array path', () => { const obj = {a: {b: 1}} const result = hasPath(['a', 'b'], obj) const curriedResult = hasPath(['a', 'c'])(obj) result // $ExpectType boolean curriedResult // $ExpectType boolean })})