Skip to content
On this page

getFileType

Get file type.

Usage

ts
import { getFileType } from '@use-kit/functions'

const ret = getFileType('asuka.jpeg') // jpeg
const ret = getFileType('shiori.use.png') // png
const ret = getFileType('application/vnd.ms-powerpoint') // ppt
const ret = getFileType('application/json', false) // Json
import { getFileType } from '@use-kit/functions'

const ret = getFileType('asuka.jpeg') // jpeg
const ret = getFileType('shiori.use.png') // png
const ret = getFileType('application/vnd.ms-powerpoint') // ppt
const ret = getFileType('application/json', false) // Json

Released under the MIT License.