@@ -95,8 +95,8 @@ function trim(arr: string[]): string[] {
9595/** JSDoc */
9696export function relative ( from : string , to : string ) : string {
9797 /* eslint-disable no-param-reassign */
98- from = resolve ( from ) . substr ( 1 ) ;
99- to = resolve ( to ) . substr ( 1 ) ;
98+ from = resolve ( from ) . slice ( 1 ) ;
99+ to = resolve ( to ) . slice ( 1 ) ;
100100 /* eslint-enable no-param-reassign */
101101
102102 const fromParts = trim ( from . split ( '/' ) ) ;
@@ -126,7 +126,7 @@ export function relative(from: string, to: string): string {
126126/** JSDoc */
127127export function normalizePath ( path : string ) : string {
128128 const isPathAbsolute = isAbsolute ( path ) ;
129- const trailingSlash = path . substr ( - 1 ) === '/' ;
129+ const trailingSlash = path . slice ( - 1 ) === '/' ;
130130
131131 // Normalize the path
132132 let normalizedPath = normalizeArray (
@@ -169,7 +169,7 @@ export function dirname(path: string): string {
169169
170170 if ( dir ) {
171171 // It has a dirname, strip trailing slash
172- dir = dir . substr ( 0 , dir . length - 1 ) ;
172+ dir = dir . slice ( 0 , dir . length - 1 ) ;
173173 }
174174
175175 return root + dir ;
@@ -178,8 +178,8 @@ export function dirname(path: string): string {
178178/** JSDoc */
179179export function basename ( path : string , ext ?: string ) : string {
180180 let f = splitPath ( path ) [ 2 ] ;
181- if ( ext && f . substr ( ext . length * - 1 ) === ext ) {
182- f = f . substr ( 0 , f . length - ext . length ) ;
181+ if ( ext && f . slice ( ext . length * - 1 ) === ext ) {
182+ f = f . slice ( 0 , f . length - ext . length ) ;
183183 }
184184 return f ;
185185}
0 commit comments