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

@behrad/mystack

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@behrad/mystack - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

limitStack.js

13

index.js

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

function Stack() {
function Stack(limit = 10) {
this.limit = limit
// this.items = Array(limit)
this.items = []

@@ -6,3 +8,8 @@ }

Stack.prototype.push = function(item) {
if (this.isFull()) {
// throw new Error('Stack limit reached')
return -1
}
this.items[this.items.length] = item
return 1
}

@@ -24,2 +31,6 @@

Stack.prototype.isFull = function() {
return this.size() === this.limit
}
module.exports = Stack

2

package.json
{
"name": "@behrad/mystack",
"version": "1.0.0",
"version": "2.0.0",
"description": "My Stack as a first nodejs module demonstration",

@@ -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