INNER CODE UNIT · TypeScript
isBlurhashValid
margelo/react-native-blurhash · src/utils.ts:52
export function isBlurhashValid(blurhash: string): { isValid: true } | { isValid: false; errorReason: string } {
try {
validateBlurhash(blurhash);
} catch (error) {
const message = error instanceof Error ? error.message : JSON.stringify(error);
return { isValid: false, errorReason: message };
}
return { isValid: true };
}
const digitCharacters = [
'0',
'1',
'2',
'3',
'4',
'5',