Skip to content

Commit

Permalink
converted arrow functions to es5 functions for better compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mankal111 committed Oct 12, 2018
1 parent 18dfbbd commit 801e56f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @param {object} options - The options object
* @returns {boolean} True if options is an object
*/
const checkIfOptionsIsObject = (options) => {
const checkIfOptionsIsObject = function(options) {
if (typeof options === 'object') {
return true;
} else {
Expand All @@ -20,7 +20,7 @@ const checkIfOptionsIsObject = (options) => {
* @param {number} options.max - Maximum possible number
* @returns {boolean} True if the options object is ok
*/
const checkOptionsMinMax = (options) => {
const checkOptionsMinMax = function(options) {
if (isNaN(options.min) || isNaN(options.max)) {
throw new TypeError(`The parameters 'min' and 'max' have values '${options.min}' and '${options.max}' respectively, but they should both be numbers.`);
} else if (options.min > options.max) {
Expand All @@ -38,7 +38,7 @@ const checkOptionsMinMax = (options) => {
* @param {string} [options.type=float] - The type of the number
* @returns {number} The random number
*/
const getNumber = (options) => {
const getNumber = function(options) {
checkIfOptionsIsObject(options);
checkOptionsMinMax(options);
const type = options.type || 'float';
Expand Down Expand Up @@ -68,7 +68,7 @@ const getNumber = (options) => {
* @param {string} [options.type=float] - The type of the endpoints
* @returns {number[]} Array with the two endpoints of the random interval
*/
const getInterval = (options) => {
const getInterval = function(options) {
checkIfOptionsIsObject(options);
checkOptionsMinMax(options);
const minLength = options.minLength || 0;
Expand Down

0 comments on commit 801e56f

Please sign in to comment.