thi-ng/umbrella

View on GitHub
packages/file-io/src/ext.ts

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * Returns file extension of given file `path`.
 *
 * @param path
 */
export const fileExt = (path: string) => {
    const match = /\.(\w+)$/.exec(path);
    return match ? match[1].toLowerCase() : "";
};