UNPKG

@babylonjs/core

Version:

Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.

12 lines 486 B
/** * Gets the file extension from a URL. * @param url The URL to get the file extension from. * @returns The file extension, or an empty string if no extension is found. */ export function GetExtensionFromUrl(url) { const urlWithoutUriParams = url.split("?")[0]; const lastDot = urlWithoutUriParams.lastIndexOf("."); const extension = lastDot > -1 ? urlWithoutUriParams.substring(lastDot).toLowerCase() : ""; return extension; } //# sourceMappingURL=urlTools.js.map