@lando/platformsh
Version:
A Lando plugin that provides a tight integration with Platform.sh.
23 lines (16 loc) • 604 B
JavaScript
var withSymbol = typeof Symbol !== 'undefined';
module.exports = isScalar;
// null|undefined is considered to be scalar too
function isScalar(value) {
var type = typeof(value);
if(type === 'string') return true;
if(type === 'number') return true;
if(type === 'boolean') return true;
if(withSymbol === true && type === 'symbol') return true;
if(value == null) return true;
if(withSymbol === true && value instanceof Symbol) return true;
if(value instanceof String) return true;
if(value instanceof Number) return true;
if(value instanceof Boolean) return true;
return false;
}