Skip to main content
Module

x/abstruct/mod.ts>PropertyKeyValidator

Abstract structure for JavaScript data validation
Latest
class PropertyKeyValidator
extends BasicValidator<object, Record<T, unknown>>
import { PropertyKeyValidator } from "https://deno.land/x/abstruct@1.0.0/mod.ts";

Property key validator. It checks to pass all property key.

Examples

Example 1

import { PropertyKeyValidator } from "https://deno.land/x/abstruct@$VERSION/validators/object/property_key.ts";
import { type Validator } from "https://deno.land/x/abstruct@$VERSION/types.ts";
declare const validator: Validator<string>;
const keyValidator = new PropertyKeyValidator(validator);

Constructors

new
PropertyKeyValidator(validator: Readonly<Validator<string, T>>)

Type Parameters

optional
T extends string = string

Properties

validator: Validator<string, T>

Methods

toString(): string
validate(input: object): Iterable<ValidationFailure>