Closed PopGoesTheWza closed 4 years ago
In ˋREADME.mdˋ where the ˋcontextˋ option is described, sample code seems to have a logic error:
ˋˋˋjs if (!options.context && !options.context.token) { throw new Error('Token required'); } ˋˋˋ
Here !A && !B should be either !(A && B) or !A || !B.
Perhaps ˋ!options?.context?.tokenˋ would be valid too but awkward in the context of simple sample code.
n.a.
Using Typescript, the code below is obviously wrong with the second term having the type ˋneverˋ
if (!options.context && !options.context.token) { throw new Error('Token required'); }
Good catch!
Describe the bug
In ˋREADME.mdˋ where the ˋcontextˋ option is described, sample code seems to have a logic error:
ˋˋˋjs if (!options.context && !options.context.token) { throw new Error('Token required'); } ˋˋˋ
Here !A && !B should be either !(A && B) or !A || !B.
Perhaps ˋ!options?.context?.tokenˋ would be valid too but awkward in the context of simple sample code.
Actual behavior
n.a.
Expected behavior
n.a.
Code to reproduce
Using Typescript, the code below is obviously wrong with the second term having the type ˋneverˋ
Checklist