UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

13 lines (12 loc) 354 B
import { Schema } from "./Schema.js"; /** Schema that passes through to a source schema. */ export class ThroughSchema extends Schema { source; constructor({ source, ...options }) { super({ ...source, ...options }); this.source = source; } validate(unsafeValue) { return this.source.validate(unsafeValue); } }