Skip to content

This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.

ConfigManager

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

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:661

ParameterType
configPartial<EngineConfig>

ConfigManager

get<T>(path): T;

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

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:737

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:760

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:696

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:744

Update multiple configuration values

ParameterType
configPartial<EngineConfig>

void


validate(): ValidationResult;

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

Validate configuration values

ValidationResult