Skip to content

Commit

Permalink
pr(#1461): addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
helloanoop committed Jan 28, 2024
1 parent f2a187d commit 2a6bfab
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/bruno-common/src/utils/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,16 @@ describe('flattenObject', () => {
const output = flattenObject(input);
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 });
});
});

0 comments on commit 2a6bfab

Please sign in to comment.