Skip to content

cityssm/is-sault-ste-marie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Is Sault Ste. Marie

npm (scoped) DeepSource Maintainability codecov Coverage Testing

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"