UNPKG

dynamodb-toolbox

Version:

Lightweight and type-safe query builder for DynamoDB and TypeScript.

18 lines (17 loc) 410 B
import { checkPrimitiveSchema } from '../primitive/check.js'; export class StringSchema { constructor(props) { this.type = 'string'; this.props = props; } get checked() { return Object.isFrozen(this.props); } check(path) { if (this.checked) { return; } checkPrimitiveSchema(this, path); Object.freeze(this.props); } }