Bluesky app fork with some witchin' additions 馃挮 witchsky.app
bluesky fork client
119
fork

Configure Feed

Select the types of activity you want to include in your feed.

at a876aae44ea07494ebea9727350aa060b81f317b 19 lines 474 B view raw
1// Regex for base32 string for testing reset code 2const RESET_CODE_REGEX = /^[A-Z2-7]{5}-[A-Z2-7]{5}$/ 3 4export function checkAndFormatResetCode(code: string): string | false { 5 // Trim the reset code 6 let fixed = code.trim().toUpperCase() 7 8 // Add a dash if needed 9 if (fixed.length === 10) { 10 fixed = `${fixed.slice(0, 5)}-${fixed.slice(5, 10)}` 11 } 12 13 // Check that it is a valid format 14 if (!RESET_CODE_REGEX.test(fixed)) { 15 return false 16 } 17 18 return fixed 19}