"use strict";

exports.__esModule = true;
exports.valid = void 0;

var valid = function valid(data, schema) {
  Object.keys(schema).forEach(function (key) {
    validate(data[key], schema[key]);
  });
};

exports.valid = valid;

var validate = function validate(value, rules) {
  rules.forEach(function (rule) {
    Object.keys(rule).forEach(function (item) {
      [item](value, rule[item]);
    });
  });
};

var type = function type(value, _type) {
  if (typeof value === _type) {
    return true;
  }

  return false;
};