mirror of
https://github.com/strapi/strapi.git
synced 2025-11-10 07:10:11 +00:00
7 lines
239 B
TypeScript
7 lines
239 B
TypeScript
|
|
/**
|
||
|
|
* Get the file extension of value passed in.
|
||
|
|
*
|
||
|
|
* This hook is used to create URL aware of the backend. Practical to resolve assets.
|
||
|
|
*/
|
||
|
|
export const getFileExtension = (ext: string) => (ext && ext[0] === '.' ? ext.substr(1) : ext);
|