Socket
Socket
Sign inDemoInstall

@turf/meta

Package Overview
Dependencies
Maintainers
4
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/meta - npm Package Compare versions

Comparing version 4.7.1 to 4.7.3

8

index.js
/**
* GeoJSON BBox
*
* @private
* @typedef {[number, number, number, number]} BBox

@@ -10,2 +11,3 @@ */

*
* @private
* @typedef {(number|string)} Id

@@ -17,2 +19,3 @@ */

*
* @private
* @typedef {Object} FeatureCollection

@@ -28,2 +31,3 @@ * @property {string} type

*
* @private
* @typedef {Object} Feature

@@ -40,2 +44,3 @@ * @property {string} type

*
* @private
* @typedef {Object} Geometry

@@ -732,6 +737,5 @@ * @property {string} type

* var total = 0;
* var initialValue = 0;
* turf.segmentEach(polygon, function () {
* total++;
* }, initialValue);
* });
*/

@@ -738,0 +742,0 @@ function segmentEach(geojson, callback) {

{
"name": "@turf/meta",
"version": "4.7.1",
"version": "4.7.3",
"description": "turf meta module",

@@ -51,4 +51,4 @@ "main": "index.js",

"devDependencies": {
"@turf/helpers": "4.7.1",
"@turf/random": "4.7.1",
"@turf/helpers": "^4.7.3",
"@turf/random": "^4.7.3",
"benchmark": "2.1.4",

@@ -55,0 +55,0 @@ "tape": "4.8.0"

@@ -24,3 +24,3 @@ # @turf/meta

- `geojson` **([FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Geometry](http://geojson.org/geojson-spec.html#geometry) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects))** any GeoJSON object
- `geojson` **([FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects) \| [Geometry](http://geojson.org/geojson-spec.html#geometry))** any GeoJSON object
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (currentCoord, coordIndex, featureIndex, featureSubIndex)

@@ -142,30 +142,2 @@ - `excludeWrapCoord` **\[[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. (optional, default `false`)

# propReduceCallback
Callback for propReduce
The first time the callback function is called, the values provided as arguments depend
on whether the reduce method has an initialValue argument.
If an initialValue is provided to the reduce method:
- The previousValue argument is initialValue.
- The currentValue argument is the value of the first element present in the array.
If an initialValue is not provided:
- The previousValue argument is the value of the first element present in the array.
- The currentValue argument is the value of the second element present in the array.
**Parameters**
- `previousValue` **Any** The accumulated value previously returned in the last invocation
of the callback, or initialValue, if supplied.
- `currentProperties` **Any** The current properties being processed.
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The index of the current element being processed in the
array.Starts at index 0, if an initialValue is provided, and at index 1 otherwise.
- `geojson`
- `callback`
- `initialValue`
# propReduce

@@ -201,9 +173,24 @@

# featureEachCallback
# propReduceCallback
Callback for featureEach
Callback for propReduce
The first time the callback function is called, the values provided as arguments depend
on whether the reduce method has an initialValue argument.
If an initialValue is provided to the reduce method:
- The previousValue argument is initialValue.
- The currentValue argument is the value of the first element present in the array.
If an initialValue is not provided:
- The previousValue argument is the value of the first element present in the array.
- The currentValue argument is the value of the second element present in the array.
**Parameters**
- `currentFeature` **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<any>** The current feature being processed.
- `previousValue` **Any** The accumulated value previously returned in the last invocation
of the callback, or initialValue, if supplied.
- `currentProperties` **Any** The current properties being processed.
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The index of the current element being processed in the

@@ -213,2 +200,3 @@ array.Starts at index 0, if an initialValue is provided, and at index 1 otherwise.

- `callback`
- `initialValue`

@@ -222,3 +210,3 @@ # featureEach

- `geojson` **([Geometry](http://geojson.org/geojson-spec.html#geometry) \| [FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects))** any GeoJSON object
- `geojson` **([FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects) \| [Geometry](http://geojson.org/geojson-spec.html#geometry))** any GeoJSON object
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (currentFeature, featureIndex)

@@ -240,2 +228,14 @@

# featureEachCallback
Callback for featureEach
**Parameters**
- `currentFeature` **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<any>** The current feature being processed.
- `featureIndex` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The index of the current element being processed in the
array.Starts at index 0, if an initialValue is provided, and at index 1 otherwise.
- `geojson`
- `callback`
# featureReduceCallback

@@ -275,3 +275,3 @@

- `geojson` **([Geometry](http://geojson.org/geojson-spec.html#geometry) \| [FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects))** any GeoJSON object
- `geojson` **([FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects) \| [Geometry](http://geojson.org/geojson-spec.html#geometry))** any GeoJSON object
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (previousValue, currentFeature, featureIndex)

@@ -304,3 +304,3 @@ - `initialValue` **\[Any]** Value to use as the first argument to the first call of the callback.

- `geojson` **([Geometry](http://geojson.org/geojson-spec.html#geometry) \| [FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects))** any GeoJSON object
- `geojson` **([FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects) \| [Geometry](http://geojson.org/geojson-spec.html#geometry))** any GeoJSON object

@@ -340,3 +340,3 @@ **Examples**

- `geojson` **([Geometry](http://geojson.org/geojson-spec.html#geometry) \| [FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects))** any GeoJSON object
- `geojson` **([FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects) \| [Geometry](http://geojson.org/geojson-spec.html#geometry))** any GeoJSON object
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (currentGeometry, featureIndex, currentProperties)

@@ -394,3 +394,3 @@

- `geojson` **([Geometry](http://geojson.org/geojson-spec.html#geometry) \| [FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects))** any GeoJSON object
- `geojson` **([FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects) \| [Geometry](http://geojson.org/geojson-spec.html#geometry))** any GeoJSON object
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (previousValue, currentGeometry, featureIndex, currentProperties)

@@ -439,3 +439,3 @@ - `initialValue` **\[Any]** Value to use as the first argument to the first call of the callback.

- `geojson` **([Geometry](http://geojson.org/geojson-spec.html#geometry) \| [FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects))** any GeoJSON object
- `geojson` **([FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects) \| [Geometry](http://geojson.org/geojson-spec.html#geometry))** any GeoJSON object
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (currentFeature, featureIndex, featureSubIndex)

@@ -494,3 +494,3 @@

- `geojson` **([Geometry](http://geojson.org/geojson-spec.html#geometry) \| [FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects))** any GeoJSON object
- `geojson` **([FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [Feature](http://geojson.org/geojson-spec.html#feature-objects) \| [Geometry](http://geojson.org/geojson-spec.html#geometry))** any GeoJSON object
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** a method that takes (previousValue, currentFeature, featureIndex, featureSubIndex)

@@ -557,6 +557,5 @@ - `initialValue` **\[Any]** Value to use as the first argument to the first call of the callback.

var total = 0;
var initialValue = 0;
turf.segmentEach(polygon, function () {
total++;
}, initialValue);
});
```

@@ -656,3 +655,3 @@

```javascript
var mtLn = turf.multiLine([
var mtLn = turf.multiLineString([
turf.lineString([[26, 37], [35, 45]]),

@@ -659,0 +658,0 @@ turf.lineString([[36, 53], [38, 50], [41, 55]])

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc