Skip to content

Commit c5ea41a

Browse files
committed
fix: address jgravois review comments on PR #79
- Remove redundant `!npoints` check now that default is 100 - Add src/ to package.json files array and update DEVELOPING.md - Fix Browser ESM example: arc.GreatCircle -> GreatCircle, Arc(100) -> Arc() - Fix CHANGELOG.md indentation in package.json files array
1 parent f2a3623 commit c5ea41a

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

DEVELOPING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ npm publish # prepublishOnly runs npm run build automatically
7575
### What Gets Published
7676

7777
- `dist/` folder (compiled ESM JS + TypeScript definitions)
78+
- `src/` folder (TypeScript source files)
7879
- `README.md`, `LICENSE.md`, `CHANGELOG.md`
7980

8081
## TypeScript Development

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ const line = gc.Arc(100);
4040
```html
4141
<script type="module">
4242
import { GreatCircle } from 'https://cdn.skypack.dev/arc@1';
43-
const gc = new arc.GreatCircle({x: -122, y: 48}, {x: -77, y: 39});
44-
const line = gc.Arc(100);
43+
const gc = new GreatCircle({x: -122, y: 48}, {x: -77, y: 39});
44+
const line = gc.Arc();
4545
</script>
4646
```
4747

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
},
3030
"files": [
3131
"dist/",
32+
"src/",
3233
"README.md",
3334
"LICENSE.md",
34-
"CHANGELOG.md"
35+
"CHANGELOG.md"
3536
],
3637
"engines": {
3738
"node": ">=18"

src/great-circle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class GreatCircle {
9797
Arc(npoints: number = 100, _options?: ArcOptions): Arc {
9898
// NOTE: With npoints ≤ 2, no antimeridian splitting is performed.
9999
// A 2-point antimeridian route returns a single LineString spanning ±180°. Renderers that support coordinate wrapping (e.g. MapLibre GL JS) handle this correctly, whereas splitting would produce two disconnected straight-line stubs with no great-circle curvature — arguably worse behavior. This is a known limitation; open for maintainer discussion if a MultiLineString split is preferred.
100-
if (!npoints || npoints <= 2) {
100+
if (npoints <= 2) {
101101
const arc = new Arc(this.properties);
102102
const line = new _LineString();
103103
arc.geometries.push(line);

0 commit comments

Comments
 (0)