Socket
Socket
Sign inDemoInstall

abstract-scheduler

Package Overview
Dependencies
95
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 3.0.0

14

index.js

@@ -22,9 +22,13 @@ 'use strict'

const scheduler = createScheduler([])
t.plan(3)
t.plan(5)
t.equal(typeof scheduler.add, 'function', 'scheduler.add should be a function')
t.equal(scheduler.add.length, 1, 'scheduler.add.length should be 1')
let res1, res2
t.doesNotThrow(() => {
scheduler.add('foo')
res1 = scheduler.add('foo')
res2 = scheduler.add('bar')
}, `scheduler.add('foo') should work`)
t.equal(res1, 0, 'the 1st scheduler.add() should have returned 0')
t.equal(res2, 1, 'the 2nd scheduler.add() should have returned 1')
})

@@ -42,7 +46,7 @@

t.doesNotThrow(() => {
res1 = scheduler.remove('foo')
}, `scheduler.remove('foo') should work`)
res1 = scheduler.remove(0)
}, `scheduler.remove(0) should work`)
t.equal(res1, true, 'scheduler.remove should return true for a known item')
const res2 = scheduler.remove('bar')
const res2 = scheduler.remove(1)
t.equal(res2, false, 'scheduler.remove should return false for an unknown item')

@@ -49,0 +53,0 @@ })

{
"name": "abstract-scheduler",
"description": "An interface and test suite to implement various scheduling algorithms.",
"version": "2.0.0",
"version": "3.0.0",
"main": "index.js",

@@ -6,0 +6,0 @@ "files": [

@@ -62,7 +62,7 @@ # abstract-scheduler

Add a value to the scheduler.
Add a value to the scheduler. Returns the (`0`-based) index of the stored value.
### `scheduler.remove(value)`
### `scheduler.remove(i)`
Remove a value from the scheduler. Returns `true` if the value was in the scheduler and `false` if it wasn't.
Remove a value by (`0`-based) index. Returns `true` if the scheduler contained value, `false` otherwise.

@@ -69,0 +69,0 @@ ### `scheduler.has(value)`

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