Skip to content

Commit

Permalink
chore: replace deprecated String.prototype.substr()
Browse files Browse the repository at this point in the history
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated
Signed-off-by: Tobias Speicher <[email protected]>
  • Loading branch information
CommanderRoot committed Mar 18, 2022
1 parent e138fc3 commit 66de1a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cases/esbuild-three/src/base/loaders/ImageLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ImageLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
image.addEventListener( 'load', onImageLoad, false );
image.addEventListener( 'error', onImageError, false );

if ( url.substr( 0, 5 ) !== 'data:' ) {
if ( url.slice( 0, 5 ) !== 'data:' ) {

if ( this.crossOrigin !== undefined ) image.crossOrigin = this.crossOrigin;

Expand Down
2 changes: 1 addition & 1 deletion cases/esbuild-three/src/base/loaders/LoaderUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var LoaderUtils = {

if ( index === - 1 ) return './';

return url.substr( 0, index + 1 );
return url.slice( 0, index + 1 );

}

Expand Down

0 comments on commit 66de1a2

Please sign in to comment.