repo.or.cz
/
ProtonMail-WebClient.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge branch 'renovate/all-minor-patch' into 'main'
[ProtonMail-WebClient.git]
/
packages
/
wallet
/
tests
/
utils
/
wasm.ts
blob
68cdc4290e46959e7bd07d1400502a65e7947b48
1
type FreeableEntity<T> = T & { free: (...args: any[]) => any };
2
3
/**
4
* Used to bypass typecheck as Wasm classes come with a free() method
5
*/
6
export const freeable = <T>(e: T): FreeableEntity<T> => {
7
const f = e as FreeableEntity<T>;
8
f.free = vi.fn();
9
return f;
10
};