UNPKG

@aikidosec/firewall

Version:

Zen by Aikido is an embedded Application Firewall that autonomously protects Node.js apps against common and critical attacks, provides rate limiting, detects malicious traffic (including bots), and more.

31 lines (30 loc) 855 B
import { type StringFormat } from "./getStringFormat"; export type DataSchema = { /** * Type of this property. * e.g. "string", "number", "object", "array", "null" */ type: string | string[]; /** * If this property is optional., if not set, we don't know if it is optional or not. */ optional?: boolean; /** * Map of properties for an object containing the DataSchema for each property. */ properties?: { [key: string]: DataSchema; }; /** * Data schema for the items of an array. */ items?: DataSchema | null; /** * Format of the string, if it is a string. */ format?: StringFormat; }; /** * Get the schema of the data (for example http json body) as a schema. */ export declare function getDataSchema(data: unknown, depth?: number): DataSchema;