Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 2.1 KB

README.md

File metadata and controls

42 lines (30 loc) · 2.1 KB

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"