mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-11-14 02:37:06 +00:00
Move to @pezkuwi/dev 0.86 (eslint 10 toolchain)
- @pezkuwi/dev, dev-test, dev-ts ^0.86.3 - rethrown errors carry the original as `cause` (hw-ledger, address decode) - optional chain in isEthereumAddress, includes() in bip39 validation - logger calls the lazy formatter through a typed function - x-global: an assertion to the type the value already has removed, with the comment and directive that explained it - type-only re-exports of modules that emit no JavaScript - disable directives renamed for the new rule names, or removed where the rule no longer reports
This commit is contained in:
1 parent
82d6a12c24
commit
c46ce1a9e6
23 files changed
+2630
-3264
No files matched your search
@@ -48,13 +48,9 @@ export const xglobal = /*#__PURE__*/ (
|
||||
* Extracts a known global from the environment, applying a fallback if not found
|
||||
*/
|
||||
export function extractGlobal <N extends GlobalNames, T extends GlobalType<N>> (name: N, fallback: unknown): T {
|
||||
// Not quite sure why this is here - snuck in with TS 4.7.2 with no real idea
|
||||
// (as of now) as to why this looks like an "any" when we do cast it to a T
|
||||
//
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return typeof xglobal[name] === 'undefined'
|
||||
? fallback as T
|
||||
: xglobal[name] as T;
|
||||
: xglobal[name];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user