1.1.0 • Published 8 years ago

case-combiner v1.1.0

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

case-combiner

npm GitHub license Build Status

A high performance function to find all lowercase and uppercase combinations of a string in JavaScript.

Usage

combiner('http')
[...combineGenerator('http')]
/*
[
  "HTTP", "HTTp", "HTtP", "HTtp", "HtTP"
, "HtTp", "HttP", "Http", "hTTP", "hTTp"
, "hTtP", "hTtp", "htTP", "htTp", "httP"
, "http"
].length === 16
*/

combiner('http://')
[...combineGenerator('http://')]
/*
[
  "HTTP://", "HTTp://", "HTtP://", "HTtp://", "HtTP://"
, "HtTp://", "HttP://", "Http://", "hTTP://", "hTTp://"
, "hTtP://", "hTtp://", "htTP://", "htTp://", "httP://"
, "http://"
].length === 16
*/

Install

NPM

npm install case-combiner

Yarn

yarn add case-combiner

Import

ECMAScript Next Style

import { combiner, combineGenerator } from 'case-combiner'

CommonJS Style

const { combiner, combineGenerator } = require('case-combiner')

Test(Include performance test case)

NPM

npm test

Yarn

yarn test