isAddress/validateAddress functions (#946)
This commit is contained in:
@@ -11,6 +11,6 @@ export function testValidator (validate: (value?: string | null, ipfsCompat?: bo
|
||||
}
|
||||
}
|
||||
|
||||
export function isBase32 (value?: string | null, ipfsCompat?: boolean): boolean {
|
||||
export function isBase32 (value?: string | null, ipfsCompat?: boolean): value is string {
|
||||
return testValidator(base32Validate, value, ipfsCompat);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ const BASE_CONFIG = { alphabet: BASE32_ALPHABET, ipfsChar: 'b', type: 'base32' }
|
||||
* @name base32Validate
|
||||
* @summary Validates a base32 value.
|
||||
* @description
|
||||
* Validates the the supplied value is valid base32
|
||||
* Validates that the supplied value is valid base32
|
||||
*/
|
||||
export function base32Validate (value?: string | null, ipfsCompat?: boolean): true {
|
||||
export function base32Validate (value?: string | null, ipfsCompat?: boolean): value is string {
|
||||
return validateChars(BASE_CONFIG, value, ipfsCompat);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user