emibcn / service-worker-updater

Prefer the usage of regular expression literals over the RegExp constructor JS-0115
Anti-pattern
Minor
6 months ago6 months old
Use a regular expression literal instead of the 'RegExp' constructor
27// Set up App Shell-style routing, so that all navigation requests
28// are fulfilled with your index.html shell. Learn more at
29// https://developers.google.com/web/fundamentals/architecture/app-shell
30const fileExtensionRegexp = new RegExp('/[^/?]+\\.[^/]+$')31registerRoute(
32  // Return false to exempt requests from being fulfilled by index.html.
33  ({ request, url }: { request: Request; url: URL }) => {