0.4.0 • Published 1 year ago

@cityssm/is-sault-ste-marie v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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"
0.4.0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago