File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ const profileIndex = process.argv.indexOf('--profile')
2424
2525if ( debugIndex > 0 ) {
2626 let value = process . argv [ debugIndex + 1 ]
27- if ( ! value || value . startsWith ( '-' ) ) {
27+ if ( ! value || value [ 0 ] === '-' ) {
2828 value = 'vite:*'
2929 } else {
3030 // support debugging multiple flags with comma-separated list
@@ -39,7 +39,7 @@ if (debugIndex > 0) {
3939
4040 if ( filterIndex > 0 ) {
4141 const filter = process . argv [ filterIndex + 1 ]
42- if ( filter && ! filter . startsWith ( '-' ) ) {
42+ if ( filter && filter [ 0 ] !== '-' ) {
4343 process . env . VITE_DEBUG_FILTER = filter
4444 }
4545 }
@@ -65,7 +65,7 @@ function start() {
6565if ( profileIndex > 0 ) {
6666 process . argv . splice ( profileIndex , 1 )
6767 const next = process . argv [ profileIndex ]
68- if ( next && ! next . startsWith ( '-' ) ) {
68+ if ( next && next [ 0 ] !== '-' ) {
6969 process . argv . splice ( profileIndex , 1 )
7070 }
7171 const inspector = await import ( 'node:inspector' ) . then ( ( r ) => r . default )
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ export function assetImportMetaUrlPlugin(config: ResolvedConfig): Plugin {
8787 const templateLiteral = ( ast as any ) . body [ 0 ] . expression
8888 if ( templateLiteral . expressions . length ) {
8989 const pattern = buildGlobPattern ( templateLiteral )
90- if ( pattern . startsWith ( '*' ) ) {
90+ if ( pattern [ 0 ] === '*' ) {
9191 // don't transform for patterns like this
9292 // because users won't intend to do that in most cases
9393 continue
Original file line number Diff line number Diff line change @@ -626,7 +626,7 @@ export async function toAbsoluteGlob(
626626 root = globSafePath ( root )
627627 let dir
628628 if ( base ) {
629- if ( base . startsWith ( '/' ) ) {
629+ if ( base [ 0 ] === '/' ) {
630630 dir = posix . join ( root , base )
631631 } else {
632632 dir = posix . resolve (
Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ export function transformMiddleware(
228228 const result = await environment . transformRequest ( url , {
229229 allowId ( id ) {
230230 return (
231- id . startsWith ( '\0' ) ||
231+ id [ 0 ] === '\0' ||
232232 ! isServerAccessDeniedForTransform ( server . config , id )
233233 )
234234 } ,
You can’t perform that action at this time.
0 commit comments