glob-option-error
Create an error from the result of validate-glob-opts
const GlobOptionError = require('glob-option-error');
const validateGlobOpts = require('validate-glob-opts');
new GlobOptionError(validateGlobOpts({
sync: true,
mark: '/',
caches: {}
}));
Installation
Use npm.
npm install glob-option-error
API
const GlobOptionError = require('glob-option-error');
GlobOptionError(array)
array: Array<error>
(return value of validate-glob-opts)
Return: Error
with an iterator that returns the individual errors one by one
const GlobOptionError = require('glob-option-error');
const validateGlobOpts = require('validate-glob-opts');
const results = validateGlobOpts({
root: Buffer.from('Hi'),
nodir: NaN,
ignore: ['path1', 1]
});
const error = new GlobOptionError(results);
for (const {message} of error) {
console.log(message);
}
The argument must include at least one element.
new GlobOptionError([]);
License
Copyright (c) 2017 Shinnosuke Watanabe
Licensed under the MIT License.