Skip to content

Commit

Permalink
fix: fix config parsing when using objects in allowlist (#289)
Browse files Browse the repository at this point in the history
Fixes #288
  • Loading branch information
kyletsang authored Dec 15, 2022
1 parent db3efb2 commit acabc36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ function mapArgvToAuditCiConfig(argv: AuditCiPreprocessedConfig) {
export async function runYargs(): Promise<AuditCiConfig> {
const { argv } = config("config", (configPath) =>
// Supports JSON, JSONC, & JSON5
parse(readFileSync(configPath, "utf8"))
parse(readFileSync(configPath, "utf8"), {
// When passing an allowlist using NSRecord syntax, yargs will throw an error
// "Invalid JSON config file". We need to add this flag to prevent that.
null_prototype: false,
})
)
.options({
l: {
Expand Down

0 comments on commit acabc36

Please sign in to comment.