Skip to content

Commit

Permalink
Merge branch 'master' into bool-on-zero-length-line
Browse files Browse the repository at this point in the history
  • Loading branch information
smallsaucepan authored Nov 20, 2024
2 parents 1dfb4c5 + 0da7ada commit 3c5a1d8
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 153 deletions.
27 changes: 27 additions & 0 deletions packages/turf-clone/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
point,
lineString,
polygon,
feature,
featureCollection,
geometryCollection,
} from "@turf/helpers";
Expand Down Expand Up @@ -319,3 +320,29 @@ test("turf-clone -- Feature with null geometry", (t) => {
t.deepEqual(fc, cloned);
t.end();
});

test("turf-clone -- Feature with property called 'length', issue #1621", (t) => {
const f = feature(
{ type: "Point", coordinates: [0, 0] },
{
processed: {
length: {
orig: 123.456,
opti: 100.0,
},
},
}
);

// Clone
const cloned = clone(f);

t.deepEqual(f, cloned, "cloned feature should be deeply equal");
t.equal(
cloned.properties.processed.length.orig,
123.456,
"'orig' property should be preserved on 'processed.length' element"
);

t.end();
});
Loading

0 comments on commit 3c5a1d8

Please sign in to comment.