Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2024-08-26 17:13:37 +00:00
parent fa428daf9c
commit b3bf514df4
216 changed files with 4342 additions and 1611 deletions

View file

@ -11,6 +11,7 @@ const createHash = require('crypto').createHash;
const stringify = JSON.stringify;
/** @type {import('./hash').default} */
function hashify(value, hash) {
if (!hash) { hash = createHash('sha256'); }
@ -26,6 +27,7 @@ function hashify(value, hash) {
}
exports.default = hashify;
/** @type {import('./hash').hashArray} */
function hashArray(array, hash) {
if (!hash) { hash = createHash('sha256'); }
@ -41,13 +43,15 @@ function hashArray(array, hash) {
hashify.array = hashArray;
exports.hashArray = hashArray;
function hashObject(object, hash) {
if (!hash) { hash = createHash('sha256'); }
/** @type {import('./hash').hashObject} */
function hashObject(object, optionalHash) {
const hash = optionalHash || createHash('sha256');
hash.update('{');
Object.keys(object).sort().forEach((key) => {
hash.update(stringify(key));
hash.update(':');
// @ts-expect-error the key is guaranteed to exist on the object here
hashify(object[key], hash);
hash.update(',');
});