fix(lib-util): update js-sha256 import (#4699)

This commit is contained in:
pz-mxu 2020-12-13 15:09:51 +01:00 committed by GitHub
parent 05588ebf9a
commit 60f7e0bba6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -1,9 +1,9 @@
import sha256 from 'js-sha256';
import { sha256 } from 'js-sha256';
export default (blob: Blob): Promise<string> =>
new Promise((resolve, reject) => {
const fr = new FileReader();
fr.onload = ({ target }) => resolve(sha256(target?.result));
fr.onload = ({ target }) => resolve(sha256(target?.result || ''));
fr.onerror = err => {
fr.abort();
reject(err);

View File

@ -1,4 +0,0 @@
declare module 'js-sha256' {
const sha256: (reader: string | ArrayBuffer | null | undefined) => string;
export default sha256;
}