Spaces:
Sleeping
Sleeping
Download frontend/node_modules/ajv-keywords/index.js from sepidnes/pythonic-rag-FastAPIReact: direct link, hf CLI and curl.
- Browser
- Download file 761 Bytes
-
https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/94e32638a275d46bc1ba62feac204fcaaf313da4/frontend/node_modules/ajv-keywords/index.js
- Command line
-
hf download hf://spaces/sepidnes/pythonic-rag-FastAPIReact@94e32638a275d46bc1ba62feac204fcaaf313da4/frontend/node_modules/ajv-keywords/index.js
-
curl -L -o index.js https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/94e32638a275d46bc1ba62feac204fcaaf313da4/frontend/node_modules/ajv-keywords/index.js
761 Bytes
| ; | |
| var KEYWORDS = require('./keywords'); | |
| module.exports = defineKeywords; | |
| /** | |
| * Defines one or several keywords in ajv instance | |
| * @param {Ajv} ajv validator instance | |
| * @param {String|Array<String>|undefined} keyword keyword(s) to define | |
| * @return {Ajv} ajv instance (for chaining) | |
| */ | |
| function defineKeywords(ajv, keyword) { | |
| if (Array.isArray(keyword)) { | |
| for (var i=0; i<keyword.length; i++) | |
| get(keyword[i])(ajv); | |
| return ajv; | |
| } | |
| if (keyword) { | |
| get(keyword)(ajv); | |
| return ajv; | |
| } | |
| for (keyword in KEYWORDS) get(keyword)(ajv); | |
| return ajv; | |
| } | |
| defineKeywords.get = get; | |
| function get(keyword) { | |
| var defFunc = KEYWORDS[keyword]; | |
| if (!defFunc) throw new Error('Unknown keyword ' + keyword); | |
| return defFunc; | |
| } | |