Skip to content

Commit

Permalink
Fix variable naming to underscore case
Browse files Browse the repository at this point in the history
  • Loading branch information
b-wils committed Aug 5, 2024
1 parent 4e9dbc0 commit c2fae16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions docs/static/js/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class Validator
.map(e => {
return {
...e,
pathNames: this._get_friendly_path_names(e.path, data)
path_names: this._get_friendly_path_names(e.path, data)
}
});

Expand All @@ -494,15 +494,15 @@ class Validator

_get_friendly_path_names(path, data)
{
const pathParts = path.split('/');
const path_parts = path.split('/');

const names = [];
for (const pathPart of pathParts)
for (const path_part of path_parts)
{
if (pathPart === '#' || pathPart === '')
if (path_part === '#' || path_part === '')
continue;

data = data[pathPart];
data = data[path_part];

if (!data)
break;
Expand Down
2 changes: 1 addition & 1 deletion docs/validator/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function show_errors(errors)
if ( error.type == "warning" )
tr.classList.add("warning-" + error.warning);
tr.appendChild(document.createElement("td")).appendChild(document.createTextNode(error.path ?? ""));
tr.appendChild(document.createElement("td")).appendChild(document.createTextNode(error.pathNames ? error.pathNames.map(n => n ?? "(unnamed)").join(' > ') : ""));
tr.appendChild(document.createElement("td")).appendChild(document.createTextNode(error.path_names ? error.path_names.map(n => n ?? "(unnamed)").join(' > ') : ""));
tr.appendChild(document.createElement("td")).appendChild(document.createTextNode(error.type));
tr.appendChild(document.createElement("td")).appendChild(document.createTextNode(error.message));
let td = tr.appendChild(document.createElement("td"));
Expand Down

0 comments on commit c2fae16

Please sign in to comment.