Schema
/ API Reference / Guards
Schema
/ API Reference / Guards

isArraySchema

A function that checks if a JSON schema is an JSON array schema.

The Gist

import { isArraySchema, T_JSONSchema } from '@weser/schema'

const schema: T_JSONSchema = {
  type: 'array',
  items: {
    type: 'string',
  },
}

const isArray = isArraySchema(schema)

Parameters

ParameterTypeDescription
schemaT_JSONSchemaThe JSON schema to check.

Returns

(boolean) Whether the schema is an array schema.

On this page