Skip to main content

Function: parseSettingsFile()

parseSettingsFile(text, author?): AppSettings

Defined in: src/lib/settings/index.ts:246

Read the app settings in an app settings file. Settings files from before versioned schemas (format, version: 1 and settings, of any format name) and of version 1 are read too, with their assets upgraded (see upgradeSettings). Throws an AssetFileError: read if it isn't JSON, invalid if it isn't a settings file or doesn't match its schema, unsupported if it's a version the app can't read.

Parameters​

text​

string

author?​

AssetAuthor

the author of older assets with none

Returns​

AppSettings

Example​

await applySettings(canvas, parseSettingsFile(text, canvas.author));