joyent/node — Issue #2879: add assert.defined, assert.undefined, assert.null, assert.notnull
Author: ericstob
Created: 2012-03-05 21:08:25+00:00
State: open

please add the basic "existence" assertions
thank you!

assert.defined
throws only if value is undefined. (it will not throw on null, 0, or empty string)

assert.undefined
throws if value is defined, even if it is null, 0, or empty string.

assert.null
throws if value is undefined, or if it has a value.

assert.notnull
throws if value is undefined, or if it is null.