Add message

This commit is contained in:
Andros Fenollosa 2020-07-04 16:34:03 +02:00
parent d92f72fc73
commit a37579c06a
3 changed files with 9 additions and 11 deletions

2
dist/ffnm.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -19,12 +19,19 @@ function validateSyntax() {
// Check element FUNCTION_TREE
return [...document.querySelectorAll(`[${event}]`)].map((element) => {
// Check KEY FUNCTION_TREE
return Object.keys(FUNCTION_TREE).map((key) => {
let checked = Object.keys(FUNCTION_TREE).map((key) => {
// Check METHODS FUNCTION_TREE
return FUNCTION_TREE[key].map((method) => {
return RegExp(`^${key}:${method}\\('\\w+', *'[#,.,a-zA-Z]\\w*'\\)$`).test(element.getAttribute(event));
}).some(method => method);
}).every(key => key);
// Notify error
if(!checked) {
console.error('FFNM: Bad syntax');
console.error(element);
}
return checked;
}).every(item => item);
}).every(event => event);
}

View File

@ -1,9 +0,0 @@
{
"compilerOptions": {
"lib": [
"es6",
"dom",
"dom.iterable"
]
}
}