Skip to content

initial documentation setup #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
308 changes: 308 additions & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,308 @@
# Variadic.js

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

- [variadic](#variadic)
- [average](#average)
- [factorial](#factorial)
- [isAscending](#isascending)
- [isDecimal](#isdecimal)
- [isDescending](#isdescending)
- [isEmpty](#isempty)
- [isEqual](#isequal)
- [isEven](#iseven)
- [isNegativeInteger](#isnegativeinteger)
- [isNegativeNumber](#isnegativenumber)
- [isOdd](#isodd)
- [isPositiveInteger](#ispositiveinteger)
- [isPositiveNumber](#ispositivenumber)
- [isPrime](#isprime)
- [maximum](#maximum)
- [median](#median)
- [minimum](#minimum)
- [mode](#mode)
- [populationStandardDeviation](#populationstandarddeviation)
- [populationVariance](#populationvariance)
- [sampleStandardDeviation](#samplestandarddeviation)
- [sampleVariance](#samplevariance)
- [sum](#sum)

## variadic

### average

This function caculates the average of the numerical parameters

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: jmbothe

### factorial

This function caculates the factorial of each numerical parameter

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: devNoiseConsulting

### isAscending

This function evaluates whether the parameters are in ascending order

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: scottwestover

### isDecimal

This function evaluates whether all the parameters are decimal values

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: D1esel-Dev

### isDescending

This function evaluates whether the parameters are in ascending order

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: jhowardjr

### isEmpty

This function evaluates if all the parameters are empty

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: jhowardjr

### isEqual

This function evaluates whether all parameters are equal

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: jhowardjr

### isEven

This function evaluates whether all parameters are even

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: scottwestover

### isNegativeInteger

This function evaluates whether all integer parameters are negative

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: khusbuchandra

### isNegativeNumber

This function evaluates whether all numerical parameters are negative

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: khusbuchandra

### isOdd

This function evaluates whether all numerical parameters are odd

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: khusbuchandra

### isPositiveInteger

This function evaluates whether all integer parameters are positive

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: scottwestover

### isPositiveNumber

This function evaluates whether all numerical parameters are positive

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: khusbuchandra

### isPrime

This function evaluates whether all numerical parameters are prime

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: jmbothe

### maximum

This function finds the maximum parameter value

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: jensenmeh

### median

This function finds the median parameter value

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: jmbothe

### minimum

This function finds the minimum parameter value

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: jensenmeh

### mode

This function finds the mode of the parameter values

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: jmbothe

### populationStandardDeviation

This function calculates the population standard deviation

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: devNoiseConsulting

### populationVariance

This function calculates the variance

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: devNoiseConsulting

### sampleStandardDeviation

This function calculates the sample standard deviation

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: devNoiseConsulting

### sampleVariance

This function calculates the sample variance

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: devNoiseConsulting

### sum

This function calculates the sum of the parameters

**Parameters**

- `params` **...any** One or more parameters.

**Meta**

- **author**: jmbothe
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ variadic.isEmpty([0, 2, 3], {}, 0); // false
variadic.isEven(2, 4, 6); // error
```

## Documenation

See [DOCUMENTATION.md](DOCUMENTATION.md)

## Running the tests

```
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';

// REGISTER ALL MODULES
/**
* @module variadic
*/
module.exports = Object.assign(
{},
require('./lib/isEmpty.js'),
Expand Down
6 changes: 6 additions & 0 deletions lib/average.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ const handleErrors = (params) => {
}
};

/**
* This function caculates the average of the numerical parameters
* @memberof variadic
* @author jmbothe
* @param {...*} params - One or more parameters.
*/
exports.average = (...params) => {
handleErrors(params);

Expand Down
6 changes: 6 additions & 0 deletions lib/factorial.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ const caclulateFactorial = (num) => {
return factorialCache[num];
};

/**
* This function caculates the factorial of each numerical parameter
* @memberof variadic
* @author devNoiseConsulting
* @param {...*} params - One or more parameters.
*/
exports.factorial = (...params) => {
handleErrors(params);

Expand Down
6 changes: 6 additions & 0 deletions lib/isAscending.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
'use strict';

/**
* This function evaluates whether the parameters are in ascending order
* @memberof variadic
* @author scottwestover
* @param {...*} params - One or more parameters.
*/
exports.isAscending = (...params) => {
if (params.length < 2) throw new Error('Must provide two or more paramters');
let value = params.shift();
Expand Down
6 changes: 6 additions & 0 deletions lib/isDecimal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

/**
* This function evaluates whether all the parameters are decimal values
* @memberof variadic
* @author D1esel-Dev
* @param {...*} params - One or more parameters.
*/
exports.isDecimal = (...params) => {
for (const param of params) {
// Only accept floating point numbers, infinite numbers can be allowed ie. repeating decimal
Expand Down
6 changes: 6 additions & 0 deletions lib/isDescending.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
'use strict';

/**
* This function evaluates whether the parameters are in ascending order
* @memberof variadic
* @author jhowardjr
* @param {...*} params - One or more parameters.
*/
exports.isDescending = (...params) => {
if (params.length < 2) throw new Error('Must provide two or more paramters');

Expand Down
Loading