case-insensitive

1.0.0 • Public • Published

case-insensitive

A Node.js module that wraps around an array or string and transforms certain methods into case-insensitive versions.

Installation

npm install case-insensitive --save

The module exposes a single function.

Usage

const ci = require('case-insensitive')
 
ci('String').equals('STRING') // true
ci('String').startsWith('s') // true
ci('String').endsWith('nG') // true
ci('STRING').indexOf('t') // 1
 
ci(['Test']).equals(['test']) // true
ci(['A', 'B']).includes('A') // true
ci(['A', 'B']).indexOf('B') // 1

Methods

The ci() function returns an object, with methods depending on the type of input:

Method Arrays Strings
endsWith
equals
includes
indexOf
lastIndexOf
startsWith

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    2,801
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    2,801

Package Sidebar

Install

npm i case-insensitive

Weekly Downloads

2,801

Version

1.0.0

License

MIT

Last publish

Collaborators

  • lamansky