MCPcopy Index your code
hub / github.com/bitnbytesio/node-input-validator / isEmpty

Method isEmpty

lib/rules.js:22–34  ·  view source on GitHub ↗

* helper function - check if provided value is empty * @param value * @returns {Boolean}

(value)

Source from the content-addressed store, hash-verified

20 * @returns {Boolean}
21 */
22 isEmpty(value) {
23
24 if (typeof value === 'undefined') {
25 return true;
26 }
27
28 if (value === null) {
29 return true;
30 }
31
32 return !value.toString().trim();
33
34 }
35
36 /**
37 *

Callers 6

validateRequiredMethod · 0.95
validateRequiredIfMethod · 0.95
validateRequiredWithMethod · 0.95
validateSometimesMethod · 0.95
validateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected