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')
24
24
25
25
if ( debugIndex > 0 ) {
26
26
let value = process . argv [ debugIndex + 1 ]
27
- if ( ! value || value . startsWith ( '-' ) ) {
27
+ if ( ! value || value [ 0 ] === '-' ) {
28
28
value = 'vite:*'
29
29
} else {
30
30
// support debugging multiple flags with comma-separated list
@@ -39,7 +39,7 @@ if (debugIndex > 0) {
39
39
40
40
if ( filterIndex > 0 ) {
41
41
const filter = process . argv [ filterIndex + 1 ]
42
- if ( filter && ! filter . startsWith ( '-' ) ) {
42
+ if ( filter && filter [ 0 ] !== '-' ) {
43
43
process . env . VITE_DEBUG_FILTER = filter
44
44
}
45
45
}
@@ -65,7 +65,7 @@ function start() {
65
65
if ( profileIndex > 0 ) {
66
66
process . argv . splice ( profileIndex , 1 )
67
67
const next = process . argv [ profileIndex ]
68
- if ( next && ! next . startsWith ( '-' ) ) {
68
+ if ( next && next [ 0 ] !== '-' ) {
69
69
process . argv . splice ( profileIndex , 1 )
70
70
}
71
71
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 {
87
87
const templateLiteral = ( ast as any ) . body [ 0 ] . expression
88
88
if ( templateLiteral . expressions . length ) {
89
89
const pattern = buildGlobPattern ( templateLiteral )
90
- if ( pattern . startsWith ( '*' ) ) {
90
+ if ( pattern [ 0 ] === '*' ) {
91
91
// don't transform for patterns like this
92
92
// because users won't intend to do that in most cases
93
93
continue
Original file line number Diff line number Diff line change @@ -626,7 +626,7 @@ export async function toAbsoluteGlob(
626
626
root = globSafePath ( root )
627
627
let dir
628
628
if ( base ) {
629
- if ( base . startsWith ( '/' ) ) {
629
+ if ( base [ 0 ] === '/' ) {
630
630
dir = posix . join ( root , base )
631
631
} else {
632
632
dir = posix . resolve (
Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ export function transformMiddleware(
228
228
const result = await environment . transformRequest ( url , {
229
229
allowId ( id ) {
230
230
return (
231
- id . startsWith ( '\0' ) ||
231
+ id [ 0 ] === '\0' ||
232
232
! isServerAccessDeniedForTransform ( server . config , id )
233
233
)
234
234
} ,
You can’t perform that action at this time.
0 commit comments