diff --git a/packages/turf-clone/LICENSE b/packages/turf-clone/LICENSE new file mode 100644 index 0000000000..96ce51b76f --- /dev/null +++ b/packages/turf-clone/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2017 TurfJS + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/turf-clone/README.md b/packages/turf-clone/README.md new file mode 100644 index 0000000000..738a3a2dba --- /dev/null +++ b/packages/turf-clone/README.md @@ -0,0 +1,53 @@ +# @turf/clone + +# clone + +Prevents GeoJSON coordinates from being mutated, similar to JSON.parse(JSON.stringify(geojson)). + +Only cloning coordinates can be 3x-20x faster than the `parse + stringify` approach. + +**Parameters** + +- `geojson` **[GeoJSON](http://geojson.org/geojson-spec.html#geojson-objects)** GeoJSON Object +- `cloneAll` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** clones entire GeoJSON (3-20x slower if True) (optional, default `false`) + +**Examples** + +```javascript +var line = { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [[-74, 40], [-78, 42], [-82, 35]] + } +} +var lineCloned = turf.clone(line); +``` + +Returns **[GeoJSON](http://geojson.org/geojson-spec.html#geojson-objects)** cloned GeoJSON Object + + + +--- + +This module is part of the [Turfjs project](http://turfjs.org/), an open source +module collection dedicated to geographic algorithms. It is maintained in the +[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create +PRs and issues. + +### Installation + +Install this module individually: + +```sh +$ npm install @turf/clone +``` + +Or install the Turf module that includes it as a function: + +```sh +$ npm install @turf/turf +``` diff --git a/packages/turf-clone/bench.js b/packages/turf-clone/bench.js new file mode 100644 index 0000000000..1dafadb396 --- /dev/null +++ b/packages/turf-clone/bench.js @@ -0,0 +1,45 @@ +const Benchmark = require('benchmark'); +const {point, lineString, polygon, featureCollection} = require('@turf/helpers'); +const clone = require('./'); + +const fixtures = [ + point([0, 20]), + lineString([[10, 40], [0, 20]]), + polygon([[[10, 40], [0, 20], [20, 0], [10, 40]]]), + featureCollection([ + point([0, 20]), + lineString([[10, 40], [0, 20]]), + polygon([[[10, 40], [0, 20], [20, 0], [10, 40]]]) + ]) +]; + +/** + * Benchmark Results + * + * Point: 0.149ms + * LineString: 0.036ms + * Polygon: 0.067ms + * FeatureCollection: 0.043ms + * Point x 6,972,739 ops/sec ±5.50% (86 runs sampled) + * Point -- clones entire object x 357,437 ops/sec ±0.95% (88 runs sampled) + * LineString x 1,502,039 ops/sec ±1.01% (86 runs sampled) + * LineString -- clones entire object x 291,562 ops/sec ±1.00% (88 runs sampled) + * Polygon x 723,111 ops/sec ±1.06% (87 runs sampled) + * Polygon -- clones entire object x 227,034 ops/sec ±0.62% (91 runs sampled) + * FeatureCollection x 370,012 ops/sec ±1.25% (87 runs sampled) + * FeatureCollection -- clones entire object x 91,582 ops/sec ±0.81% (86 runs sampled) + */ +const suite = new Benchmark.Suite('turf-clone'); +for (const fixture of fixtures) { + const name = (fixture.geometry) ? fixture.geometry.type : fixture.type; + console.time(name); + clone(fixture, true); + console.timeEnd(name); + suite.add(name, () => clone(fixture)); + suite.add(name + ' -- clones entire object', () => clone(fixture, true)); +} + +suite + .on('cycle', e => console.log(String(e.target))) + .on('complete', () => {}) + .run(); diff --git a/packages/turf-clone/index.d.ts b/packages/turf-clone/index.d.ts new file mode 100644 index 0000000000..603a746869 --- /dev/null +++ b/packages/turf-clone/index.d.ts @@ -0,0 +1,10 @@ +/// + +type Types = GeoJSON.FeatureCollection | GeoJSON.Feature | GeoJSON.GeometryObject | GeoJSON.GeometryCollection; + +/** + * http://turfjs.org/docs/#clone + */ +declare function clone(geojson: T, cloneAll?: boolean): T; +declare namespace clone { } +export = clone; diff --git a/packages/turf-clone/index.js b/packages/turf-clone/index.js new file mode 100644 index 0000000000..6ec11df2c4 --- /dev/null +++ b/packages/turf-clone/index.js @@ -0,0 +1,121 @@ +/** + * Prevents GeoJSON coordinates from being mutated, similar to JSON.parse(JSON.stringify(geojson)). + * + * Only cloning coordinates can be 3x-20x faster than the `parse + stringify` approach. + * + * @name clone + * @param {GeoJSON} geojson GeoJSON Object + * @param {Boolean} [cloneAll=false] clones entire GeoJSON (3-20x slower if True) + * @returns {GeoJSON} cloned GeoJSON Object + * @example + * var line = { + * "type": "Feature", + * "properties": {}, + * "geometry": { + * "type": "LineString", + * "coordinates": [[-74, 40], [-78, 42], [-82, 35]] + * } + * } + * var lineCloned = turf.clone(line); + */ +module.exports = function (geojson, cloneAll) { + if (!geojson) throw new Error('geojson is required'); + if (cloneAll && typeof cloneAll !== 'boolean') throw new Error('cloneAll must be a Boolean'); + + // Clone entire GeoJSON object (3-20x slower) + if (cloneAll) return JSON.parse(JSON.stringify(geojson)); + + // Clones only coordinates + return clone(geojson); +}; + +/** + * Clone + * + * @private + * @param {GeoJSON} geojson GeoJSON Feature or Geometry + * @returns {GeoJSON} cloned Feature + */ +function clone(geojson) { + // Geometry Object + if (geojson.coordinates) return cloneGeometry(geojson); + + // Feature + if (geojson.type === 'Feature') return cloneFeature(geojson); + + // Feature Collection + if (geojson.type === 'FeatureCollection') return cloneFeatureCollection(geojson); + + // Geometry Collection + if (geojson.type === 'GeometryCollection') return cloneGeometry(geojson); +} + +/** + * Clone Feature + * + * @private + * @param {Feature} feature GeoJSON Feature + * @returns {Feature} cloned Feature + */ +function cloneFeature(feature) { + var cloned = { + type: 'Feature', + properties: feature.properties || {}, + geometry: cloneGeometry(feature.geometry) + }; + if (feature.id) cloned.id = feature.id; + if (feature.bbox) cloned.bbox = feature.bbox; + return cloned; +} + +/** + * Clone Feature Collection + * + * @private + * @param {FeatureCollection} geojson GeoJSON Feature Collection + * @returns {FeatureCollection} cloned Feature Collection + */ +function cloneFeatureCollection(geojson) { + return { + type: 'FeatureCollection', + features: geojson.features.map(function (feature) { + return cloneFeature(feature); + }) + }; +} + +/** + * Clone Geometry + * + * @private + * @param {Geometry} geometry GeoJSON Geometry + * @returns {Geometry} cloned Geometry + */ +function cloneGeometry(geometry) { + if (geometry.type === 'GeometryCollection') { + return { + type: 'GeometryCollection', + geometries: geometry.geometries.map(function (geom) { + return cloneGeometry(geom); + }) + }; + } + return { + type: geometry.type, + coordinates: deepSlice(geometry.coordinates) + }; +} + +/** + * Deep Slice coordinates + * + * @private + * @param {Coordinates} coords Coordinates + * @returns {Coordinates} all coordinates sliced + */ +function deepSlice(coords) { + if (typeof coords[0] !== 'object') { return coords.slice(); } + return coords.map(function (coord) { + return deepSlice(coord); + }); +} diff --git a/packages/turf-clone/package.json b/packages/turf-clone/package.json new file mode 100644 index 0000000000..ca04839c31 --- /dev/null +++ b/packages/turf-clone/package.json @@ -0,0 +1,39 @@ +{ + "name": "@turf/clone", + "version": "4.0.0", + "description": "turf clone module", + "main": "index.js", + "types": "index.d.ts", + "files": [ + "index.js", + "index.d.ts" + ], + "scripts": { + "test": "node test.js", + "bench": "node bench.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/Turfjs/turf.git" + }, + "keywords": [ + "turf", + "clone" + ], + "author": "Turf Authors", + "contributors": [ + "Denis Carriere <@DenisCarriere>" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/Turfjs/turf/issues" + }, + "homepage": "https://github.com/Turfjs/turf", + "devDependencies": { + "@turf/helpers": "^4.4.0", + "@turf/meta": "^4.4.0", + "benchmark": "^2.1.4", + "tape": "^4.6.3" + }, + "dependencies": {} +} diff --git a/packages/turf-clone/test.js b/packages/turf-clone/test.js new file mode 100644 index 0000000000..ded6999452 --- /dev/null +++ b/packages/turf-clone/test.js @@ -0,0 +1,91 @@ +const test = require('tape'); +const {point, lineString, polygon, featureCollection, geometryCollection} = require('@turf/helpers'); +const {coordEach} = require('@turf/meta'); +const clone = require('./'); + + +test('turf-clone', t => { + // Define Features + const pt = point([0, 20]); + const line = lineString([[10, 40], [0, 20]]); + const poly = polygon([[[10, 40], [0, 20], [20, 0], [10, 40]]]); + const fc = featureCollection([ + point([0, 20]), + lineString([[10, 40], [0, 20]]), + polygon([[[10, 40], [0, 20], [20, 0], [10, 40]]]) + ]); + const gc = geometryCollection([ + point([0, 20]).geometry, + lineString([[10, 40], [0, 20]]).geometry, + polygon([[[10, 40], [0, 20], [20, 0], [10, 40]]]).geometry + ]).geometry; + + // Clone Features + const ptCloned = clone(pt); + const lineCloned = clone(line); + const polyCloned = clone(poly, true); + const fcCloned = clone(fc); + const gcCloned = clone(gc); + + // Apply Mutation + ptCloned.geometry.coordinates.reverse(); + lineCloned.geometry.coordinates.reverse(); + polyCloned.geometry.coordinates.reverse(); + coordEach(fcCloned, coord => coord.reverse()); + coordEach(gcCloned, coord => coord.reverse()); + + // Original Geometries should not be mutated + t.deepEqual(pt.geometry.coordinates, [0, 20], 'point'); + t.deepEqual(line.geometry.coordinates, [[10, 40], [0, 20]], 'lineString'); + t.deepEqual(poly.geometry.coordinates, [[[10, 40], [0, 20], [20, 0], [10, 40]]], 'polygon'); + + // Feature Collection + t.deepEqual(fc.features[0].geometry.coordinates, [0, 20], 'fc - point'); + t.deepEqual(fc.features[1].geometry.coordinates, [[10, 40], [0, 20]], 'fc - lineString'); + t.deepEqual(fc.features[2].geometry.coordinates, [[[10, 40], [0, 20], [20, 0], [10, 40]]], 'fc - polygon'); + + // Geometry Collection + t.deepEqual(gc.geometries[0].coordinates, [0, 20], 'gc - point'); + t.deepEqual(gc.geometries[1].coordinates, [[10, 40], [0, 20]], 'gc - lineString'); + t.deepEqual(gc.geometries[2].coordinates, [[[10, 40], [0, 20], [20, 0], [10, 40]]], 'gc - polygon'); + t.end(); +}); + +test('turf-clone -- throws', t => { + const pt = point([0, 20]); + + t.throws(() => clone(), /geojson is required/); + t.throws(() => clone(pt, 'foo'), /cloneAll must be a Boolean/); + t.end(); +}); + +test('turf-clone -- optional properties', t => { + const pt = point([0, 20]); + pt.properties = undefined; + pt.id = 300; + pt.bbox = [0, 20, 0, 20]; + + const ptCloned = clone(pt); + t.deepEqual(ptCloned.bbox, [0, 20, 0, 20]); + t.equal(ptCloned.id, 300); + t.end(); +}); + +test('turf-clone -- Geometry Objects', t => { + const pt = point([0, 20]).geometry; + const line = lineString([[10, 40], [0, 20]]).geometry; + const poly = polygon([[[10, 40], [0, 20], [20, 0], [10, 40]]]).geometry; + + const ptCloned = clone(pt); + const lineCloned = clone(line); + const polyCloned = clone(poly); + + ptCloned.coordinates.reverse(); + lineCloned.coordinates.reverse(); + polyCloned.coordinates.reverse(); + + t.deepEqual(pt.coordinates, [0, 20], 'geometry point'); + t.deepEqual(line.coordinates, [[10, 40], [0, 20]], 'geometry line'); + t.deepEqual(poly.coordinates, [[[10, 40], [0, 20], [20, 0], [10, 40]]], 'geometry polygon'); + t.end(); +}); diff --git a/packages/turf-clone/types.ts b/packages/turf-clone/types.ts new file mode 100644 index 0000000000..4d9ce4b653 --- /dev/null +++ b/packages/turf-clone/types.ts @@ -0,0 +1,6 @@ +import {point} from '@turf/helpers' +import * as clone from './' + +const pt = point([0, 20]) +const ptCloned = clone(pt) +const ptClonedAll = clone(pt, true) diff --git a/packages/turf-clone/yarn.lock b/packages/turf-clone/yarn.lock new file mode 100644 index 0000000000..9a776e4073 --- /dev/null +++ b/packages/turf-clone/yarn.lock @@ -0,0 +1,219 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@turf/helpers@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@turf/helpers/-/helpers-4.4.0.tgz#c83112f7fbe6ed183c7c0c2f776481b94d1cbd01" + +"@turf/meta@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@turf/meta/-/meta-4.4.0.tgz#4fa25d4cc0525bd4cdbaf4ff68a6f8ae81f1975f" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +benchmark@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/benchmark/-/benchmark-2.1.4.tgz#09f3de31c916425d498cc2ee565a0ebf3c2a5629" + dependencies: + lodash "^4.17.4" + platform "^1.3.3" + +brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +deep-equal@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + +define-properties@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + dependencies: + foreach "^2.0.5" + object-keys "^1.0.8" + +defined@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + +es-abstract@^1.5.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.7.0.tgz#dfade774e01bfcd97f96180298c449c8623fb94c" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.0" + is-callable "^1.1.3" + is-regex "^1.0.3" + +es-to-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + dependencies: + is-callable "^1.1.1" + is-date-object "^1.0.1" + is-symbol "^1.0.1" + +for-each@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.2.tgz#2c40450b9348e97f281322593ba96704b9abd4d4" + dependencies: + is-function "~1.0.0" + +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +function-bind@^1.0.2, function-bind@^1.1.0, function-bind@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" + +glob@~7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +has@^1.0.1, has@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +is-callable@^1.1.1, is-callable@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + +is-function@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" + +is-regex@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + dependencies: + has "^1.0.1" + +is-symbol@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" + +lodash@^4.17.4: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +object-inspect@~1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.2.2.tgz#c82115e4fcc888aea14d64c22e4f17f6a70d5e5a" + +object-keys@^1.0.8: + version "1.0.11" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +platform@^1.3.3: + version "1.3.4" + resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.4.tgz#6f0fb17edaaa48f21442b3a975c063130f1c3ebd" + +resolve@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" + dependencies: + path-parse "^1.0.5" + +resumer@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" + dependencies: + through "~2.3.4" + +string.prototype.trim@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.0" + function-bind "^1.0.2" + +tape@^4.6.3: + version "4.7.0" + resolved "https://registry.yarnpkg.com/tape/-/tape-4.7.0.tgz#f3ebb214fef3d6907e5a57dbaafe3bd8a7cbed88" + dependencies: + deep-equal "~1.0.1" + defined "~1.0.0" + for-each "~0.3.2" + function-bind "~1.1.0" + glob "~7.1.2" + has "~1.0.1" + inherits "~2.0.3" + minimist "~1.2.0" + object-inspect "~1.2.2" + resolve "~1.3.3" + resumer "~0.0.0" + string.prototype.trim "~1.1.2" + through "~2.3.8" + +through@~2.3.4, through@~2.3.8: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" diff --git a/packages/turf/package.json b/packages/turf/package.json index 51cf3c9e48..e9cbcaad7a 100644 --- a/packages/turf/package.json +++ b/packages/turf/package.json @@ -143,7 +143,7 @@ "disc": "^1.3.2", "hcat": "0.0.5", "jsdoc": "^3.3.0-beta1", - "tape": "^3.5.0", + "tape": "^4.7.0", "uglify-js": "^2.7.5" }, "homepage": "https://github.com/Turfjs/turf" diff --git a/packages/turf/yarn.lock b/packages/turf/yarn.lock index cd4f837a0a..38dbe1c8c9 100644 --- a/packages/turf/yarn.lock +++ b/packages/turf/yarn.lock @@ -2165,4 +2165,4 @@ yargs@~3.10.0: camelcase "^1.0.2" cliui "^2.1.0" decamelize "^1.0.0" - window-size "0.1.0" + window-size "0.1.0" \ No newline at end of file