diff --git a/packages/validator/index.js b/packages/validator/index.js new file mode 100644 index 0000000..057e7ff --- /dev/null +++ b/packages/validator/index.js @@ -0,0 +1,5 @@ +/** + * Checks if given value is null or undefined or whitespace string + * @param {string?} value + */ +exports.isNullOrWhitespace = (value) => value === undefined || value === null || !value.trim(); diff --git a/packages/validator/package.json b/packages/validator/package.json new file mode 100644 index 0000000..9cc3b3a --- /dev/null +++ b/packages/validator/package.json @@ -0,0 +1,12 @@ +{ + "name": "@my-project/validator", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +}