(url: string)
| 118 | } |
| 119 | } |
| 120 | getFileName(url: string) { |
| 121 | try { |
| 122 | const parsedURL = new URL(url); |
| 123 | const fileName = parsedURL.pathname.substring(1).replaceAll("/", "-"); |
| 124 | return fileName.at(-1) === "-" ? fileName.substring(0, fileName.length - 1) : fileName; |
| 125 | } catch (e: any) { |
| 126 | throw new Error("Error while getting file name: " + e.message); |
| 127 | } |
| 128 | } |
| 129 | /** |
| 130 | * @remarks |
| 131 | * This method is internally used to resize the image to the same size, incase the images are of different sizes. |
no outgoing calls
no test coverage detected