mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-20 13:14:44 +00:00
.
This commit is contained in:
parent
beb1329f9f
commit
2b95e76931
7736 changed files with 1874747 additions and 51184 deletions
31
node_modules/ts-jest/dist/util/sha1.js
generated
vendored
Normal file
31
node_modules/ts-jest/dist/util/sha1.js
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var crypto_1 = require("crypto");
|
||||
exports.cache = Object.create(null);
|
||||
function sha1() {
|
||||
var data = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
data[_i] = arguments[_i];
|
||||
}
|
||||
var canCache = data.length === 1 && typeof data[0] === 'string';
|
||||
var cacheKey;
|
||||
if (canCache) {
|
||||
cacheKey = data[0];
|
||||
if (cacheKey in exports.cache) {
|
||||
return exports.cache[cacheKey];
|
||||
}
|
||||
}
|
||||
var hash = crypto_1.createHash('sha1');
|
||||
data.forEach(function (item) {
|
||||
if (typeof item === 'string')
|
||||
hash.update(item, 'utf8');
|
||||
else
|
||||
hash.update(item);
|
||||
});
|
||||
var res = hash.digest('hex').toString();
|
||||
if (canCache) {
|
||||
exports.cache[cacheKey] = res;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
exports.sha1 = sha1;
|
Loading…
Add table
Add a link
Reference in a new issue