Settings Class
Settings
Gives easy access to a key value storage persisted in a single file.
Takes care of the validation of editor settings and constraint settings.
Item Index
Methods
Properties
Methods
check_loaded
()
If the storage is not loaded -> load it.
get
(
-
key -
fallback
Get the value of the key
Parameters:
-
keyString -
fallback
Returns:
:
get_settings_for_constraints
()
Get the constraint settings Settings._store.constraints
Returns:
:
get_settings_for_frontend
()
Returns the whole storage
Returns:
:
has
(
Boolean
-
key
Check whether the key carries data in the storage
Parameters:
-
keyString
Returns:
Boolean:
load
()
Loads the file
save
()
Saves the file
set
(
-
key -
value
Set the key to the value
Parameters:
-
keyString -
value
set_settings_from_frontend
(
-
new_settings
Check the values of the new settings and store them if they are okay
Parameters:
-
new_settings
Properties
_file_path
String
The path of the settings file
Default: path.join(__dirname, '../media/settings/settings.json')
_loaded
Boolean
Whether the in-memory-store was already populated
Default: false
_store
Object
In memory store
Default: {}
