ol/geom/flat/deflate exports
This commit is contained in:
@@ -16,7 +16,7 @@ import MultiPoint from '../geom/MultiPoint.js';
|
|||||||
import MultiPolygon from '../geom/MultiPolygon.js';
|
import MultiPolygon from '../geom/MultiPolygon.js';
|
||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import Polygon from '../geom/Polygon.js';
|
import Polygon from '../geom/Polygon.js';
|
||||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
import {deflateCoordinates} from '../geom/flat/deflate.js';
|
||||||
import _ol_geom_flat_orient_ from '../geom/flat/orient.js';
|
import _ol_geom_flat_orient_ from '../geom/flat/orient.js';
|
||||||
import {assign, isEmpty} from '../obj.js';
|
import {assign, isEmpty} from '../obj.js';
|
||||||
import {get as getProjection} from '../proj.js';
|
import {get as getProjection} from '../proj.js';
|
||||||
@@ -132,7 +132,7 @@ function convertRings(rings, layout) {
|
|||||||
let i, ii;
|
let i, ii;
|
||||||
for (i = 0, ii = rings.length; i < ii; ++i) {
|
for (i = 0, ii = rings.length; i < ii; ++i) {
|
||||||
flatRing.length = 0;
|
flatRing.length = 0;
|
||||||
_ol_geom_flat_deflate_.coordinates(flatRing, 0, rings[i], layout.length);
|
deflateCoordinates(flatRing, 0, rings[i], layout.length);
|
||||||
// is this ring an outer ring? is it clockwise?
|
// is this ring an outer ring? is it clockwise?
|
||||||
const clockwise = _ol_geom_flat_orient_.linearRingIsClockwise(flatRing, 0,
|
const clockwise = _ol_geom_flat_orient_.linearRingIsClockwise(flatRing, 0,
|
||||||
flatRing.length, layout.length);
|
flatRing.length, layout.length);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {createOrUpdate, forEachCorner, intersects} from '../extent.js';
|
|||||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||||
import GeometryType from '../geom/GeometryType.js';
|
import GeometryType from '../geom/GeometryType.js';
|
||||||
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
||||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
import {deflateCoordinate} from '../geom/flat/deflate.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
@@ -192,7 +192,7 @@ Circle.prototype.setCenterAndRadius = function(center, radius, opt_layout) {
|
|||||||
}
|
}
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array.<number>} */
|
||||||
const flatCoordinates = this.flatCoordinates;
|
const flatCoordinates = this.flatCoordinates;
|
||||||
let offset = _ol_geom_flat_deflate_.coordinate(
|
let offset = deflateCoordinate(
|
||||||
flatCoordinates, 0, center, this.stride);
|
flatCoordinates, 0, center, this.stride);
|
||||||
flatCoordinates[offset++] = flatCoordinates[0] + radius;
|
flatCoordinates[offset++] = flatCoordinates[0] + radius;
|
||||||
for (let i = 1, ii = this.stride; i < ii; ++i) {
|
for (let i = 1, ii = this.stride; i < ii; ++i) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import GeometryLayout from '../geom/GeometryLayout.js';
|
|||||||
import GeometryType from '../geom/GeometryType.js';
|
import GeometryType from '../geom/GeometryType.js';
|
||||||
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
||||||
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
|
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
|
||||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
import {deflateCoordinates} from '../geom/flat/deflate.js';
|
||||||
import {inflateCoordinates} from '../geom/flat/inflate.js';
|
import {inflateCoordinates} from '../geom/flat/inflate.js';
|
||||||
import _ol_geom_flat_interpolate_ from '../geom/flat/interpolate.js';
|
import _ol_geom_flat_interpolate_ from '../geom/flat/interpolate.js';
|
||||||
import _ol_geom_flat_intersectsextent_ from '../geom/flat/intersectsextent.js';
|
import _ol_geom_flat_intersectsextent_ from '../geom/flat/intersectsextent.js';
|
||||||
@@ -250,7 +250,7 @@ LineString.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
this.flatCoordinates = [];
|
this.flatCoordinates = [];
|
||||||
}
|
}
|
||||||
this.flatCoordinates.length = _ol_geom_flat_deflate_.coordinates(
|
this.flatCoordinates.length = deflateCoordinates(
|
||||||
this.flatCoordinates, 0, coordinates, this.stride);
|
this.flatCoordinates, 0, coordinates, this.stride);
|
||||||
this.changed();
|
this.changed();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import GeometryType from '../geom/GeometryType.js';
|
|||||||
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
||||||
import {linearRing as linearRingArea} from '../geom/flat/area.js';
|
import {linearRing as linearRingArea} from '../geom/flat/area.js';
|
||||||
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
|
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
|
||||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
import {deflateCoordinates} from '../geom/flat/deflate.js';
|
||||||
import {inflateCoordinates} from '../geom/flat/inflate.js';
|
import {inflateCoordinates} from '../geom/flat/inflate.js';
|
||||||
import _ol_geom_flat_simplify_ from '../geom/flat/simplify.js';
|
import _ol_geom_flat_simplify_ from '../geom/flat/simplify.js';
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ LinearRing.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
this.flatCoordinates = [];
|
this.flatCoordinates = [];
|
||||||
}
|
}
|
||||||
this.flatCoordinates.length = _ol_geom_flat_deflate_.coordinates(
|
this.flatCoordinates.length = deflateCoordinates(
|
||||||
this.flatCoordinates, 0, coordinates, this.stride);
|
this.flatCoordinates, 0, coordinates, this.stride);
|
||||||
this.changed();
|
this.changed();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import GeometryType from '../geom/GeometryType.js';
|
|||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
||||||
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
|
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
|
||||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
import {deflateCoordinatesArray} from '../geom/flat/deflate.js';
|
||||||
import {inflateCoordinatesArray} from '../geom/flat/inflate.js';
|
import {inflateCoordinatesArray} from '../geom/flat/inflate.js';
|
||||||
import _ol_geom_flat_interpolate_ from '../geom/flat/interpolate.js';
|
import _ol_geom_flat_interpolate_ from '../geom/flat/interpolate.js';
|
||||||
import _ol_geom_flat_intersectsextent_ from '../geom/flat/intersectsextent.js';
|
import _ol_geom_flat_intersectsextent_ from '../geom/flat/intersectsextent.js';
|
||||||
@@ -267,7 +267,7 @@ MultiLineString.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
this.flatCoordinates = [];
|
this.flatCoordinates = [];
|
||||||
}
|
}
|
||||||
const ends = _ol_geom_flat_deflate_.coordinatess(
|
const ends = deflateCoordinatesArray(
|
||||||
this.flatCoordinates, 0, coordinates, this.stride, this.ends_);
|
this.flatCoordinates, 0, coordinates, this.stride, this.ends_);
|
||||||
this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];
|
this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];
|
||||||
this.changed();
|
this.changed();
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import GeometryLayout from '../geom/GeometryLayout.js';
|
|||||||
import GeometryType from '../geom/GeometryType.js';
|
import GeometryType from '../geom/GeometryType.js';
|
||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
||||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
import {deflateCoordinates} from '../geom/flat/deflate.js';
|
||||||
import {inflateCoordinates} from '../geom/flat/inflate.js';
|
import {inflateCoordinates} from '../geom/flat/inflate.js';
|
||||||
import {squaredDistance as squaredDx} from '../math.js';
|
import {squaredDistance as squaredDx} from '../math.js';
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ MultiPoint.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
this.flatCoordinates = [];
|
this.flatCoordinates = [];
|
||||||
}
|
}
|
||||||
this.flatCoordinates.length = _ol_geom_flat_deflate_.coordinates(
|
this.flatCoordinates.length = deflateCoordinates(
|
||||||
this.flatCoordinates, 0, coordinates, this.stride);
|
this.flatCoordinates, 0, coordinates, this.stride);
|
||||||
this.changed();
|
this.changed();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {linearRingss as linearRingssArea} from '../geom/flat/area.js';
|
|||||||
import {linearRingss as linearRingssCenter} from '../geom/flat/center.js';
|
import {linearRingss as linearRingssCenter} from '../geom/flat/center.js';
|
||||||
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
|
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
|
||||||
import {linearRingssContainsXY} from '../geom/flat/contains.js';
|
import {linearRingssContainsXY} from '../geom/flat/contains.js';
|
||||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
import {deflateMultiCoordinatesArray} from '../geom/flat/deflate.js';
|
||||||
import {inflateMultiCoordinatesArray} from '../geom/flat/inflate.js';
|
import {inflateMultiCoordinatesArray} from '../geom/flat/inflate.js';
|
||||||
import _ol_geom_flat_interiorpoint_ from '../geom/flat/interiorpoint.js';
|
import _ol_geom_flat_interiorpoint_ from '../geom/flat/interiorpoint.js';
|
||||||
import _ol_geom_flat_intersectsextent_ from '../geom/flat/intersectsextent.js';
|
import _ol_geom_flat_intersectsextent_ from '../geom/flat/intersectsextent.js';
|
||||||
@@ -364,7 +364,7 @@ MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
this.flatCoordinates = [];
|
this.flatCoordinates = [];
|
||||||
}
|
}
|
||||||
const endss = _ol_geom_flat_deflate_.coordinatesss(
|
const endss = deflateMultiCoordinatesArray(
|
||||||
this.flatCoordinates, 0, coordinates, this.stride, this.endss_);
|
this.flatCoordinates, 0, coordinates, this.stride, this.endss_);
|
||||||
if (endss.length === 0) {
|
if (endss.length === 0) {
|
||||||
this.flatCoordinates.length = 0;
|
this.flatCoordinates.length = 0;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {createOrUpdateFromCoordinate, containsXY} from '../extent.js';
|
|||||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||||
import GeometryType from '../geom/GeometryType.js';
|
import GeometryType from '../geom/GeometryType.js';
|
||||||
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
||||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
import {deflateCoordinate} from '../geom/flat/deflate.js';
|
||||||
import {squaredDistance as squaredDx} from '../math.js';
|
import {squaredDistance as squaredDx} from '../math.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -108,7 +108,7 @@ Point.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
this.flatCoordinates = [];
|
this.flatCoordinates = [];
|
||||||
}
|
}
|
||||||
this.flatCoordinates.length = _ol_geom_flat_deflate_.coordinate(
|
this.flatCoordinates.length = deflateCoordinate(
|
||||||
this.flatCoordinates, 0, coordinates, this.stride);
|
this.flatCoordinates, 0, coordinates, this.stride);
|
||||||
this.changed();
|
this.changed();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {offset as sphereOffset} from '../sphere.js';
|
|||||||
import {linearRings as linearRingsArea} from '../geom/flat/area.js';
|
import {linearRings as linearRingsArea} from '../geom/flat/area.js';
|
||||||
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
|
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
|
||||||
import {linearRingsContainsXY} from '../geom/flat/contains.js';
|
import {linearRingsContainsXY} from '../geom/flat/contains.js';
|
||||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
import {deflateCoordinatesArray} from '../geom/flat/deflate.js';
|
||||||
import {inflateCoordinatesArray} from '../geom/flat/inflate.js';
|
import {inflateCoordinatesArray} from '../geom/flat/inflate.js';
|
||||||
import _ol_geom_flat_interiorpoint_ from '../geom/flat/interiorpoint.js';
|
import _ol_geom_flat_interiorpoint_ from '../geom/flat/interiorpoint.js';
|
||||||
import _ol_geom_flat_intersectsextent_ from '../geom/flat/intersectsextent.js';
|
import _ol_geom_flat_intersectsextent_ from '../geom/flat/intersectsextent.js';
|
||||||
@@ -345,7 +345,7 @@ Polygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
this.flatCoordinates = [];
|
this.flatCoordinates = [];
|
||||||
}
|
}
|
||||||
const ends = _ol_geom_flat_deflate_.coordinatess(
|
const ends = deflateCoordinatesArray(
|
||||||
this.flatCoordinates, 0, coordinates, this.stride, this.ends_);
|
this.flatCoordinates, 0, coordinates, this.stride, this.ends_);
|
||||||
this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];
|
this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];
|
||||||
this.changed();
|
this.changed();
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/geom/flat/deflate
|
* @module ol/geom/flat/deflate
|
||||||
*/
|
*/
|
||||||
const _ol_geom_flat_deflate_ = {};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -11,12 +10,12 @@ const _ol_geom_flat_deflate_ = {};
|
|||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @return {number} offset Offset.
|
* @return {number} offset Offset.
|
||||||
*/
|
*/
|
||||||
_ol_geom_flat_deflate_.coordinate = function(flatCoordinates, offset, coordinate, stride) {
|
export function deflateCoordinate(flatCoordinates, offset, coordinate, stride) {
|
||||||
for (let i = 0, ii = coordinate.length; i < ii; ++i) {
|
for (let i = 0, ii = coordinate.length; i < ii; ++i) {
|
||||||
flatCoordinates[offset++] = coordinate[i];
|
flatCoordinates[offset++] = coordinate[i];
|
||||||
}
|
}
|
||||||
return offset;
|
return offset;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,7 +25,7 @@ _ol_geom_flat_deflate_.coordinate = function(flatCoordinates, offset, coordinate
|
|||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @return {number} offset Offset.
|
* @return {number} offset Offset.
|
||||||
*/
|
*/
|
||||||
_ol_geom_flat_deflate_.coordinates = function(flatCoordinates, offset, coordinates, stride) {
|
export function deflateCoordinates(flatCoordinates, offset, coordinates, stride) {
|
||||||
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
|
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||||
const coordinate = coordinates[i];
|
const coordinate = coordinates[i];
|
||||||
for (let j = 0; j < stride; ++j) {
|
for (let j = 0; j < stride; ++j) {
|
||||||
@@ -34,7 +33,7 @@ _ol_geom_flat_deflate_.coordinates = function(flatCoordinates, offset, coordinat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return offset;
|
return offset;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,18 +44,18 @@ _ol_geom_flat_deflate_.coordinates = function(flatCoordinates, offset, coordinat
|
|||||||
* @param {Array.<number>=} opt_ends Ends.
|
* @param {Array.<number>=} opt_ends Ends.
|
||||||
* @return {Array.<number>} Ends.
|
* @return {Array.<number>} Ends.
|
||||||
*/
|
*/
|
||||||
_ol_geom_flat_deflate_.coordinatess = function(flatCoordinates, offset, coordinatess, stride, opt_ends) {
|
export function deflateCoordinatesArray(flatCoordinates, offset, coordinatess, stride, opt_ends) {
|
||||||
const ends = opt_ends ? opt_ends : [];
|
const ends = opt_ends ? opt_ends : [];
|
||||||
let i = 0;
|
let i = 0;
|
||||||
for (let j = 0, jj = coordinatess.length; j < jj; ++j) {
|
for (let j = 0, jj = coordinatess.length; j < jj; ++j) {
|
||||||
const end = _ol_geom_flat_deflate_.coordinates(
|
const end = deflateCoordinates(
|
||||||
flatCoordinates, offset, coordinatess[j], stride);
|
flatCoordinates, offset, coordinatess[j], stride);
|
||||||
ends[i++] = end;
|
ends[i++] = end;
|
||||||
offset = end;
|
offset = end;
|
||||||
}
|
}
|
||||||
ends.length = i;
|
ends.length = i;
|
||||||
return ends;
|
return ends;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,16 +66,15 @@ _ol_geom_flat_deflate_.coordinatess = function(flatCoordinates, offset, coordina
|
|||||||
* @param {Array.<Array.<number>>=} opt_endss Endss.
|
* @param {Array.<Array.<number>>=} opt_endss Endss.
|
||||||
* @return {Array.<Array.<number>>} Endss.
|
* @return {Array.<Array.<number>>} Endss.
|
||||||
*/
|
*/
|
||||||
_ol_geom_flat_deflate_.coordinatesss = function(flatCoordinates, offset, coordinatesss, stride, opt_endss) {
|
export function deflateMultiCoordinatesArray(flatCoordinates, offset, coordinatesss, stride, opt_endss) {
|
||||||
const endss = opt_endss ? opt_endss : [];
|
const endss = opt_endss ? opt_endss : [];
|
||||||
let i = 0;
|
let i = 0;
|
||||||
for (let j = 0, jj = coordinatesss.length; j < jj; ++j) {
|
for (let j = 0, jj = coordinatesss.length; j < jj; ++j) {
|
||||||
const ends = _ol_geom_flat_deflate_.coordinatess(
|
const ends = deflateCoordinatesArray(
|
||||||
flatCoordinates, offset, coordinatesss[j], stride, endss[i]);
|
flatCoordinates, offset, coordinatesss[j], stride, endss[i]);
|
||||||
endss[i++] = ends;
|
endss[i++] = ends;
|
||||||
offset = ends[ends.length - 1];
|
offset = ends[ends.length - 1];
|
||||||
}
|
}
|
||||||
endss.length = i;
|
endss.length = i;
|
||||||
return endss;
|
return endss;
|
||||||
};
|
}
|
||||||
export default _ol_geom_flat_deflate_;
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import _ol_geom_flat_deflate_ from '../../../../../src/ol/geom/flat/deflate.js';
|
import {deflateCoordinates, deflateCoordinatesArray} from '../../../../../src/ol/geom/flat/deflate.js';
|
||||||
|
|
||||||
|
|
||||||
describe('ol.geom.flat.deflate', function() {
|
describe('ol.geom.flat.deflate', function() {
|
||||||
@@ -11,7 +11,7 @@ describe('ol.geom.flat.deflate', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('flattens coordinates', function() {
|
it('flattens coordinates', function() {
|
||||||
const offset = _ol_geom_flat_deflate_.coordinates(
|
const offset = deflateCoordinates(
|
||||||
flatCoordinates, 0, [[1, 2], [3, 4]], 2);
|
flatCoordinates, 0, [[1, 2], [3, 4]], 2);
|
||||||
expect(offset).to.be(4);
|
expect(offset).to.be(4);
|
||||||
expect(flatCoordinates).to.eql([1, 2, 3, 4]);
|
expect(flatCoordinates).to.eql([1, 2, 3, 4]);
|
||||||
@@ -27,7 +27,7 @@ describe('ol.geom.flat.deflate', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('flattens arrays of coordinates', function() {
|
it('flattens arrays of coordinates', function() {
|
||||||
const ends = _ol_geom_flat_deflate_.coordinatess(flatCoordinates, 0,
|
const ends = deflateCoordinatesArray(flatCoordinates, 0,
|
||||||
[[[1, 2], [3, 4]], [[5, 6], [7, 8]]], 2);
|
[[[1, 2], [3, 4]], [[5, 6], [7, 8]]], 2);
|
||||||
expect(ends).to.eql([4, 8]);
|
expect(ends).to.eql([4, 8]);
|
||||||
expect(flatCoordinates).to.eql([1, 2, 3, 4, 5, 6, 7, 8]);
|
expect(flatCoordinates).to.eql([1, 2, 3, 4, 5, 6, 7, 8]);
|
||||||
|
|||||||
Reference in New Issue
Block a user