Skip to content

Commit 0f40ce0

Browse files
committed
chore: rename an argument
1 parent 2271a6e commit 0f40ce0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/stringify.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,22 @@ export const stringify = (query: JSONQuery, options?: JSONQueryStringifyOptions)
7272
const start = parenthesis ? '(' : ''
7373
const end = parenthesis ? ')' : ''
7474

75-
const argsStr = args.map((child, index) => {
76-
const childName = child?.[0]
75+
const argsStr = args.map((arg, index) => {
76+
const childName = arg?.[0]
7777
const precedence = allOperators.findIndex((group) => name in group)
7878
const childPrecedence = allOperators.findIndex((group) => childName in group)
79-
const parenthesis =
79+
const childParenthesis =
8080
precedence < childPrecedence ||
8181
(precedence === childPrecedence && index > 0) ||
8282
(name === childName && !allLeftAssociativeOperators.includes(op))
8383

84-
return _stringify(child, indent + space, parenthesis)
84+
return _stringify(arg, indent + space, childParenthesis)
8585
})
8686

8787
return join(argsStr, [start, ` ${op} `, end], [start, `\n${indent + space}${op} `, end])
8888
}
8989

90-
// regular function like sort(.age)
90+
// regular function like "sort(.age)"
9191
const childIndent = args.length === 1 ? indent : indent + space
9292
const argsStr = args.map((arg) => _stringify(arg, childIndent))
9393
return join(

0 commit comments

Comments
 (0)