Skip to content

Commit

Permalink
chore: deprecated substr (#5917)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea authored Dec 1, 2021
1 parent efec70f commit 08a1ec7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/optimizer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export async function optimizeDeps(
data.browserHash = createHash('sha256')
.update(data.hash + JSON.stringify(deps))
.digest('hex')
.substr(0, 8)
.substring(0, 8)

const missingIds = Object.keys(missing)
if (missingIds.length) {
Expand Down Expand Up @@ -408,5 +408,5 @@ function getDepHash(root: string, config: ResolvedConfig): string {
return value
}
)
return createHash('sha256').update(content).digest('hex').substr(0, 8)
return createHash('sha256').update(content).digest('hex').substring(0, 8)
}
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export function assetFileNamesToFileName(
// placeholders for `assetFileNames`
// `hash` is slightly different from the rollup's one
const extname = path.extname(basename)
const ext = extname.substr(1)
const ext = extname.substring(1)
const name = basename.slice(0, -extname.length)
const hash = contentHash

Expand Down

0 comments on commit 08a1ec7

Please sign in to comment.