-
Notifications
You must be signed in to change notification settings - Fork 4
Boolean
William edited this page Dec 4, 2018
·
1 revision
Boolean coerces the value passed into to be a Boolean.
const {
createModel,
datatypes: { boolean },
} = require('nativemodels');
const schema = {
isAwesome: boolean(),
};
const model = createModel(schema);
const user = model({
isAwesome: true, // 'true' or 1 would also return as true. Same as 0, undefined or null would be false
});