UNPKG

kibana-with-account

Version:

kibana-with-account is develop based kibana project

28 lines (22 loc) 639 B
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 }] }); }); });