mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-22 16:03:39 +01:00
pr(#1461): addressed review comments
This commit is contained in:
parent
f2a187d5fe
commit
2a6bfabc30
@ -36,4 +36,16 @@ describe('flattenObject', () => {
|
|||||||
const output = flattenObject(input);
|
const output = flattenObject(input);
|
||||||
expect(output).toEqual({});
|
expect(output).toEqual({});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should handle an object with duplicate keys - dot notation used to define the last duplicate key', () => {
|
||||||
|
const input = { a: { b: 2 }, 'a.b': 1 };
|
||||||
|
const output = flattenObject(input);
|
||||||
|
expect(output).toEqual({ 'a.b': 1 });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle an object with duplicate keys - inner object used to define the last duplicate key', () => {
|
||||||
|
const input = { 'a.b': 1, a: { b: 2 } };
|
||||||
|
const output = flattenObject(input);
|
||||||
|
expect(output).toEqual({ 'a.b': 2 });
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user