@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
28 lines (22 loc) • 639 B
JavaScript
var flattenWith = require('../flattenWith');
var expect = require('expect.js');
describe('flatten_with(dot, nestedObj)', function () {
it('should flatten object with dot', function () {
var nestedObj = {
test: {
enable: true,
hosts: ['host-01', 'host-02'],
client: {
type: 'nosql',
pool: [{ port: 5051 }, { port: 5052 }]
}
}
};
expect(flattenWith('.', nestedObj)).to.eql({
'test.enable': true,
'test.hosts': ['host-01', 'host-02'],
'test.client.type': 'nosql',
'test.client.pool': [{ port: 5051 }, { port: 5052 }]
});
});
});