Skip to content

Instantly share code, notes, and snippets.

@Andromelus
Forked from joduplessis/cookie-typescript-utils.ts
Last active October 6, 2020 17:02
Show Gist options
  • Save Andromelus/4a6063edd927c59351b43fa1b3f57b94 to your computer and use it in GitHub Desktop.
Save Andromelus/4a6063edd927c59351b43fa1b3f57b94 to your computer and use it in GitHub Desktop.
Setting, deleting and retrieving cookies in Typescript.
@btwatts
Copy link

btwatts commented Oct 6, 2020

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