PWA
CI / build (push) Has been skipped
CI / deploy (push) Successful in 1m31s

This commit is contained in:
eewing
2026-02-18 11:45:07 -06:00
parent 6167c760a1
commit f6d0c065a4
11032 changed files with 875000 additions and 134771 deletions
+24
View File
@@ -0,0 +1,24 @@
/*
Copyright 2018 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
import fse from 'fs-extra';
import {getStringHash} from './get-string-hash';
import {errors} from './errors';
export function getFileHash(file: string): string {
try {
const buffer = fse.readFileSync(file);
return getStringHash(buffer);
} catch (err) {
throw new Error(
errors['unable-to-get-file-hash'] +
` '${err instanceof Error && err.message ? err.message : ''}'`,
);
}
}