We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const combinedDiffs: { diff: RangeMapping; input: 1 | 2 }[] = []; for (const diffs of baseRange.input1Diffs) { combinedDiffs.push(...diffs.innerRangeMappings.map(diff => ({ diff, input: 1 as const }))); } for (const diffs of baseRange.input2Diffs) { combinedDiffs.push(...diffs.innerRangeMappings.map(diff => ({ diff, input: 2 as const }))); }
Convert to map ->
const combinedDiffs: { diff: RangeMapping; input: 1 | 2 }[] = baseRange.input1Diffs.map((diffs) => { return ...diffs.innerRangeMappings.map(diff => ({ diff, input: 1 as const })); }); for (const diffs of baseRange.input2Diffs) { combinedDiffs.push(...diffs.innerRangeMappings.map(diff => ({ diff, input: 2 as const }))); }
🐛
There is also flatMap!
The text was updated successfully, but these errors were encountered:
Thanks for the bug report! I've released v1.117.2, which fixes this issue.
v1.117.2
How would you use flatMap here ideally?
flatMap
Sorry, something went wrong.
const combinedDiffs: { diff: RangeMapping; input: 1 | 2 }[] = baseRange.input1Diffs.flatMap((diffs) => { return diffs.innerRangeMappings.map(diff => ({ diff, input: 1 as const })); });
I've added .flatMap conversion in v1.120.3 (available when there is a spread element). Thanks for the idea!
.flatMap
v1.120.3
No branches or pull requests
Convert to map ->
🐛
There is also flatMap!
The text was updated successfully, but these errors were encountered: