@cityssm/is-sault-ste-marie
v0.4.0
Published
Standardizes the spelling of our beloved city, Sault Ste. Marie!
Downloads
11
Readme
Is Sault Ste. Marie
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.
Installation
npm install @cityssm/is-sault-ste-marie
Usage
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"