UNPKG

@inkline/inkline

Version:

Inkline is the intuitive UI Components library that gives you a developer-friendly foundation for building high-quality, accessible, and customizable Vue.js 3 Design Systems.

15 lines (14 loc) 474 B
import { getValueByPath } from "@grozav/utils"; export const sameAs = (value, options) => { if (!options.target) { console.error('The "target" option must be specified for "sameAs" validator.'); return false; } const targetSchema = 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; };