existential
Version:
The missing existential operator for JavaScript. Returns true unless a variable is null or undefined
14 lines (9 loc) • 325 B
text/coffeescript
existential = require '..'
should = require 'should'
describe 'Existential ::', ->
it 'compare with null', ->
(existential(null)).should.eql false
it 'compare with undefined', ->
(existential(undefined)).should.eql false
it 'compare with positive value', ->
(existential('string')).should.eql true