Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/flatten

Package Overview
Dependencies
Maintainers
6
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/flatten - npm Package Compare versions

Comparing version 6.2.0-alpha.2 to 6.2.0-alpha.3

dist/es/package.json

12

dist/es/index.js

@@ -23,11 +23,11 @@ import { flattenEach } from '@turf/meta';

function flatten(geojson) {
if (!geojson) throw new Error('geojson is required');
if (!geojson) throw new Error("geojson is required");
var results = [];
flattenEach(geojson, function (feature) {
results.push(feature);
});
return featureCollection(results);
var results = [];
flattenEach(geojson, function (feature) {
results.push(feature);
});
return featureCollection(results);
}
export default flatten;

@@ -25,12 +25,11 @@ 'use strict';

function flatten(geojson) {
if (!geojson) throw new Error('geojson is required');
if (!geojson) throw new Error("geojson is required");
var results = [];
meta.flattenEach(geojson, function (feature) {
results.push(feature);
});
return helpers.featureCollection(results);
var results = [];
meta.flattenEach(geojson, function (feature) {
results.push(feature);
});
return helpers.featureCollection(results);
}
module.exports = flatten;
module.exports.default = flatten;
import {
Point,
MultiPoint,
LineString,
MultiLineString,
Polygon,
MultiPolygon,
Feature,
FeatureCollection,
AllGeoJSON
} from '@turf/helpers'
Point,
MultiPoint,
LineString,
MultiLineString,
Polygon,
MultiPolygon,
Feature,
FeatureCollection,
AllGeoJSON,
} from "@turf/helpers";

@@ -16,7 +16,13 @@ /**

*/
declare function flatten<T extends Point | MultiPoint>(geojson: Feature<T> | FeatureCollection<T> | T): FeatureCollection<Point>;
declare function flatten<T extends LineString | MultiLineString>(geojson: Feature<T> | FeatureCollection<T> | T): FeatureCollection<LineString>;
declare function flatten<T extends Polygon | MultiPolygon>(geojson: Feature<T> | FeatureCollection<T> | T): FeatureCollection<Polygon>;
declare function flatten<T extends Point | MultiPoint>(
geojson: Feature<T> | FeatureCollection<T> | T
): FeatureCollection<Point>;
declare function flatten<T extends LineString | MultiLineString>(
geojson: Feature<T> | FeatureCollection<T> | T
): FeatureCollection<LineString>;
declare function flatten<T extends Polygon | MultiPolygon>(
geojson: Feature<T> | FeatureCollection<T> | T
): FeatureCollection<Polygon>;
declare function flatten(geojson: AllGeoJSON): FeatureCollection<any>;
export default flatten;
{
"name": "@turf/flatten",
"version": "6.2.0-alpha.2",
"version": "6.2.0-alpha.3",
"description": "turf flatten module",

@@ -31,2 +31,6 @@ "author": "Turf Authors",

"module": "dist/es/index.js",
"exports": {
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
},
"types": "index.d.ts",

@@ -39,10 +43,9 @@ "sideEffects": false,

"scripts": {
"bench": "npm-run-all prepare bench:run",
"bench:run": "node bench.js",
"bench": "node -r esm bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
"docs": "node ../../scripts/generate-readmes",
"posttest": "node -r esm ../../scripts/validate-es5-dependencies.js",
"prepare": "rollup -c ../../rollup.config.js",
"test": "npm-run-all prepare test:*",
"test": "npm-run-all test:*",
"test:tape": "node -r esm test.js",
"test:types": "tsc --noEmit types.ts"
"test:types": "tsc --esModuleInterop --noEmit types.ts"
},

@@ -58,6 +61,6 @@ "devDependencies": {

"dependencies": {
"@turf/helpers": "^6.2.0-alpha.2",
"@turf/meta": "^6.2.0-alpha.2"
"@turf/helpers": "^6.2.0-alpha.3",
"@turf/meta": "^6.2.0-alpha.3"
},
"gitHead": "23d5cb91d77e0c1e2e903a2252f525797f1d0d09"
"gitHead": "dce9edfc705352e8cb9e0083c9330ba0e8d77409"
}
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