Skip to content

Commit

Permalink
fix: reading correct otpion value
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Mar 29, 2024
1 parent 5d4443e commit 691a86e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function baseMerger<B extends MergerSource[]>(
) {
const arrayPriority = context.options.priority !== context.options.arrayPriority ?
togglePriority(context.options.arrayPriority) :
context.options.priority;
context.options.arrayPriority;

switch (arrayPriority) {
case PriorityName.LEFT:
Expand Down
6 changes: 5 additions & 1 deletion test/unit/module.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ describe('src/module/*.ts', () => {
});

it('should merge with different priorities for arrays and objects', () => {
const merger = createMerger({ arrayPriority: 'left', priority: 'right' });
const merger = createMerger({
arrayPriority: 'left',
priority: 'right',
});

expect(merger({ foo: [1, 2, 3], bar: 'baz' }, { foo: [4, 5, 6], bar: 'boz' })).toEqual({
foo: [1, 2, 3, 4, 5, 6],
bar: 'boz',
Expand Down

0 comments on commit 691a86e

Please sign in to comment.