if-empty
If
value
(second argument) is empty returnreason
(first argument) otherwise returntrue
Install
npm install --save if-empty
Usage
; ; // "You have to provide name"; // true, `value` is not empty
Also useful for validating inquirer prompts, as well as yeoman prompts
; inquirerprompt name: 'name' message: '☯ your name:' validate: // curried { console;};
API
ifEmpty(reason, value)
// ifEmpty :: String -> String -> true | String`
reason
Required
Type: String
Reason for invalid value.
value
Required
Type: String
Value to validate.
License
MIT © Vladimir Starkov