Skip to content

Commit e25f7d2

Browse files
committed
refactor: use crypto.hash
1 parent 16ab827 commit e25f7d2

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

packages/plugin-vue-jsx/src/index.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -328,17 +328,8 @@ function isDefineComponentCall(
328328
)
329329
}
330330

331-
const hash =
332-
// eslint-disable-next-line n/no-unsupported-features/node-builtins -- crypto.hash is supported in Node 21.7.0+, 20.12.0+
333-
crypto.hash ??
334-
((
335-
algorithm: string,
336-
data: crypto.BinaryLike,
337-
outputEncoding: crypto.BinaryToTextEncoding,
338-
) => crypto.createHash(algorithm).update(data).digest(outputEncoding))
339-
340331
function getHash(text: string) {
341-
return hash('sha256', text, 'hex').substring(0, 8)
332+
return crypto.hash('sha256', text, 'hex').substring(0, 8)
342333
}
343334

344335
export default vueJsxPlugin

0 commit comments

Comments
 (0)