Skip to content

Commit

Permalink
chore: Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpomeroy committed Dec 12, 2023
1 parent af1f452 commit bafa526
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/rrweb-snapshot/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,12 @@ export function getInputType(element: HTMLElement): Lowercase<string> | null {

/**
* Extracts the file extension from an a path, considering search parameters and fragments.
* @param path Path to file
* @param [baseURL] Base URL of the page, used to resolve relative paths. Defaults to current page URL.
* @param path - Path to file
* @param baseURL - [optional] Base URL of the page, used to resolve relative paths. Defaults to current page URL.
*/
export function extractFileExtension(path: string, baseURL?: string): string | null {
const url = new URL(path, baseURL ?? window.location.href);
const regex = /\.([0-9a-z]+)(?:[\?#]|$)/i;
const regex = /\.([0-9a-z]+)(?:[?#]|$)/i;
const match = url.pathname.match(regex);
console.log(url.pathname)
return match?.[1] ?? null;
Expand Down

0 comments on commit bafa526

Please sign in to comment.