UNPKG

@spalger/kibana

Version:

Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic

21 lines (19 loc) 461 B
define(function (require) { var _ = require('lodash'); return function (id) { if (id == null) return; var trans = { '/' : '-slash-', '\\?' : '-questionmark-', '\\&' : '-ampersand-', '=' : '-equal-' }; _.each(trans, function (val, key) { var regex = new RegExp(key, 'g'); id = id.replace(regex, val); }); id = id.replace(/[\s]+/g, '-'); id = id.replace(/[\-]+/g, '-'); return id; }; });