mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 15:24:52 +09:00
Split up codebase into the packages @clsterio/lib, @clusterio/master, @clusterio/slave, and @clusterio/ctl using lerna to manage them. This will allow deployment to use only the parts needed reducing install size, and better separate the code into shared library, master, slave and control.
25 lines
542 B
JavaScript
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,
|
|
};
|