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
28 lines (22 loc) • 634 B
JavaScript
import flattenWith from '../flatten_with';
import expect from 'expect.js';
describe('flatten_with(dot, nestedObj)', function () {
it('should flatten object with dot', function () {
let 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 }]
});
});
});