feat(cli): 🔥 add regex expression in addKeyworkd

This commit is contained in:
Leifer Jesús Mendez
2023-02-04 17:01:10 +01:00
parent c0113ca492
commit e34560c77d
3 changed files with 62 additions and 9 deletions

View File

@@ -8,12 +8,14 @@ const { toJson } = require('./toJson')
* @param {*} options {sensitive:boolean} default false
*/
const addKeyword = (keyword, options) => {
if (typeof keyword !== 'string' && !Array.isArray(keyword)) {
throw new Error('DEBE_SER_STRING_ARRAY_REGEX')
}
const parseOptions = () => {
const defaultProperties = {
sensitive:
typeof options?.sensitive === 'boolean'
? options?.sensitive
: false,
sensitive: typeof options?.sensitive === 'boolean' ? options?.sensitive : false,
regex: typeof options?.regex === 'boolean' ? options?.regex : false,
}
return defaultProperties