Toba Node Tools
npm install @toba/node-tools

!Code style



ts
import { is } from '@toba/tools';
`
Identity checks evaluate whether a variable is of a given type. All return true or false. Where possible, they implement TypeScript type guards so the value is thereafter recognized as a particular type.
#### value
`ts
is.value(x);
`
Whether x is not undefined and not null.
The parameter is generic so the variable may thereafter be recognized as that type. For example, if is.value evaluates true then TypeScript will also know to treat var as a string.
#### empty
`ts
is.empty(x);
`
Whether x is undefined, null or an empty string ("").
#### defined
`ts
is.defined(x, name);
`
Whether name is a property of the object x`.