toshirot / mychat

chat on Elysia
MIT License
0 stars 0 forks source link

Fix code scanning alert - Useless regular-expression character escape #3

Closed toshirot closed 8 months ago

toshirot commented 8 months ago

Tracking issue for:

fixed

  export function getCookie(key: string) {
      let regex = new RegExp('(?:^|;)\\s*' + key + '=([^;]+)');
      return decodeURIComponent(document.cookie.match(regex)?.[1] || '');
  }