extensions/json-language-features/server/src/requests.ts/extname
export function extname(uri: string) {
	for (let i = uri.length - 1; i >= 0; i--) {
		const ch = uri.charCodeAt(i);
		if (ch === Dot) {
			if (i > 0 && uri.charCodeAt(i - 1) !== Slash) {
				return uri.substr(i);
			} else {
				break;
			}
		} else if (ch === Slash) {
			break;
		}
	}
	return '';
}