Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function rewindPolygon(coords, reverse) {
// outer ring
if (booleanClockwise(coords[0]) !== reverse) {
coords[0].reverse();
}
// inner rings
for (var i = 1; i < coords.length; i++) {
if (booleanClockwise(coords[i]) === reverse) {
coords[i].reverse();
}
}
}
function rewindPolygon(coords, reverse) {
// outer ring
if (booleanClockwise(coords[0]) !== reverse) {
coords[0].reverse();
}
// inner rings
for (var i = 1; i < coords.length; i++) {
if (booleanClockwise(coords[i]) === reverse) {
coords[i].reverse();
}
}
}
function rewindLineString(coords, reverse) {
if (booleanClockwise(coords) === reverse) coords.reverse();
}