UNPKG

@rjsf/utils

Version:
9 lines (8 loc) 535 B
import type { RangeSpecType, RJSFSchema, StrictRJSFSchema } from './types.js'; /** Extracts the range spec information `{ step?: number, min?: number, max?: number }` that can be spread onto an HTML * input from the range analog in the schema `{ multipleOf?: number, minimum?: number, maximum?: number }`. * * @param schema - The schema from which to extract the range spec * @returns - A range specification from the schema */ export default function rangeSpec<S extends StrictRJSFSchema = RJSFSchema>(schema: S): RangeSpecType;