Adjust & dedupe global extraction tests (#1301)

This commit is contained in:
Jaco
2021-12-08 20:23:46 +02:00
committed by GitHub
parent 306e503d23
commit 8a6c8b64df
13 changed files with 40 additions and 57 deletions
+2 -6
View File
@@ -1,14 +1,10 @@
// Copyright 2017-2021 @polkadot/x-textencoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { xglobal } from '@polkadot/x-global';
import { extractGlobal } from '@polkadot/x-global';
import { TextDecoder as Fallback } from './fallback';
export { packageInfo } from './packageInfo';
export const TextDecoder = (
typeof xglobal.TextDecoder === 'undefined'
? Fallback as unknown as typeof xglobal.TextDecoder
: xglobal.TextDecoder
);
export const TextDecoder = extractGlobal('TextDecoder', Fallback);