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

rjs

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rjs - npm Package Compare versions

Comparing version 2.10.0 to 2.11.0

Cakefile

4

package.json
{
"name": "rjs",
"version": "2.10.0",
"version": "2.11.0",
"description": "A library of Javascript utility functions with an emphasis on Functional Programming.",

@@ -14,3 +14,3 @@ "main": "rjs.js",

"type": "git",
"url": "git://github.com/RaineOrShine/rjs.git"
"url": "git://github.com/metaraine/rjs.git"
},

@@ -17,0 +17,0 @@ "keywords": [

/**
* Raine's Javascript Extensions
* v2.9.0
* v2.11.0
* A library of Javascript utility functions with an emphasis on Functional Programming.

@@ -461,2 +461,39 @@ */

/** Returns a new array with the array's items in random order. */
var randomize = function(arr) {
var output = arr.slice();
function swap(i,j) {
var temp = output[i];
output[i] = output[j];
output[j] = temp;
}
for(var i=0, len=output.length; i<len; i++) {
var r = Math.floor(Math.random() * len);
swap(i, r);
}
return output;
}
/** Breaks up the array into n evenly-sized chunks. */
var chunk = function(arr, n) {
var output = [];
var len = arr.length;
var bigSize = Math.ceil(len/n);
var smallSize = bigSize - 1;
var rem = len % n;
var size = bigSize;
for(var i=0; i<len; i+=size) {
if(rem > 0 && i >= rem * bigSize) {
size = smallSize;
}
output.push(arr.slice(i, i+size));
}
return output;
}
/***********************************

@@ -775,3 +812,3 @@ * Object

install(Number, rjs, ['ordinal', { mapNumber: 'map' }]);
install(Array, rjs, ['map', 'each', 'pluck', 'group', 'orderedGroup', 'tally', 'contains', 'strictContains', 'unique', 'reversed', 'index', 'rotate', 'toObject', 'find', 'findByProperty', 'filterBy', 'any', 'all', 'spliced' ]);
install(Array, rjs, ['map', 'each', 'pluck', 'group', 'orderedGroup', 'tally', 'contains', 'strictContains', 'unique', 'reversed', 'index', 'rotate', 'toObject', 'find', 'findByProperty', 'filterBy', 'any', 'all', 'spliced', 'randomize', 'chunk' ]);
install(Function, rjs, ['curryAt', 'curry', 'rcurry', 'arritize', 'currify', 'toInstance', 'new']);

@@ -837,2 +874,4 @@ return rjs;

filterBy : filterBy,
randomize : randomize,
chunk : chunk,

@@ -839,0 +878,0 @@ // object

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