Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "stac", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Maintain a sorted stack of things.", | ||
@@ -5,0 +5,0 @@ "main": "stac.js", |
@@ -8,2 +8,3 @@ stac | ||
![Puzzle](http://www.stageslearning.com/files/free-resources/blog_images/ring%20stack.jpg) | ||
@@ -10,0 +11,0 @@ - - - |
@@ -111,3 +111,4 @@ | ||
this._sort(); | ||
return this._stack.pop().obj; | ||
var item = this._stack.pop(); | ||
return item ? item.obj : undefined; | ||
}; | ||
@@ -117,3 +118,4 @@ | ||
this._sort(); | ||
return this._stack.shift().obj; | ||
var item = this._stack.shift(); | ||
return item ? item.obj : undefined; | ||
}; | ||
@@ -120,0 +122,0 @@ |
@@ -20,2 +20,4 @@ var Stac = require('../'); | ||
assert.equal(stack.pop(), 'two'); | ||
assert.equal(stack.pop(), undefined); | ||
assert.equal(stack.shift(), undefined); | ||
}); | ||
@@ -22,0 +24,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7390
196
38