Example #1
0
	test('extname', () => {
		assert.equal(paths.extname('far.boo'), '.boo');
		assert.equal(paths.extname('far.b'), '.b');
		assert.equal(paths.extname('far.'), '.');
		assert.equal(paths.extname('far.boo/boo.far'), '.far');
		assert.equal(paths.extname('far.boo/boo'), '');
	});
Example #2
0
export function telemetryURIDescriptor(uri: URI, hashPath: (path: string) => string): URIDescriptor {
	const fsPath = uri && uri.fsPath;
	return fsPath ? { mimeType: guessMimeTypes(fsPath).join(', '), ext: paths.extname(fsPath), path: hashPath(fsPath) } : {};
}
Example #3
0
	public get fileExtname(): string {
		return Paths.extname(this.getFilePath());
	}
Example #4
0
export function getMediaMime(path: string): string | undefined {
	const ext = paths.extname(path);
	return mapExtToMediaMimes[ext.toLowerCase()];
}