Remove min and max modules.

This commit is contained in:
John-David Dalton
2017-01-11 10:28:02 -08:00
parent fe5c7a7f3b
commit dcded33f58
2 changed files with 0 additions and 78 deletions

39
max.js
View File

@@ -1,39 +0,0 @@
import isSymbol from './isSymbol.js';
/**
* Computes the maximum value of `array`. If `array` is empty or falsey,
* `undefined` is returned.
*
* @since 0.1.0
* @category Math
* @param {Array} array The array to iterate over.
* @returns {*} Returns the maximum value.
* @example
*
* max([4, 2, 8, 6]);
* // => 8
*
* max([]);
* // => undefined
*/
function max(array) {
let result;
let index = -1;
const length = array ? array.length : 0;
while (++index < length) {
let computed;
const value = array[index];
if (value != null && (computed === undefined
? (value === value && !isSymbol(value))
: (value > computed)
)) {
computed = value;
result = value;
}
}
return result;
}
export default max;

39
min.js
View File

@@ -1,39 +0,0 @@
import isSymbol from './isSymbol.js';
/**
* Computes the minimum value of `array`. If `array` is empty or falsey,
* `undefined` is returned.
*
* @since 0.1.0
* @category Math
* @param {Array} array The array to iterate over.
* @returns {*} Returns the minimum value.
* @example
*
* min([4, 2, 8, 6]);
* // => 2
*
* min([]);
* // => undefined
*/
function min(array) {
let result;
let index = -1;
const length = array ? array.length : 0;
while (++index < length) {
let computed;
const value = array[index];
if (value != null && (computed === undefined
? (value === value && !isSymbol(value))
: (value < computed)
)) {
computed = value;
result = value;
}
}
return result;
}
export default min;