Skip to content

Commit

Permalink
fix(isofshape): allow implicit undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebecca Stevens committed Jul 9, 2020
1 parent 9640d5e commit bb4fc93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function isOfShape<V extends Dict, T extends Shape<V> = Shape<V>> (shape:
const isNothingMissing = Object.keys(shape).every((key) => {
const keyGuard: any = (shape as any)[key]
if (typeof keyGuard == 'function') {
return key in input && (keyGuard as any)(input[key])
return (keyGuard as any)(input[key])
} else if (typeof keyGuard == 'object') {
return isOfShape(keyGuard, exact)(input[key])
}
Expand Down

0 comments on commit bb4fc93

Please sign in to comment.