Skip to content

This site describes solve-engine 2.44.0, the version npm installs.

ConfigManager

Defined in: packages/engine/src/constants/Configuration.ts:680

Configuration manager for engine settings

const configManager = new ConfigManager();
configManager.set('performance.defaultCacheSize', 2000);
const cacheSize = configManager.get('performance.defaultCacheSize');
new ConfigManager(config?): ConfigManager;

Defined in: packages/engine/src/constants/Configuration.ts:683

ParameterType
config?Partial<EngineConfig>

ConfigManager

get<T>(path): T;

Defined in: packages/engine/src/constants/Configuration.ts:693

Get configuration value by path

Type Parameter
T
ParameterTypeDescription
pathstringDot-notation path to config value

T

Configuration value


getConfig(): EngineConfig;

Defined in: packages/engine/src/constants/Configuration.ts:759

Get complete configuration.

A detached copy, section objects included. A top-level spread would hand the caller this manager’s own section objects, so getConfig().vm.x = 1 would be an undeclared back door into set, bypassing its path validation and reaching every later get.

EngineConfig


reset(): void;

Defined in: packages/engine/src/constants/Configuration.ts:782

Reset to default configuration.

Goes through mergeEngineConfig for the same reason the constructor does. A top-level { ...DEFAULT_CONFIG } copies the six section references, not the sections, so after a reset this manager’s performance object WAS DEFAULT_CONFIG.performance and the next set('performance.x', ...) wrote into the module constant. That constant is what every ExpressionEngine is built from, so one manager’s reset could change the cache size, instruction ceiling or allocation budget of every engine constructed later in the process.

void


set<T>(path, value): void;

Defined in: packages/engine/src/constants/Configuration.ts:718

Set configuration value by path

Type Parameter
T
ParameterTypeDescription
pathstringDot-notation path to config value
valueTNew value

void


update(config): void;

Defined in: packages/engine/src/constants/Configuration.ts:766

Update multiple configuration values

ParameterType
configPartial<EngineConfig>

void


validate(): ValidationResult;

Defined in: packages/engine/src/constants/Configuration.ts:789

Validate configuration values

ValidationResult