/**
 *
 * @param {string} url
 * @return {String|null}
 */
export function assetTypeByPath(url) {
    //get extension
    const dotPosition = url.lastIndexOf(".");
    if (dotPosition === -1) {
        console.warn(`No model extension could be deduced for URL: '${url}'`);
        //no extension
        return null;
    } else {
        //retrieve extension
        const ext = url.substring(dotPosition + 1);
        switch (ext) {
            case "json":
                return "three.js";
            case "glb":
                return "model/gltf";
            case "gltf":
                return "model/gltf+json";
            default:
                console.warn(`Unknown 3d mesh format extension: '${ext}'`);
                return null;
        }
    }
}
