Socket
Socket
Sign inDemoInstall

fifo

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.1.0

11

index.js

@@ -68,2 +68,13 @@ var Node = function(list, val) {

FIFO.prototype.isEmpty = function() {
return this.length === 0 || this.node === null
}
FIFO.prototype.removeAll = function() {
if (this.length !== 0 && this.node !== null) {
this.length = 0
this.node = null
}
}
FIFO.prototype.toArray = function() {

@@ -70,0 +81,0 @@ var list = []

2

package.json
{
"name": "fifo",
"version": "2.0.0",
"version": "2.1.0",
"repository": "git://github.com/mafintosh/fifo",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -29,2 +29,9 @@ # FIFO

fifo.unshift('hello'); // insert at the beginning
fifo.removeAll(); // Clear stack
if (!fifo.isEmpty()) { // Check if stack is empty
fifo.shift();
}
```

@@ -31,0 +38,0 @@

@@ -6,2 +6,4 @@ var test = require('tape')

var fifo = new FIFO()
t.equal(fifo.isEmpty(), true);
fifo.push('foo')

@@ -30,2 +32,11 @@ t.equal(fifo.length, 1)

fifo.push('foo')
fifo.push('bar')
fifo.push('foo1')
t.equal(fifo.isEmpty(), false)
fifo.removeAll()
t.equal(fifo.length, 0)
t.equal(fifo.first(), null)
t.equal(fifo.last(), null)
t.end()

@@ -32,0 +43,0 @@ })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc