kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
25 lines (23 loc) • 2.44 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.simpleSearcher = simpleSearcher;
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
/* eslint-disable callback-return */
function simpleSearcher(autofillValues, page, query, cb) {
var regex = new RegExp(query, 'i');
var foundQuery = false;
var matches = (autofillValues || []).filter(function _filter(item) {
var tag = item.name;
foundQuery = foundQuery || tag === query;
return tag && regex.test(tag);
});
if (cb) {
cb(matches);
}
return matches;
}
/* eslint-enable callback-return */
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJzaW1wbGVTZWFyY2hlciIsImF1dG9maWxsVmFsdWVzIiwicGFnZSIsInF1ZXJ5IiwiY2IiLCJyZWdleCIsIlJlZ0V4cCIsImZvdW5kUXVlcnkiLCJtYXRjaGVzIiwiZmlsdGVyIiwiX2ZpbHRlciIsIml0ZW0iLCJ0YWciLCJuYW1lIiwidGVzdCJdLCJzb3VyY2VzIjpbIi4uL3NyYy9zZWFyY2hlci11dGlscy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogTUlUXG4vLyBDb3B5cmlnaHQgY29udHJpYnV0b3JzIHRvIHRoZSBrZXBsZXIuZ2wgcHJvamVjdFxuXG4vKiBlc2xpbnQtZGlzYWJsZSBjYWxsYmFjay1yZXR1cm4gKi9cbmV4cG9ydCBmdW5jdGlvbiBzaW1wbGVTZWFyY2hlcihhdXRvZmlsbFZhbHVlcywgcGFnZSwgcXVlcnksIGNiKSB7XG4gIGNvbnN0IHJlZ2V4ID0gbmV3IFJlZ0V4cChxdWVyeSwgJ2knKTtcbiAgbGV0IGZvdW5kUXVlcnkgPSBmYWxzZTtcbiAgY29uc3QgbWF0Y2hlcyA9IChhdXRvZmlsbFZhbHVlcyB8fCBbXSkuZmlsd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