UNPKG

@prismicio/types-internal

Version:
14 lines (9 loc) 302 B
import * as t from "io-ts" import { refineType } from "../validators/function" const widgetKeyRegex = new RegExp("^[^<>]+$") export const WidgetKey = refineType( t.string, "WidgetKey", (s: string) => s.length === 0 || widgetKeyRegex.test(s), ) export type WidgetKey = t.TypeOf<typeof WidgetKey>