Use x-gobal in node polyfills

This commit is contained in:
Jaco Greeff
2021-01-24 16:39:22 +01:00
parent 354dd0a7a4
commit 437ff8b51d
5 changed files with 23 additions and 13 deletions
+5 -3
View File
@@ -3,6 +3,8 @@
import util from 'util';
export const TextDecoder = typeof global.TextDecoder === 'undefined'
? util.TextDecoder as unknown as typeof global.TextDecoder
: global.TextDecoder;
import { xglobal } from '@polkadot/x-global';
export const TextDecoder = typeof xglobal.TextDecoder === 'undefined'
? util.TextDecoder as unknown as typeof xglobal.TextDecoder
: xglobal.TextDecoder;