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

stac

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stac - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

2

package.json
{
"name": "stac",
"version": "0.0.0",
"version": "0.0.1",
"description": "Maintain a sorted stack of things.",

@@ -5,0 +5,0 @@ "main": "stac.js",

@@ -7,2 +7,3 @@

this._options = options;
this._sorted = false;

@@ -17,2 +18,6 @@ this._stack = [];

};
this.__defineGetter__('length', function () {
return self._stack.length;
});
}

@@ -116,6 +121,8 @@

Stac.prototype.length = function () {
return this._stack.length;
Stac.prototype.clone = function () {
var clone = new Stac(this._options);
clone._stack = this._stack.slice(0);
return clone;
};
module.exports = Stac;

@@ -37,6 +37,6 @@ var Stac = require('../');

stack.remove('two');
assert.equal(stack.length(), 2);
assert.equal(stack.length, 2);
stack.remove('foo');
assert.equal(stack.length(), 2);
assert.equal(stack.length, 2);
});

@@ -60,2 +60,18 @@

it('clone() - can clone the stack', function () {
var clone;
stack.add('one');
stack.add('two');
stack.add('three');
clone = stack.clone();
stack.remove('two');
clone.add('four');
assert.equal(stack.length, 2);
assert.equal(clone.length, 4);
});
it('can deal with objects in the stack', function () {

@@ -76,3 +92,3 @@ var brian = {

assert.equal(stack.length(), 1);
assert.equal(stack.length, 1);
assert.equal(stack.pop(), carlos);

@@ -79,0 +95,0 @@ });

Sorry, the diff of this file is not supported yet

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