Small JavaScript library and test suite that will properly capitalise post town names
Takes into account odd peculiar naming rules and exceptions
Input needs to be correctly spaced and/or hyphenated
npm install capitalise-post-town
const { capitalisePostTown } = require("capitalise-post-town");
// Simple Case
capitalisePostTown("DRYBROOK") // => Drybrook
// Hypenated
capitalisePostTown("HENLEY-IN-ARDEN") // => Henley-in-Arden
// Minor uncapitalised words
capitalisePostTown("WALTON on THE naze") // => Walton on the Naze
// Exception
capitalisePostTown("BO'NESS") // => Bo'Ness
capitalisePostTown("BFPO") // => BFPO
MIT