debug(dbg,'This text is not a string or number:',t);
throw(`Point pattern.parts.${partId}.points.${pointId} has text that is not a string nor a number. Set the 'data-validate-skip-text' attribute to true to suppress this error.`);
}elseif(typeoft==='string'&&t.indexOf(' ')!==-1){
debug(dbg,'This text might be a translation problem:',point);
throw(`Point pattern.parts.${partId}.points.${pointId} has text containing spaces. Please insert translation identifiers, and not actual text. Set the 'data-validate-skip-text' attribute to true to suppress this error.`);
}
}
}
returntrue;
}
functionvalidatePath(path,partId,pathId,debug){
if(typeofpath!=='object'){
debug(dbg,'Problem with path:',path);
throw(`Path pattern.parts.${partId}.paths.${pathId} is not an object`);
}elseif(typeofpath.ops!=='object'){
debug(dbg,'Problem with path ops:',path);
throw(`ops property of path pattern.parts.${partId}.paths.${pathId} is not an object`);
}elseif(path.ops.length<2){
debug(dbg,'Problem with path ops:',path);
throw(`Path pattern.parts.${partId}.paths.${pathId} does not do anything`);
}elseif(typeofpath.attributes!=='object'){
debug(dbg,'Problem with path attributes:',path);
throw(`attributes property of path pattern.parts.${partId}.paths.${pathId} is not an object`);
}elseif(!path.cloneinstanceofFunction){
debug(dbg,'Problem with path:',path);
throw(`Path pattern.parts.${partId}.paths.${pathId} is not a valid Path object`);