文件操作 - error.ts
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/@redocly/ajv/lib/vocabularies/jtd/error.ts
编辑文件内容
import type {KeywordErrorDefinition, KeywordErrorCxt, ErrorObject} from "../../types" import {_, Code} from "../../compile/codegen" export type _JTDTypeError<K extends string, T extends string, S> = ErrorObject< K, {type: T; nullable: boolean}, S > export function typeError(t: string): KeywordErrorDefinition { return { message: (cxt) => typeErrorMessage(cxt, t), params: (cxt) => typeErrorParams(cxt, t), } } export function typeErrorMessage({parentSchema}: KeywordErrorCxt, t: string): string { return parentSchema?.nullable ? `must be ${t} or null` : `must be ${t}` } export function typeErrorParams({parentSchema}: KeywordErrorCxt, t: string): Code { return _`{type: ${t}, nullable: ${!!parentSchema?.nullable}}` }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件