UNPKG

@amjur/courts-db-ts

Version:

TypeScript port of the Python courts-db library for legal court identification

11 lines (10 loc) 322 B
/** * Remove extra whitespace from court string. * @param courtStr - The court string * @returns The court string without extra whitespace */ export function stripPunc(courtStr) { // Combined whitespace regex const combinedWhitespace = /\s{2,}/g; return courtStr.replace(combinedWhitespace, ' ').trim(); }