"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.sameAs = void 0;
var _utils = require("@grozav/utils");
const sameAs = (value, options) => {
  if (!options.target) {
    console.error('The "target" option must be specified for "sameAs" validator.');
    return false;
  }
  const targetSchema = (0, _utils.getValueByPath)(options.schema, options.target);
  if (!targetSchema) {
    throw new Error(`Could not find target with name '${options.target}' in 'sameAs' validator.`);
  }
  return value === targetSchema.value;
};
exports.sameAs = sameAs;