UNPKG

@provenanceio/wallet-utils

Version:

Typescript Utilities for Provenance Blockchain Wallet

21 lines (16 loc) 893 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getJSType = void 0; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 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); }; exports.getJSType = getJSType;