UNPKG

kibana-123

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) 752 B
import explodeBy from '../explode_by'; import expect from 'expect.js'; describe('explode_by(dot, flatObject)', function () { it('should explode a flatten object with dots', function () { let 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 () { let flatObject = { 'test/enable': true, 'test/hosts': ['host-01', 'host-02'] }; expect(explodeBy('/', flatObject)).to.eql({ test: { enable: true, hosts: ['host-01', 'host-02'] } }); }); });