You know your city name is challenging when it requires clarification from the Government of Canada to spell it properly.
This package helps standardize the spelling of our beloved city, Sault Ste. Marie.
Includes the full spelling, the preferred abbreviated spelling, common misspellings, and unique spellings from other sources, like Canada Post and the Ontario Ministry of Transportation.
npm install @cityssm/is-sault-ste-marie
import { isSaultSteMarie, fixSaultSteMarie } from '@cityssm/is-sault-ste-marie'
// Tests whether a string is a spelling of Sault Ste. Marie.
console.log(isSaultSteMarie('Sault Ste. Marie')) // => true
console.log(isSaultSteMarie('Sault-Sainte-Marie')) // => true
console.log(isSaultSteMarie('Toronto')) // => false
// Returns a preferred spelling of Sault Ste. Marie, or the original string.
console.log(fixSaultSteMarie('Sault Ste Marie')) // => "Sault Ste. Marie"
console.log(fixSaultSteMarie('Sault-Sainte-Marie')) // => "Sault Ste. Marie"
console.log(fixSaultSteMarie('Sault Ste. Marie', 'The Sault')) // => "The Sault"
console.log(fixSaultSteMarie('Toronto')) // => "Toronto"