Skip to content

Commit ce23149

Browse files
committed
πŸ› Check for undefined instead of falsy
1 parent f40d15c commit ce23149

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

β€Žlib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ var getInput = function (key, opts) {
7171
if (options.disableable && val === 'false')
7272
return undefined;
7373
var parsed = val !== undefined ? parseValue(val, options.type) : undefined;
74-
if (!parsed) {
74+
if (parsed === undefined) {
7575
if (options.required)
7676
throw new Error("Input `" + options.key + "` is required but was not provided.");
77-
if (options.default)
77+
if (options.default !== undefined)
7878
return options.default;
7979
return undefined;
8080
}

β€Žsrc/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ export const getInput = (key: string | IOpts, opts: IOpts): InputValue => {
7171
if (options.disableable && val === 'false') return undefined
7272

7373
const parsed: InputValue = val !== undefined ? parseValue(val, options.type) : undefined
74-
if (!parsed) {
74+
if (parsed === undefined) {
7575
if (options.required) throw new Error(`Input \`${ options.key }\` is required but was not provided.`)
76-
if (options.default) return options.default
76+
if (options.default !== undefined) return options.default
7777

7878
return undefined
7979
}

0 commit comments

Comments
Β (0)