Skip to content

BeechCMS


BeechCMS / @beechcms/core / isExtensionAccepted

Function: isExtensionAccepted() ​

isExtensionAccepted(ext, accept): boolean

Checks whether a given file extension satisfies an acceptance policy ('image' | 'document' | 'any').

Parameters ​

ext ​

string | null | undefined

The file extension.

accept ​

FileAccept

The acceptance mode.

Returns ​

boolean

True if accepted, false otherwise.