UNPKG

json-schema-library

Version:

Customizable and hackable json-validator and json-schema utilities for traversal, data generation and validation

13 lines (12 loc) 281 B
const toString = Object.prototype.toString; export default function getTypeOf(value) { const type = toString .call(value) .match(/\s([^\]]+)\]/) .pop() .toLowerCase(); if (type === "file") { return "object"; } return type; }