Skip to content

Commit 9ae2459

Browse files
committed
refactor: remove trivial assertion
1 parent 37844ea commit 9ae2459

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/plugin-rsc/src/plugin.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,7 @@ function assetsURL(url: string) {
13121312
config.command === 'build' &&
13131313
typeof config.experimental?.renderBuiltUrl === 'function'
13141314
) {
1315+
// https://github.com/vitejs/vite/blob/bdde0f9e5077ca1a21a04eefc30abad055047226/packages/vite/src/node/build.ts#L1369
13151316
const result = config.experimental.renderBuiltUrl(url, {
13161317
type: 'asset',
13171318
hostType: 'js',
@@ -1328,11 +1329,7 @@ function assetsURL(url: string) {
13281329
'"result.relative" not supported on renderBuiltUrl() for RSC',
13291330
)
13301331
} else if (result) {
1331-
assert(
1332-
typeof result === 'string',
1333-
'"renderBuiltUrl" should return a string!',
1334-
)
1335-
return result
1332+
return result satisfies string
13361333
}
13371334
}
13381335

0 commit comments

Comments
 (0)