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

isNumberSchema

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

The Gist

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

const schema: T_JSONSchema = {
  type: 'number',
}

const isNumber = isNumberSchema(schema)

Parameters

ParameterTypeDescription
schemaT_JSONSchemaThe JSON schema to check.

Returns

(boolean) Whether the schema is a number schema.

On this page