Skip to main content
Module

x/rambda/source/has.spec.js

Faster and smaller alternative to Ramda
Go to Latest
File
import {has} from './has'
test('happy', () => { expect(has('a')({a: 1})).toBeTrue() expect(has('b', {a: 1})).toBeFalse()})
test('with non-object', () => { expect(has('a', undefined)).toEqual(false) expect(has('a', null)).toEqual(false) expect(has('a', true)).toEqual(false) expect(has('a', '')).toEqual(false) expect(has('a', /a/)).toEqual(false)})