fix(lib-util): update js-sha256 import (#4699)
This commit is contained in:
parent
05588ebf9a
commit
60f7e0bba6
@ -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);
|
||||
|
@ -1,4 +0,0 @@
|
||||
declare module 'js-sha256' {
|
||||
const sha256: (reader: string | ArrayBuffer | null | undefined) => string;
|
||||
export default sha256;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user