Skip to content

Commit

Permalink
restore support for 14.latest and 16.latest
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jul 8, 2024
1 parent ed49067 commit 4b77328
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@isaacs/cliui": "^8.0.2"
},
"engines": {
"node": ">=18"
"node": "14 >=14.21 || 16 >=16.20 || >=18"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ export class Jack<C extends ConfigSet = {}> {
cause = { name: field, found: value, validOptions: validOptions }
}
if (valid && !valid(value)) {
cause ??= { name: field, found: value }
cause = cause || { name: field, found: value }
}
if (cause) {
throw new Error(
Expand Down Expand Up @@ -982,7 +982,7 @@ export class Jack<C extends ConfigSet = {}> {
}
}
if (config.validate && !config.validate(value)) {
cause ??= { name: field, found: value }
cause = cause || { name: field, found: value }
}
if (cause) {
throw new Error(`Invalid config value for ${field}: ${value}`, {
Expand Down

0 comments on commit 4b77328

Please sign in to comment.