Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mockingcase

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mockingcase

Convert a string to mOcKiNgCaSe

  • 1.5.0
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

mOcKiNgCaSe Build Status

Convert a string to mOcKiNgCaSe.

Read more on wikipedia Studly caps.

mocking spongebob

Inspired by the meme Mocking Spongebob and http://dannypage.github.io/spongebob.html

Install

$ npm install mockingcase --save

Usage

const mOcKiNgCaSe = require('mockingcase');
// es6 - import mOcKiNgCaSe from 'mockingcase';
//  ts - import * as mOcKiNgCaSe from 'mockingcase';
//  ts - import mOcKiNgCaSe = require('mockingcase');

mOcKiNgCaSe('foo-bar');
//=> 'fOo-bAr'

mOcKiNgCaSe('aa', {random: false});
//=> 'aA'

mOcKiNgCaSe('aa', {random: true});
//=> 'aa'
//=> 'aA'
//=> 'Aa'
//=> 'AA'

mOcKiNgCaSe('foo_bar');
//=> 'fOo_bAr'

mOcKiNgCaSe('Foo-Bar');
//=> 'fOo-bAr'

mOcKiNgCaSe('foo bar 42');
//=> 'fOo bAr 42'

mOcKiNgCaSe('42foo!bar');
//=> '42fOo!bAr'

mOcKiNgCaSe(['foo','bar']);
//=> 'fOoBaR';

mOcKiNgCaSe(undefined);
//=> Error "An input is required

mOcKiNgCaSe.log('foo bar');
// console.log('fOo bAr');

// Optionally create String.prototype.toMockingCase
mOcKiNgCaSe.overrideString();

'foo_bar'.toMockingCase();
//=> 'fOo_bAr'

API

mOcKiNgCaSe(input, [options]) ⇒ string

This function receives a string input and converts it to mOcKiNgCaSe.

Kind: global function
Returns: string - string in mOcKiNgCaSe

ParamTypeDefaultDescription
inputstring | Array.<string>string or array of strings to be converted
[options]object{random: false}options for converting
options.randombooleanfalseusing random for converting

mOcKiNgCaSe.overrideString() ⇒ mOcKiNgCaSe

Creates String.prototype.toMockingCase().

Kind: global function
Returns: mOcKiNgCaSe - The mOcKiNgCaSe module.
See: toMockingCase


String.prototype.toMockingCase() ⇒ string

Converts this string to mOcKiNgCaSe.

NOTE: this function is created by invoking mOcKiNgCaSe.overrideString().

Kind: prototype
Returns: string - local string in mOcKiNgCaSe


mOcKiNgCaSe.log(input, [options])

This function receives a string input and outputs a message to the console in mOcKiNgCaSe.

Kind: static method of mOcKiNgCaSe

ParamTypeDefaultDescription
inputstring | Array.<string>string or array of string to be converted
[options]object{random: false}options for converting
options.randombooleanfalseusing random for converting

Keywords

FAQs

Package last updated on 25 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc