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

@turf/truncate

Package Overview
Dependencies
Maintainers
4
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/truncate - npm Package Compare versions

Comparing version 3.10.0 to 3.10.5

index.es6.js

28

index.js

@@ -1,2 +0,2 @@

var deepSlice = require('deep-slice');
'use strict';

@@ -27,3 +27,3 @@ /**

*/
module.exports = function (layer, precision, coordinates) {
var index_es6 = function (layer, precision, coordinates) {
precision = precision || 6;

@@ -60,1 +60,25 @@ coordinates = coordinates || 2;

}
/**
* Recursive Array.prototype.slice()
* https://github.com/DenisCarriere/deep-slice
*
* @private
* @param {Array} items Array input
* @param {number} start The beginning of the specified portion of the array.
* @param {number} end The end of the specified portion of the array.
* @returns {Array} Returns a section of an array.
* @example
* deepSlice([[10, 20, 30], [40, 50, 60]], 0, 2)
* //=[[10, 20], [40, 50]]
*/
function deepSlice(items, start, end) {
if (typeof items[0] !== 'object') {
return items.slice(start, end);
}
return items.map(function (item) {
return deepSlice(item, start, end);
});
}
module.exports = index_es6;

23

package.json
{
"name": "@turf/truncate",
"version": "3.10.0",
"version": "3.10.5",
"description": "Truncates the geometry precision for all GeoJSON coordinates.",
"main": "index.js",
"jsnext:main": "index.es6.js",
"types": "index.d.ts",
"files": [
"index.js",
"index.es6.js",
"index.d.ts"
],
"scripts": {
"test": "node test.js"
"test": "node test.js",
"pretest": "npm run rollup",
"rollup": "rollup -c rollup.config.js"
},

@@ -14,6 +22,2 @@ "repository": {

},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [

@@ -31,13 +35,10 @@ "turf",

"homepage": "https://github.com/Turfjs/turf",
"dependencies": {},
"devDependencies": {
"benchmark": "^1.0.0",
"eslint": "^3.14.1",
"eslint-config-mourner": "^2.0.1",
"load-json-file": "^2.0.0",
"rollup": "^0.41.4",
"tape": "^3.5.0",
"write-json-file": "^2.0.0"
},
"dependencies": {
"deep-slice": "^1.1.2"
}
}

Sorry, the diff of this file is not supported yet

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