Skip to content

break(meta) BREAK Improve propEach TypeScript signature - #3162

Merged
mfedderly merged 1 commit into
masterfrom
mf/propEach
Sep 7, 2026
Merged

mfedderly merged 1 commit into
masterfrom
mf/propEach

Conversation

@mfedderly

@mfedderly mfedderly commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator
  • Tighten geojson parameter type signatures to only Feature and FeatureCollection
  • Improve inference of currentProperties argument in callback
  • Expose false return from callback to TypeScript
  • Remove @ts-expect-errors
  • Modernize the loop syntax

Perf changes are essentially neutral from this.

- Tighten `geojson` parameter type signatures to only Feature and FeatureCollection
- Improve inference of `currentProperties` argument in callback
- Expose `false` return from callback to TypeScript
- Remove @ts-expect-errors
- Modernize the loop syntax
@mfedderly mfedderly added this to the v8 milestone Sep 7, 2026
@mfedderly mfedderly added @turf/meta backwards incompatible Exhibiting backwards incompatible behaviour, not explicitly documented. labels Sep 7, 2026
@mfedderly mfedderly changed the title break(meta) Improve propsEach TypeScript signature break(meta) BREAK Improve propsEach TypeScript signature Sep 7, 2026
propEach(features, (prop) => prop);
meta.propEach(features, (prop) => prop);
meta.propEach(poly, (prop, index) => prop);
meta.propEach<{ bar: string }>(poly, (prop) => prop.bar);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This props cast actually became an error because it knew that poly did not have those props. I cast the argument instead so that we can still test the inference of prop in the callback.

@mfedderly mfedderly changed the title break(meta) BREAK Improve propsEach TypeScript signature break(meta) BREAK Improve propEach TypeScript signature Sep 7, 2026
@mfedderly
mfedderly merged commit 83b8db1 into master Sep 7, 2026
3 checks passed
@mfedderly
mfedderly deleted the mf/propEach branch September 7, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards incompatible Exhibiting backwards incompatible behaviour, not explicitly documented. @turf/meta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant