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

@vect/object-select

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vect/object-select - npm Package Compare versions

Comparing version 0.1.15 to 0.1.16

23

dist/index.cjs.js

@@ -7,2 +7,3 @@ 'use strict';

var comparer = require('@aryth/comparer');
var swap = require('@vect/swap');
var vectorMapper = require('@vect/vector-mapper');

@@ -32,3 +33,24 @@

*
* Object keys can be set via 'this.keys'
* Default keys are Object.keys(o), the enumerable list of o's keys.
* @param {Object} o
* @param {number} [size] - if omitted, size will be keys.length
* @returns {Object} new object
*/
const shuffle = function (o, size) {
const keys = (this === null || this === void 0 ? void 0 : this.keys) || Object.keys(o);
let l = keys.length,
k;
const lo = comparer.max(0, l - (size !== null && size !== void 0 ? size : l)),
rs = {};
while (--l >= lo) rs[k = swap.swap.call(keys, rand.rand(l), l)] = o[k];
return rs;
};
/**
*
* @param {Object} o
* @param {*[]} keys

@@ -89,1 +111,2 @@ */

exports.selectValues = selectValues;
exports.shuffle = shuffle;

24

dist/index.esm.js
import { rand } from '@aryth/rand';
import { max, min } from '@aryth/comparer';
import { swap } from '@vect/swap';
import { iterate } from '@vect/vector-mapper';

@@ -27,3 +28,24 @@

*
* Object keys can be set via 'this.keys'
* Default keys are Object.keys(o), the enumerable list of o's keys.
* @param {Object} o
* @param {number} [size] - if omitted, size will be keys.length
* @returns {Object} new object
*/
const shuffle = function (o, size) {
const keys = (this === null || this === void 0 ? void 0 : this.keys) || Object.keys(o);
let l = keys.length,
k;
const lo = max(0, l - (size !== null && size !== void 0 ? size : l)),
rs = {};
while (--l >= lo) rs[k = swap.call(keys, rand(l), l)] = o[k];
return rs;
};
/**
*
* @param {Object} o
* @param {*[]} keys

@@ -80,2 +102,2 @@ */

export { leap, lookupKeys, select, selectValues };
export { leap, lookupKeys, select, selectValues, shuffle };

6

package.json
{
"name": "@vect/object-select",
"version": "0.1.15",
"version": "0.1.16",
"description": "Select from object/array",

@@ -21,3 +21,3 @@ "main": "dist/index.cjs.js",

"@vect/swap": "^0.1.15",
"@vect/vector-mapper": "^0.1.15"
"@vect/vector-mapper": "^0.1.16"
},

@@ -39,3 +39,3 @@ "repository": {

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