0.0.3 • Published 3 years ago

x-equal v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

x-equal

npm.io codecov

Tiny library for comparing if strings are equal.

I got myself rewriting this code again and again in projects, so decided to move the code to its own package.

Install

$ yarn add x-equal

Usage

Import

import { isEqual } from 'x-equal'

Comparing strings

isEqual('hello', 'hello') // Same as 'hello' === 'hello'

Comparing strings (insensitive)

Compare strings ignoring string case, for example: HeLlO will be equal to hello.

isEqual('hello', 'hello', {
  isSensitive: false,
})

Comparing strings (remove special characters)

Compare strings ignoring diacritical marks (', ^, etc.), this uses lodash.deburr.

isEqual('João', 'joao', {
  deburr: false,
})

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago