Files
bookhoard/internal/utils/isbn.go
T
john-okeefe dc820dfb92 cleanup: remove outdated documentation and summaries
- Remove API_TESTING_SUMMARY.md, IMPLEMENTATION_SUMMARY.md
- Remove MIGRATION_PROGRESS.md, SECURITY_*.md files
- Clean up temporary documentation files from previous sessions
- Repository now focused on current working code
2026-01-30 13:52:01 -05:00

17 lines
361 B
Go

package utils
import (
"regexp"
)
// NormalizeISBN removes hyphens and spaces from ISBN to standardize format
// Handles ISBN-10 and ISBN-13 formats
func NormalizeISBN(isbn string) string {
if isbn == "" {
return ""
}
// Remove hyphens and spaces, return only digits and X (for ISBN-10)
return regexp.MustCompile(`[-\s]`).ReplaceAllString(isbn, "")
}