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

just-last

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-last - npm Package Compare versions

Comparing version 1.1.23 to 2.0.0

7

index.js

@@ -7,6 +7,11 @@ module.exports = last;

last([true, false, [true, false]]); // [true, false]
last({}); // throws
last(); // throws
*/
function last(arr) {
return arr != null ? arr[arr.length - 1] : undefined;
if (!Array.isArray(arr)) {
throw new Error('expected an array');
}
return arr[arr.length - 1];
}

9

package.json
{
"name": "just-last",
"version": "1.1.23",
"version": "2.0.0",
"description": "return the last member of an array",

@@ -10,8 +10,3 @@ "main": "index.js",

"repository": "https://github.com/angus-c/just",
"keywords": [
"array",
"last",
"no-dependencies",
"just"
],
"keywords": ["array", "last", "no-dependencies", "just"],
"author": "Angus Croll",

@@ -18,0 +13,0 @@ "license": "MIT",

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