Skip to content

Commit

Permalink
added toLowerCase() and toUpperCase()
Browse files Browse the repository at this point in the history
  • Loading branch information
tristaaan committed Oct 7, 2015
1 parent e307601 commit 4046b85
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@

**Functional tools that couldn’t be simpler.**

We’re proud to present *1-liners* – a dead simple functional utility belt. **[104 one-liner functions][docs]** (and counting). Each hand-crafted with love and attention.
<<<<<<< HEAD
We’re proud to present *1-liners* – a dead simple functional utility belt. **[106 one-liner functions][docs]** (and counting). Each hand-crafted with love and attention.
=======
We’re proud to present *1-liners* – a dead simple functional utility belt. **[105 one-liner functions][docs]** (and counting). Each hand-crafted with love and attention.
>>>>>>> added toLowerCase() and toUpperCase()
[docs]: ./documentation

Expand Down
36 changes: 36 additions & 0 deletions documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@
- [takeWhile](#takewhile)
- [test](#test)
- [times](#times)
- [toLowerCase](#tolowercase)
- [toUpperCase](#touppercase)
- [uncurry](#uncurry)
- [uncurry3](#uncurry3)
- [values](#values)
Expand Down Expand Up @@ -2018,6 +2020,40 @@ times(3, 2); // => 6
</sup></div>


### toLowerCase

Same as `'STR'.toLowerCase()`.

```js
var toLowerCase = require('1-liners/toLowerCase');

toLowerCase('HALLO') // => 'hallo'
```

<div align="right"><sup>
<a href="../tests/toLowerCase.js">Spec</a>
<a href="../module/toLowerCase.js">Source</a>: <code> (str) =&gt; str.toLowerCase();</code>
</sup></div>


### toUpperCase

Same as `'str'.toUpperCase()`.

```js
var toUpperCase = require('1-liners/toUpperCase');

toUpperCase('hallo') // => 'HALLO'
```

<div align="right"><sup>
<a href="../tests/toUpperCase.js">Spec</a>
<a href="../module/toUpperCase.js">Source</a>: <code> (str) =&gt; str.toUpperCase();</code>
</sup></div>


### uncurry

Uncurry a function – collapse 2 lists of parameters into one.
Expand Down
4 changes: 4 additions & 0 deletions module/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ import takeUntil from './takeUntil';
import takeWhile from './takeWhile';
import test from './test';
import times from './times';
import toLowerCase from './toLowerCase';
import toUpperCase from './toUpperCase';
import uncurry from './uncurry';
import uncurry3 from './uncurry3';
import values from './values';
Expand Down Expand Up @@ -202,6 +204,8 @@ export {
takeWhile,
test,
times,
toLowerCase,
toUpperCase,
uncurry,
uncurry3,
values,
Expand Down
15 changes: 15 additions & 0 deletions module/toLowerCase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* @module 1-liners/toLowerCase
*
* @description
*
* Same as `'STR'.toLowerCase()`.
*
* @example
*
* var toLowerCase = require('1-liners/toLowerCase');
*
* toLowerCase('HALLO') // => 'hallo'
*
*/
export default (str) => str.toLowerCase();
15 changes: 15 additions & 0 deletions module/toUpperCase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* @module 1-liners/toUpperCase
*
* @description
*
* Same as `'str'.toUpperCase()`.
*
* @example
*
* var toUpperCase = require('1-liners/toUpperCase');
*
* toUpperCase('hallo') // => 'HALLO'
*
*/
export default (str) => str.toUpperCase();
7 changes: 7 additions & 0 deletions tests/toLowerCase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { equal } from 'assert';
import toLowerCase from '../toLowerCase';

test('#toLowerCase', () => {
equal(toLowerCase('SOMETHING UPPERCASE'), 'something uppercase');
equal(toLowerCase('1-LINERS'), '1-liners');
});
7 changes: 7 additions & 0 deletions tests/toUpperCase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { equal } from 'assert';
import toUpperCase from '../toUpperCase';

test('#toUpperCase', () => {
equal(toUpperCase('something lowercase'), 'SOMETHING LOWERCASE');
equal(toUpperCase('1-liners'), '1-LINERS');
});

0 comments on commit 4046b85

Please sign in to comment.