Converts tests to TypeScript (#300)

This commit is contained in:
Jaco Greeff
2019-02-14 10:48:08 +01:00
committed by GitHub
parent 2a14a8b553
commit 1e6eb2c283
158 changed files with 89 additions and 183 deletions
+1 -2
View File
@@ -6,7 +6,6 @@ import isHex from '../is/hex';
/**
* @name hexHasPrefix
* @signature hexHasPrefix (value: ?string): boolean
* @summary Tests for the existence of a `0x` prefix.
* @description
* Checks for a valid hex input value and if the start matched `0x`
@@ -19,6 +18,6 @@ import isHex from '../is/hex';
* console.log('has prefix', hexHasPrefix('0x1234')); // => true
* ```
*/
export default function hexHasPrefix (value: string | null | undefined): boolean {
export default function hexHasPrefix (value?: string | null): boolean {
return !!(value && isHex(value, -1, true) && value.substr(0, 2) === '0x');
}