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.0.7 to 0.0.8

27

index.js

@@ -14,8 +14,13 @@ module.exports.getCharCountsByKey = function(arr) {

module.exports.getLongest = function(arr) {
module.exports.getLongest = function(arr, key) {
return arr.reduce((longestItemSoFar, currItem) => {
if (currItem.length > longestItemSoFar.length) {
return currItem;
}
return longestItemSoFar;
const theLongest =
typeof longestItemSoFar === "object"
? longestItemSoFar[key]
: longestItemSoFar;
const currentItem =
typeof currItem === "object" ? currItem[key] : currItem;
return theLongest.length > currentItem.length
? theLongest
: currentItem;
});

@@ -39,1 +44,13 @@ };

};
module.exports.getHighest = function(arr, key) {
return arr.reduce((theHighestSoFar, currItem) => {
const theHighest =
typeof theHighestSoFar === "object"
? theHighestSoFar[key]
: theHighestSoFar;
const currentItem =
typeof currItem === "object" ? currItem[key] : currItem;
return (theHighest || 0) > currentItem ? theHighest : currentItem;
}, {});
};

7

package.json
{
"name": "pedash",
"version": "0.0.7",
"version": "0.0.8",
"description": "A lodash-like javascript helper -- for dummies",

@@ -12,3 +12,6 @@ "main": "index.js",

"lodash",
"helper"
"helper",
"utils",
"utilities",
"javascript"
],

@@ -15,0 +18,0 @@ "author": "Bejo Karmila",

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