forked from MapComplete/MapComplete
Refactoring: fix small errors, simplify 'sortedByLevehnstein'-function, improve error messgae
This commit is contained in:
parent
97b8202b14
commit
8a0023377a
13 changed files with 27 additions and 19 deletions
|
|
@ -166,8 +166,7 @@
|
|||
"'; did you perhaps mean one of: " +
|
||||
Utils.sortedByLevenshteinDistance(
|
||||
type,
|
||||
Validators.AllValidators.map((v) => v.name),
|
||||
(v) => v
|
||||
Validators.AllValidators.map((v) => v.name)
|
||||
)
|
||||
.slice(0, 5)
|
||||
.join(", ")
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ export default class DistanceValidator extends Validator {
|
|||
if (bg && eliCategory.indexOf(bg) < 0) {
|
||||
return (
|
||||
"The given background layer is not a recognized ELI-type. Perhaps you meant one of " +
|
||||
Utils.sortedByLevenshteinDistance(bg, eliCategory, (x) => x).slice(0, 5)
|
||||
Utils.sortedByLevenshteinDistance(bg, eliCategory).slice(0, 5)
|
||||
)
|
||||
}
|
||||
if (typeof args["zoom"] !== "number") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue