Skip to content

Commit

Permalink
style(json-expression): 💄 run Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Jun 21, 2024
1 parent edbd128 commit 0c34a16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/json-expression/__tests__/jsonExpressionUnitTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1669,8 +1669,12 @@ export const jsonExpressionUnitTests = (
});

test('throws on invalid operand count', () => {
expect(() => check((['push', [[]]] as any), false)).toThrowErrorMatchingInlineSnapshot(`""push" operator expects at least two operands."`);
expect(() => check((['push', []] as any), false)).toThrowErrorMatchingInlineSnapshot(`""push" operator expects at least two operands."`);
expect(() => check(['push', [[]]] as any, false)).toThrowErrorMatchingInlineSnapshot(
`""push" operator expects at least two operands."`,
);
expect(() => check(['push', []] as any, false)).toThrowErrorMatchingInlineSnapshot(
`""push" operator expects at least two operands."`,
);
});
});

Expand Down
3 changes: 1 addition & 2 deletions src/json-expression/operators/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ export const arrayOperators: types.OperatorDefinition<any>[] = [
(expr: types.ExprPush, ctx) => {
const operand1 = ctx.eval(expr[1], ctx);
const arr = clone(util.asArr(operand1));
for (let i = 2; i < expr.length; i++)
arr.push(ctx.eval(expr[i], ctx));
for (let i = 2; i < expr.length; i++) arr.push(ctx.eval(expr[i], ctx));
return arr;
},
(ctx: types.OperatorCodegenCtx<types.ExprPush>): ExpressionResult => {
Expand Down

0 comments on commit 0c34a16

Please sign in to comment.