Forked from joduplessis/cookie-typescript-utils.ts
Last active
October 6, 2020 17:02
-
-
Save Andromelus/4a6063edd927c59351b43fa1b3f57b94 to your computer and use it in GitHub Desktop.
Setting, deleting and retrieving cookies in Typescript.
Try adding a return after the if block to cover that case.
if (parts.length === 2) {
...return the good stuff....
}
return undefined; // or null or empty string or whatever you think is appropriate
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the same error, that original gist has
[tsl] ERROR in c:common\cookieUtils.ts(20,16)
TS2532: Object is possibly 'undefined'.