UNPKG

qrcoder

Version:

QRCoder is *a pure browser qrcode generation* which is standalone. It is based on a <a href='http://www.d-project.com/qrcode/index.html'>library</a> which build qrcode in various language.

15 lines (12 loc) 449 B
const types = 'Boolean Number String Function Array Date RegExp Object Error'.split(' ') const class2type = {} for (let i = 0; i < types.length; i++) { class2type['[object ' + types[i] + ']'] = types[i].toLowerCase() } export default function type (obj) { if (obj === null) { return obj + '' } return typeof obj === 'object' || typeof obj === 'function' ? class2type[Object.prototype.toString.call(obj)] || 'object' : typeof obj }