Skip to content

Migrate @turf/line-split to TypeScript#2985

Merged
mfedderly merged 1 commit intomasterfrom
mf/line-split-ts
Dec 31, 2025
Merged

Migrate @turf/line-split to TypeScript#2985
mfedderly merged 1 commit intomasterfrom
mf/line-split-ts

Conversation

@mfedderly
Copy link
Copy Markdown
Collaborator

No description provided.

// Ensure we're consistently sending Feature<LineString> into the splitLine methods.
if (line.type !== "Feature") {
line = feature(line);
}
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.

Its hard to spot in the diff, but splitLineWithPoint has this snippet, which only works with Features. Shout out to catching this issue at compile time instead of runtime.

  var startPoint = getCoords(line)[0];
  var endPoint = getCoords(line)[line.geometry.coordinates.length - 1];

@mfedderly mfedderly merged commit bc6e415 into master Dec 31, 2025
4 checks passed
@mfedderly mfedderly deleted the mf/line-split-ts branch December 31, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants