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

utility

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

utility - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

5

History.md
0.0.8 / 2013-05-06
==================
* add randomSlice() fixed #1
0.0.7 / 2013-04-17

@@ -3,0 +8,0 @@ ==================

@@ -110,2 +110,23 @@ /*!

/**
* Array random slice with items count.
* @param {Array} arr
* @param {Number} num, number of sub items.
* @return {Array}
*/
exports.randomSlice = function (arr, num) {
if (!num || num >= arr.length) {
return arr.slice();
}
var index = Math.floor(Math.random() * arr.length);
var a = [];
for (var i = 0, j = index; i < num; i++) {
a.push(arr[j++]);
if (j === arr.length) {
j = 0;
}
}
return a;
};
var MONTHS = [

@@ -112,0 +133,0 @@ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'

2

package.json
{
"name": "utility",
"version": "0.0.7",
"version": "0.0.8",
"description": "A collection of useful utilities.",

@@ -5,0 +5,0 @@ "main": "index.js",

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