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
|
|
@ -71,7 +71,8 @@ class SubstituteLayer extends Conversion<string | LayerConfigJson, LayerConfigJs
|
|||
for (const name of names) {
|
||||
const found = Utils.Clone(state.sharedLayers.get(name))
|
||||
if (found === undefined) {
|
||||
context.err("Layer with name " + name + " not found")
|
||||
const nearbyNames = Utils.sortedByLevenshteinDistance(name, Array.from(state.sharedLayers.keys()))
|
||||
context.err("Layer with name " + name + " not found. Dit you mean one of "+nearbyNames.slice(0, 3))
|
||||
continue
|
||||
}
|
||||
found["_basedOn"] = name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue