cookie-parser
cookie-parser copied to clipboard
Refactor JSONCookie function for clarity and compliance
- Update JSDoc to clarify behavior and return types.
- Replace str.substr(0, 2) with str.startsWith to check for the prefix 'j:'.
- Simplify error handling by removing unused catch parameter.
- Maintain functionality for parsing JSON cookies, returning undefined for invalid inputs.
same as https://github.com/expressjs/cookie-parser/pull/119#issuecomment-2451729449