Converts tests to TypeScript (#300)
This commit is contained in:
@@ -6,7 +6,6 @@ import hasPrefix from './hasPrefix';
|
||||
|
||||
/**
|
||||
* @name hexAddPrefix
|
||||
* @signature hexAddPrefix (value: ?string): string
|
||||
* @summary Adds the `0x` prefix to string values.
|
||||
* @description
|
||||
* Returns a `0x` prefixed string from the input value. If the input is already prefixed, it is returned unchanged.
|
||||
@@ -19,7 +18,7 @@ import hasPrefix from './hasPrefix';
|
||||
* console.log('With prefix', hexAddPrefix('0a0b12')); // => 0x0a0b12
|
||||
* ```
|
||||
*/
|
||||
export default function hexAddPrefix (value: string | null | undefined): string {
|
||||
export default function hexAddPrefix (value?: string | null): string {
|
||||
if (value && hasPrefix(value)) {
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user