mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 07:25:15 +02:00
external modules for util
This commit is contained in:
+3
-1
@@ -2,6 +2,7 @@ import * as actions from './actions/index';
|
||||
import * as geo from './geo/index';
|
||||
import * as behavior from './behavior/index';
|
||||
import * as modes from './modes/index';
|
||||
import * as util from './util/index';
|
||||
|
||||
export { Connection } from './core/connection';
|
||||
export { Difference } from './core/difference';
|
||||
@@ -18,5 +19,6 @@ export {
|
||||
actions,
|
||||
geo,
|
||||
behavior,
|
||||
modes
|
||||
modes,
|
||||
util
|
||||
};
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { editDistance } from './util';
|
||||
|
||||
export function SuggestNames(preset, suggestions) {
|
||||
preset = preset.id.split('/', 2);
|
||||
var k = preset[0],
|
||||
@@ -8,7 +10,7 @@ export function SuggestNames(preset, suggestions) {
|
||||
if (value && value.length > 2) {
|
||||
if (suggestions[k] && suggestions[k][v]) {
|
||||
for (var sugg in suggestions[k][v]) {
|
||||
var dist = iD.util.editDistance(value, sugg.substring(0, value.length));
|
||||
var dist = editDistance(value, sugg.substring(0, value.length));
|
||||
if (dist < 3) {
|
||||
result.push({
|
||||
title: sugg,
|
||||
|
||||
Reference in New Issue
Block a user