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

pedash

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pedash - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

30

index.js

@@ -1,2 +0,2 @@

module.exports.getCharCountsByKey = function(arr) {
export function getCharCountsByKey(arr) {
return arr.reduce((total, currentItem) => {

@@ -6,11 +6,11 @@ total[currentItem] = (total[currentItem] || 0) + 1;

}, {});
};
}
module.exports.randomId = function() {
export function randomId() {
return Math.random()
.toString(36)
.substring(2);
};
}
module.exports.getLongest = function(arr, key) {
export function getLongest(arr, key) {
return arr.reduce((longestItemSoFar, currItem) => {

@@ -27,5 +27,5 @@ const theLongest =

});
};
}
module.exports.getUnique = function(arr) {
export function getUnique(arr) {
return arr.reduce((newArray, currItem) => {

@@ -37,5 +37,5 @@ if (newArray.indexOf(currItem) === -1) {

}, []);
};
}
module.exports.groupByKey = function(arr, key) {
export function groupByKey(arr, key) {
return arr.reduce((r, a) => {

@@ -45,5 +45,5 @@ r[a[key]] = [...(r[a[key]] || []), a];

}, {});
};
}
module.exports.getHighest = function(arr, key) {
export function getHighest(arr, key) {
return arr.reduce((theHighestSoFar, currItem) => {

@@ -58,6 +58,8 @@ const theHighest =

}, {});
};
}
module.exports.shuffle = function(arr) {
export function shuffle(arr) {
if (typeof arr !== "object")
throw new Error("Please input an array as the parameter");
return arr.slice().sort(() => Math.random() - 0.5);
};
}
{
"name": "pedash",
"version": "0.1.0",
"version": "0.1.1",
"description": "A lodash-like javascript helper -- for dummies",

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

@@ -68,3 +68,10 @@ ## Pedash 🌶

```
// Example
import { shuffle } from pedash;
// Then use it whatever you like
const numbers = [56, 89, 21, 20, 7];
console.log(shuffle(numbers));
// [7, 20, 21, 56, 89]
```
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