json-reporter
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -13,2 +13,14 @@ 'use strict'; | ||
const isRequestedType = (name, validationFn, type) => { | ||
return (v) => { | ||
if (!validationFn(v)) { | ||
throw new Error(`"${name}" option must be ${type}, but got ${typeof v}`); | ||
} | ||
}; | ||
}; | ||
const isBoolean = (name) => isRequestedType(name, _.isBoolean, 'boolean'); | ||
const isString = (name) => isRequestedType(name, _.isString, 'string'); | ||
const getParser = () => { | ||
@@ -19,7 +31,8 @@ return root(section({ | ||
parseEnv: JSON.parse, | ||
validate: _.isBoolean | ||
parseCli: JSON.parse, | ||
validate: isBoolean('enabled') | ||
}), | ||
path: option({ | ||
defaultValue: 'json-reporter.json', | ||
validate: _.isString | ||
validate: isString('path') | ||
}) | ||
@@ -26,0 +39,0 @@ }), {envPrefix: ENV_PREFIX, cliPrefix: CLI_PREFIX}); |
{ | ||
"name": "json-reporter", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Common plugin for gemini and hermione which is intended to aggregate the results of tests running", | ||
@@ -5,0 +5,0 @@ "main": "gemini.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
16629
232