@provenanceio/wallet-utils
Version:
Typescript Utilities for Provenance Blockchain Wallet
11 lines (10 loc) • 478 B
JavaScript
import _typeof from "@babel/runtime/helpers/esm/typeof";
export var getJSType = function getJSType(obj) {
if (Array.isArray(obj)) return 'array';
if (typeof obj === 'string') return 'string';
if (typeof obj === 'number') return 'number';
if (typeof obj === 'boolean') return 'boolean';
if (obj === null) return 'null'; // Run this test after others since js labels multiple things as objects
if (_typeof(obj) === 'object') return 'object';
return _typeof(obj);
};