Adjust isHex with template return (#1103)

* Adjust isHex with template return

* Unneeded assignment

* CHANGELOG

* typo

* Additional HexString types

* Additional HexString inputs

* Use U8aLike as applicable

* typo

* Unneeded type

* HexString outputs

* Export types
This commit is contained in:
Jaco
2021-09-08 14:38:53 +02:00
committed by GitHub
parent 6b9b7fa7f5
commit 9fc57a23e8
71 changed files with 233 additions and 122 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
// Copyright 2017-2021 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '../types';
import { u8aToHex } from '../u8a/toHex';
import { stringToU8a } from './toU8a';
@@ -19,7 +21,7 @@ import { stringToU8a } from './toU8a';
* ```
*/
// eslint-disable-next-line @typescript-eslint/ban-types
export function stringToHex (value?: String | string): string {
export function stringToHex (value?: String | string): HexString {
return u8aToHex(
stringToU8a(value)
);