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

33 lines (28 loc) 757 B
var explodeBy = require('../explodeBy'); var expect = require('expect.js'); describe('explode_by(dot, flatObject)', function () { it('should explode a flatten object with dots', function () { var flatObject = { 'test.enable': true, 'test.hosts': ['host-01', 'host-02'] }; expect(explodeBy('.', flatObject)).to.eql({ test: { enable: true, hosts: ['host-01', 'host-02'] } }); }); it('should explode a flatten object with slashes', function () { var flatObject = { 'test/enable': true, 'test/hosts': ['host-01', 'host-02'] }; expect(explodeBy('/', flatObject)).to.eql({ test: { enable: true, hosts: ['host-01', 'host-02'] } }); }); });