Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 5a61855

Browse files
committed
Fix types
1 parent 488a537 commit 5a61855

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

framework/core/routing.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ export class Routing {
6161

6262
config(options: RoutingOptions) {
6363
Object.keys(options).forEach((key) => {
64-
Object.assign(this, { ['_' + key]: options[key as keyof typeof options] })
64+
if ('_' + key in this) {
65+
Object.assign(this, { ['_' + key]: options[key as keyof typeof options] })
66+
}
6567
})
6668
}
6769

server/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { defaultReactVersion } from '../shared/constants.ts'
44
import { existsFileSync, existsDirSync } from '../shared/fs.ts'
55
import log from '../shared/log.ts'
66
import util from '../shared/util.ts'
7-
import type { Config, PostCSSPlugin, CSSOptions } from '../types.ts'
7+
import type { Config, CSSOptions, PostCSSPlugin } from '../types.ts'
88
import { getAlephPkgUri, reLocaleID } from './helper.ts'
99

1010
export interface RequiredConfig extends Required<Omit<Config, 'css'>> {
1111
react: ReactResolve,
12-
css: CSSOptions
12+
css: Required<CSSOptions>
1313
}
1414

1515
export const defaultConfig: Readonly<RequiredConfig> = {

types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export type Config = {
7373
/** `plugins` specifies some plugins for the appliaction. */
7474
plugins?: (LoaderPlugin | ServerPlugin)[]
7575
/** `css` specifies the css processing options. */
76-
css?: Partial<CSSOptions>
76+
css?: CSSOptions
7777
/** `headers` appends custom headers for server requests. */
7878
headers?: Record<string, string>
7979
/** `rewrites` specifies the server rewrite map. */
@@ -87,9 +87,9 @@ export type Config = {
8787
*/
8888
export type CSSOptions = {
8989
/** `module` enables the css module feature. */
90-
modules: false | CSSModulesOptions
90+
modules?: false | CSSModulesOptions
9191
/** `postcss` specifies the postcss plugins. */
92-
postcss: { plugins: PostCSSPlugin[] }
92+
postcss?: { plugins: PostCSSPlugin[] }
9393
}
9494

9595
/**

0 commit comments

Comments
 (0)