"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.toArray = toArray;
exports.isObjectSchema = isObjectSchema;
exports.isArraySchema = isArraySchema;
exports.isStringSchema = isStringSchema;
exports.isNumberSchema = isNumberSchema;
exports.deepCopy = deepCopy;
function toArray(el) {
  if (Array.isArray(el)) {
    return el;
  } else {
    return [el];
  }
}

function isObjectSchema(schema) {
  return schema.type === "object" || schema.items && schema.items.type === "object";
}

function isArraySchema(schema) {
  return schema.type === "array";
}

function isStringSchema(schema) {
  return schema.type === "string";
}

function isNumberSchema(schema) {
  return schema.type === "number" || schema.type === "integer";
}

function deepCopy(obj) {
  return JSON.parse(JSON.stringify(obj));
}