UNPKG

@rjsf/utils

Version:
10 lines (9 loc) 559 B
import { RangeSpecType, StrictRJSFSchema } from './types.js'; import { RJSFSchema } 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;