Files
factorio-clusterio/lib/helpers.js
T
Hornwitser 703fda43ad Fix JSDoc issues
Fix missing documentation for parameters and return types, incorect
config and errors in type definitions.
2020-06-17 20:53:18 +02:00

25 lines
542 B
JavaScript

/**
* Collection of small utilites that are useful in multiple places.
* @module
*/
"use strict";
/**
* Return a string describing the type of the value passed
*
* Works the same as typeof, excpet that null and array types get their
* own string.
*
* @param {*} value - value to return the type of.
* @returns {string} basic type of the value passed.
*/
function basicType(value) {
if (value === null) { return "null"; }
if (value instanceof Array) { return "array"; }
return typeof value;
}
module.exports = {
basicType,
};