mOcKiNgCaSe
Convert a string to mOcKiNgCaSe.
Read more on wikipedia Studly caps.
Inspired by the meme Mocking Spongebob and http://dannypage.github.io/spongebob.html
Install
$ npm install mockingcase --save
Usage
const mOcKiNgCaSe = require('mockingcase');
mOcKiNgCaSe('foo-bar');
mOcKiNgCaSe('aa', {random: false});
mOcKiNgCaSe('aa', {random: true});
mOcKiNgCaSe('foo_bar');
mOcKiNgCaSe('Foo-Bar');
mOcKiNgCaSe('foo bar 42');
mOcKiNgCaSe('42foo!bar');
mOcKiNgCaSe(['foo','bar']);
mOcKiNgCaSe(undefined);
mOcKiNgCaSe.log('foo bar');
mOcKiNgCaSe.overrideString();
'foo_bar'.toMockingCase();
API
mOcKiNgCaSe(input, [options]) ⇒ string
This function receives a string input and converts it to mOcKiNgCaSe.
Kind: global function
Returns: string
- string in mOcKiNgCaSe
Param | Type | Default | Description |
---|
input | string | Array.<string> | | string or array of strings to be converted |
[options] | object | {random: false} | options for converting |
options.random | boolean | false | using 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
Param | Type | Default | Description |
---|
input | string | Array.<string> | | string or array of string to be converted |
[options] | object | {random: false} | options for converting |
options.random | boolean | false | using random for converting |