constmessage=shouldBeAbsolute?`The provided value ${JSON.stringify(data)} is not an absolute path!`:`A relative path is expected. However, the provided value ${JSON.stringify(data)} is an absolute path!`;
returnerrorMessage(message,schema,data);
}
/**
*
*@param{Ajv}ajv
*@returns{Ajv}
*/
functionaddAbsolutePathKeyword(ajv){
ajv.addKeyword("absolutePath",{
errors:true,
type:"string",
compile(schema,parentSchema){
/** @type {ValidateFunction} */
constcallback=data=>{
letpasses=true;
constisExclamationMarkPresent=data.includes("!");
if(isExclamationMarkPresent){
callback.errors=[errorMessage(`The provided value ${JSON.stringify(data)} contains exclamation mark (!) which is not allowed because it's reserved for loader syntax.`,parentSchema,data)];