File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1850,7 +1850,7 @@ function buildRenderOptions(
1850
1850
options ?: PartialRenderOptions
1851
1851
) : RenderOptions {
1852
1852
let isDefaultRender = ! nameOrOptions && ! options ;
1853
- let _name ;
1853
+ let _name : string ;
1854
1854
if ( ! isDefaultRender ) {
1855
1855
if ( typeof nameOrOptions === 'object' && ! options ) {
1856
1856
_name = route . templateName || route . routeName ;
@@ -1860,7 +1860,11 @@ function buildRenderOptions(
1860
1860
'The name in the given arguments is undefined or empty string' ,
1861
1861
! isEmpty ( nameOrOptions )
1862
1862
) ;
1863
- _name = nameOrOptions ! ;
1863
+ // SAFETY: the check for `nameOrOptions` above should be validating this,
1864
+ // and as of TS 5.1.0-dev.2023-0417 it is *not*. This cast can go away if
1865
+ // TS validates it correctly *or* if we refactor this entire function to
1866
+ // be less wildly dynamic in its argument handling.
1867
+ _name = nameOrOptions as string ;
1864
1868
}
1865
1869
}
1866
1870
assert (
You can’t perform that action at this time.
0 commit comments