Skip to content

Commit

Permalink
fix: Fixed typos
Browse files Browse the repository at this point in the history
No actual code changes!
  • Loading branch information
flekschas authored and d4rkr00t committed Mar 15, 2020
1 parent 9698572 commit e03a286
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@
* @return {String}
*/
function lessThanZeroError(p) {
return 'Percentile expect number >= 0 but given "' + p + '" and its type is "' + (typeof p) + '".';
return 'Expect percentile to be >= 0 but given "' + p + '" and its type is "' + (typeof p) + '".';
}

/**
* Error message for case when percentile is grater than 100
* Error message for case when percentile is greater than 100
*
* @param {Number} p
*
* @return {String}
*/
function graterThanHundredError(p) {
return 'Percentile expect number <= 100 but given "' + p + '" and its type is "' + (typeof p) + '".';
function greaterThanHundredError(p) {
return 'Expect percentile to be <= 100 but given "' + p + '" and its type is "' + (typeof p) + '".';
}

/**
* Error message for case when percentile is NaN
* Error message for case when percentile is not a number (NaN)
*
* @param {Number} p
*
* @return {String}
*/
function nanError(p) {
return 'Percentile expect number but given "' + p + '" and its type is "' + (typeof p) + '".';
return 'Expect percentile to be a number but given "' + p + '" and its type is "' + (typeof p) + '".';
}

/**
Expand All @@ -52,7 +52,7 @@ function percentile(p, list, fn) {
}

if (p > 100) {
throw new Error(graterThanHundredError(p));
throw new Error(greaterThanHundredError(p));
}

list = list.slice().sort(function (a, b) {
Expand Down

0 comments on commit e03a286

Please sign in to comment.