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

@vect/vector-select

Package Overview
Dependencies
Maintainers
1
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vect/vector-select - npm Package Compare versions

Comparing version 0.1.10 to 0.1.12

19

dist/index.cjs.js

@@ -5,2 +5,4 @@ 'use strict';

var vectorUpdate = require('@vect/vector-update');
const select = (vec, indexes, hi) => {

@@ -15,2 +17,19 @@ hi = hi || indexes.length;

/**
* Divide input array by an array of indexes,
* The indexes should be integer array sorted by ascending.
* Return selected array and rest array.
* 'Pick' array is new array, and the 'rest' points to the input array.
* @param {*[]} vec
* @param {number[]} indexes - integer array sorted ascending
* @param {number} [hi] - length of indexes
* @returns {{pick: *[], rest: *[]}} - rest points to altered original array, pick is an new array.
*/
const divide = (vec, indexes, hi) => (hi = hi || indexes.length, {
pick: vectorUpdate.partition(vec, indexes, hi).splice(indexes[0], hi),
rest: vec
});
exports.divide = divide;
exports.select = select;

20

dist/index.esm.js

@@ -0,1 +1,3 @@

import { partition } from '@vect/vector-update';
const select = (vec, indexes, hi) => {

@@ -10,2 +12,18 @@ hi = hi || indexes.length;

export { select };
/**
* Divide input array by an array of indexes,
* The indexes should be integer array sorted by ascending.
* Return selected array and rest array.
* 'Pick' array is new array, and the 'rest' points to the input array.
* @param {*[]} vec
* @param {number[]} indexes - integer array sorted ascending
* @param {number} [hi] - length of indexes
* @returns {{pick: *[], rest: *[]}} - rest points to altered original array, pick is an new array.
*/
const divide = (vec, indexes, hi) => (hi = hi || indexes.length, {
pick: partition(vec, indexes, hi).splice(indexes[0], hi),
rest: vec
});
export { divide, select };

8

package.json
{
"name": "@vect/vector-select",
"version": "0.1.10",
"version": "0.1.12",
"description": "A math util library",

@@ -17,2 +17,5 @@ "main": "dist/index.cjs.js",

},
"dependencies": {
"@vect/vector-update": "^0.1.12"
},
"repository": {

@@ -32,3 +35,4 @@ "type": "git",

},
"homepage": "https://github.com/hoyeungw/vect#readme"
"homepage": "https://github.com/hoyeungw/vect#readme",
"gitHead": "e91bc62c84e8e587d8e10d3b4a0fdba87ad69aeb"
}
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