New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@turf/sample

Package Overview
Dependencies
Maintainers
4
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/sample - npm Package Compare versions

Comparing version 5.0.4 to 5.1.0

main.mjs

6

main.js

@@ -26,5 +26,5 @@ 'use strict';

function sample(featurecollection, num) {
if (!featurecollection) throw new Error('featurecollection is required');
if (num === null || num === undefined) throw new Error('num is required');
if (typeof num !== 'number') throw new Error('num must be a number');
if (!featurecollection) { throw new Error('featurecollection is required'); }
if (num === null || num === undefined) { throw new Error('num is required'); }
if (typeof num !== 'number') { throw new Error('num must be a number'); }

@@ -31,0 +31,0 @@ var outFC = helpers.featureCollection(getRandomSubarray(featurecollection.features, num));

{
"name": "@turf/sample",
"version": "5.0.4",
"version": "5.1.0",
"description": "turf sample module",
"main": "main",
"module": "index",
"jsnext:main": "index",
"main": "main.js",
"module": "main.mjs",
"types": "index.d.ts",

@@ -12,3 +11,4 @@ "files": [

"index.d.ts",
"main.js"
"main.js",
"main.mjs"
],

@@ -18,3 +18,4 @@ "scripts": {

"test": "node -r @std/esm test.js",
"bench": "node -r @std/esm bench.js"
"bench": "node -r @std/esm bench.js",
"docs": "node ../../scripts/generate-readmes"
},

@@ -41,6 +42,7 @@ "repository": {

"rollup": "*",
"rollup-plugin-buble": "*",
"tape": "*"
},
"dependencies": {
"@turf/helpers": "^5.0.4"
"@turf/helpers": "^5.1.0"
},

@@ -47,0 +49,0 @@ "@std/esm": {

@@ -7,7 +7,7 @@ # @turf/sample

Takes a [FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) and returns a FeatureCollection with given number of [features](http://geojson.org/geojson-spec.html#feature-objects) at random.
Takes a [FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3) and returns a FeatureCollection with given number of [features](https://tools.ietf.org/html/rfc7946#section-3.2) at random.
**Parameters**
- `featurecollection` **[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)** set of input features
- `featurecollection` **[FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3)** set of input features
- `num` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** number of features to select

@@ -30,3 +30,3 @@

Returns **[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)** a FeatureCollection with `n` features
Returns **[FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3)** a FeatureCollection with `n` features

@@ -33,0 +33,0 @@ <!-- This file is automatically generated. Please don't edit it directly:

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