escape-stack
Advanced tools
Comparing version
{ | ||
"name": "escape-stack", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "A sweet way of handling things that close (or do other things) on escape", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -9,6 +9,6 @@ var globalStack; | ||
var key = e.keyCode ? e.keyCode : e.which; | ||
var key = e.keyCode || e.which; | ||
// yup i hard coded 27 sorry suckas | ||
if (key === 27) { | ||
while (!!stack.length && !(stack.pop())(e)) {} | ||
pop(e); | ||
} | ||
@@ -30,4 +30,10 @@ }, true); | ||
} | ||
function pop(e) { | ||
while (stack.length > 0 && !(stack.pop())(e)) {} | ||
} | ||
return { | ||
add: addEscapeHandler | ||
add: addEscapeHandler, | ||
pop: pop | ||
}; | ||
@@ -34,0 +40,0 @@ } |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
42573
0.13%86
4.88%1
Infinity%