@turf/clone
Advanced tools
Comparing version 4.7.3 to 5.0.0
@@ -1,10 +0,6 @@ | ||
/// <reference types="geojson" /> | ||
import { AllGeoJSON } from '@turf/helpers'; | ||
type Types = GeoJSON.FeatureCollection<any> | GeoJSON.Feature<any> | GeoJSON.GeometryObject | GeoJSON.GeometryCollection; | ||
/** | ||
* http://turfjs.org/docs/#clone | ||
*/ | ||
declare function clone<T extends Types>(geojson: T): T; | ||
declare namespace clone { } | ||
export = clone; | ||
export default function <T extends AllGeoJSON>(geojson: T): T; |
@@ -13,3 +13,3 @@ /** | ||
*/ | ||
module.exports = function (geojson) { | ||
function clone(geojson) { | ||
if (!geojson) throw new Error('geojson is required'); | ||
@@ -33,3 +33,3 @@ | ||
} | ||
}; | ||
} | ||
@@ -147,1 +147,3 @@ /** | ||
} | ||
export default clone; |
{ | ||
"name": "@turf/clone", | ||
"version": "4.7.3", | ||
"version": "5.0.0", | ||
"description": "turf clone module", | ||
"main": "index.js", | ||
"main": "main", | ||
"module": "index", | ||
"jsnext:main": "index", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"index.js", | ||
"index.d.ts" | ||
"index.d.ts", | ||
"main.js" | ||
], | ||
"scripts": { | ||
"test": "node test.js", | ||
"bench": "node bench.js" | ||
"pretest": "rollup -c ../../rollup.config.js", | ||
"test": "node -r @std/esm test.js", | ||
"bench": "node -r @std/esm bench.js" | ||
}, | ||
@@ -33,7 +37,14 @@ "repository": { | ||
"devDependencies": { | ||
"@turf/helpers": "^4.7.3", | ||
"@turf/meta": "^4.7.3", | ||
"benchmark": "2.1.4", | ||
"tape": "4.7.0" | ||
"@turf/helpers": "*", | ||
"@turf/meta": "*", | ||
"benchmark": "*", | ||
"tape": "*", | ||
"rollup": "*", | ||
"@std/esm": "*" | ||
}, | ||
"dependencies": {}, | ||
"@std/esm": { | ||
"esm": "js", | ||
"cjs": true | ||
} | ||
} |
# @turf/clone | ||
# clone | ||
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
## clone | ||
Returns a cloned copy of the passed GeoJSON Object, including possible 'Foreign Members'. | ||
@@ -6,0 +8,0 @@ ~3-5x faster than the common JSON.parse + JSON.stringify combo method. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7285
48
6
142