Skip to content

Commit 234c12c

Browse files
committed
better naming (internal)
1 parent d7d3b45 commit 234c12c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

packages/core/tooling/js/vite.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,14 @@ function exportDefaultConfig(
1717
fallbackExpression = object.create({});
1818
}
1919

20-
const { value: _rootObject } = exports.createDefault(ast, { fallback: fallbackExpression });
20+
const { value } = exports.createDefault(ast, { fallback: fallbackExpression });
21+
22+
// Handle TypeScript satisfies expressions
23+
const rootObject = value.type === 'TSSatisfiesExpression' ? value.expression : value;
2124

2225
// Handle wrapper functions (e.g., defineConfig({})) if ignoreWrapper is specified
2326
let configObject: AstTypes.ObjectExpression;
2427

25-
// Handle TypeScript satisfies expressions
26-
let rootObject = _rootObject;
27-
if (_rootObject.type === 'TSSatisfiesExpression') {
28-
rootObject = _rootObject.expression;
29-
}
30-
3128
// Early bail-out: if no wrapper to ignore or not a call expression
3229
if (!ignoreWrapper || !('arguments' in rootObject) || !Array.isArray(rootObject.arguments)) {
3330
configObject = rootObject as unknown as AstTypes.ObjectExpression;

0 commit comments

Comments
 (0)