UNPKG

json-schema-library

Version:

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

9 lines (8 loc) 222 B
const toString = Object.prototype.toString; export function getTypeOf(value) { const type = toString.call(value).slice(8, -1).toLowerCase(); if (type === "file") { return "object"; } return type; }