Skip to content

Commit 621ede0

Browse files
committed
perf: add getCacheKey function
1 parent e60a6c3 commit 621ede0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

jest-vue.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const process = require('./lib/process')
2+
const getCacheKey = require('./lib/get_cache_key')
23

34
module.exports = {
4-
process: process
5+
process: process,
6+
getCacheKey: getCacheKey
57
}

lib/get_cache_key.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var crypto = require('crypto')
2+
3+
function getCacheKey (fileData, filename, configString) {
4+
return crypto.createHash('md5')
5+
.update(fileData + filePath + configString, 'utf8')
6+
.digest('hex')
7+
}

0 commit comments

Comments
 (0)