copyWith method
BuildConfig
copyWith({
- String? rootDir,
- String? host,
- int? port,
- BuildTarget? target,
- String? routesDir,
- String? middlewareDir,
- String? publicDir,
- String? outputDir,
- bool? caseSensitive,
- Object? handlerCacheCapacity = _unset,
- ReloadStrategy? reload,
- Object? wranglerConfig = _unset,
- Object? openapi = _unset,
- Object? client = _unset,
Returns a copy with selected fields replaced.
Implementation
BuildConfig copyWith({
String? rootDir,
String? host,
int? port,
BuildTarget? target,
String? routesDir,
String? middlewareDir,
String? publicDir,
String? outputDir,
bool? caseSensitive,
Object? handlerCacheCapacity = _unset,
ReloadStrategy? reload,
Object? wranglerConfig = _unset,
Object? openapi = _unset,
Object? client = _unset,
}) {
return BuildConfig(
rootDir: rootDir ?? this.rootDir,
host: host ?? this.host,
port: port ?? this.port,
target: target ?? this.target,
routesDir: routesDir ?? this.routesDir,
middlewareDir: middlewareDir ?? this.middlewareDir,
publicDir: publicDir ?? this.publicDir,
outputDir: outputDir ?? this.outputDir,
caseSensitive: caseSensitive ?? this.caseSensitive,
handlerCacheCapacity: switch (handlerCacheCapacity) {
_Unset() => this.handlerCacheCapacity,
null => null,
int() when handlerCacheCapacity > 0 => handlerCacheCapacity,
_ => throw ArgumentError.value(
handlerCacheCapacity,
'handlerCacheCapacity',
'must be a positive integer or null',
),
},
reload: reload ?? this.reload,
wranglerConfig: switch (wranglerConfig) {
_Unset() => this.wranglerConfig,
String() => wranglerConfig,
null => null,
_ => throw ArgumentError.value(
wranglerConfig,
'wranglerConfig',
'must be a string or null',
),
},
openapi: _copyWithOpenApi(openapi, current: this.openapi),
client: _copyWithClient(client, current: this.client),
);
}