Namespace: FILE#

contents.FILE

A namespace for file constructs.

Functions#

getType#

getType(ext, defaultType?): string

Get a mimetype (or fallback).

Parameters#

Name

Type

ext

string

defaultType?

null | string

Returns#

string

Defined in#

packages/contents/lib/tokens.d.ts:121


hasFormat#

hasFormat(ext, fileFormat): boolean

Determine whether the given extension matches a given fileFormat.

Parameters#

Name

Type

ext

string

fileFormat

"json" | "text" | "base64"

Returns#

boolean

Defined in#

packages/contents/lib/tokens.d.ts:125