Skip to content
This repository was archived by the owner on Feb 20, 2019. It is now read-only.

Commit 5066d92

Browse files
author
Kent C. Dodds
committed
docs(contributing): Add contribution docs
Also add jsdocs on existing methods
1 parent e736e26 commit 5066d92

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ that I'll accept it before you spend time working on it.
3333

3434
## Set up instructions
3535

36+
First of all, this is a JavaScript project that's distributed on [npmjs.org](https://npmjs.org) and
37+
therefore uses JavaScript tooling based on [Node.js](https://nodejs.org/) with dependencies from npm.
38+
You're going to need to have those things installed to contribute to this project.
39+
3640
1. Fork the repo
3741
2. Clone your fork
3842
3. Create a branch

src/flatten.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
export default flatten
22

3+
/**
4+
* Original Source: http://stackoverflow.com/a/15030117/971592
5+
*
6+
* This method will flatten an array given to it.
7+
*
8+
* @param {Array} arr - The array to flatten
9+
* @return {Array} - The flattened array
10+
*/
311
function flatten(arr) {
412
return arr.reduce(function flattenReducer(flat, toFlatten) {
513
return flat.concat(Array.isArray(toFlatten) ? flatten(toFlatten) : toFlatten)

src/snake-to-camel.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ export default snakeToCamel
22

33
const regex = /(\-\w)/g
44

5+
/**
6+
* Original Source: http://stackoverflow.com/a/6661012/971592
7+
*
8+
* This method converts a snake-case string to a camelCase string
9+
*
10+
* @param {String} s - The snake-case string to camelCase
11+
* @return {String} - The camelCase version of the snake-case string
12+
*/
513
function snakeToCamel(s) {
614
return s.replace(regex, function snakeToCamelReplacer(m) {
715
return m[1].toUpperCase()

0 commit comments

Comments
 (0)