We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 94d3323 commit 825a397Copy full SHA for 825a397
packages/code-map/__tests__/parse.test.ts
@@ -132,7 +132,7 @@ describe('parse module', () => {
132
() => multilineCode,
133
)
134
135
- expect(result.numLines).toBe(2) // Due to operator precedence: .match(/\n/g)?.length ?? 0 + 1 becomes (2 ?? 1) = 2
+ expect(result.numLines).toBe(3)
136
})
137
138
it('should deduplicate identifiers and calls', () => {
packages/code-map/src/parse.ts
@@ -169,7 +169,7 @@ export function parseTokens(
169
calls: [] as string[],
170
}
171
172
- const numLines = sourceCode.match(/\n/g)?.length ?? 0 + 1
+ const numLines = (sourceCode.match(/\n/g)?.length ?? 0) + 1
173
if (!parser || !query) {
174
throw new Error('Parser or query not found')
175
0 commit comments