Skip to content

PersistentAI API Documentation / @persistentai/fireflow-types / isTextContentType

Function: isTextContentType()

isTextContentType(contentType): boolean

Defined in: packages/fireflow-types/src/constants/content-types.ts:56

Check if a content type is text-based and can be read as a string.

Parameters

contentType

string

The MIME type to check (may include charset suffix)

Returns

boolean

true if the content type is text-based

Example

ts
isTextContentType('application/json') // true
isTextContentType('text/plain; charset=utf-8') // true
isTextContentType('image/png') // false

Licensed under BUSL-1.1