New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

combokeys-context

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

combokeys-context - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

.editorconfig

2

package.json
{
"name": "combokeys-context",
"version": "1.0.0",
"version": "1.0.1",
"author": "Tim Oram <mitmaro@gmail.com>",

@@ -5,0 +5,0 @@ "contributors": [],

# ComboKeys Context
[![Dependency Status](https://david-dm.org/MitMaro/combokeys-context.svg)](https://david-dm.org/MitMaro/combokeys-context)
[![Build Status](https://travis-ci.org/MitMaro/combokeys-context.svg)](https://travis-ci.org/MitMaro/combokeys-context)
[![Build Status](https://travis-ci.org/MitMaro/combokeys-context.svg?branch=master)](https://travis-ci.org/MitMaro/combokeys-context)
[![Coverage Status](https://coveralls.io/repos/MitMaro/combokeys-context/badge.svg?branch=master)](https://coveralls.io/r/MitMaro/combokeys-context?branch=master)

@@ -15,2 +15,6 @@

## Install
npm install combokeys-context
## Documentation

@@ -20,3 +24,3 @@

```
```javascript
var ComboKeys = require('combokeys');

@@ -68,4 +72,4 @@ var ComboKeysContext = require('combokeys-context');

##License
## License
Combokeys Context is released under the MIT license. See LICENSE.
var isArray = require('./util/isArray');
function wrapHandler(key, evt, combo) {
if (this._context) {
if (this._context && this._bindings[key].contexts[this._context]) {
this._bindings[key].contexts[this._context].call(this._comboKeys, evt, combo);
} else {
} else if (this._bindings[key].global) {
this._bindings[key].global.call(this._comboKeys, evt, combo);

@@ -8,0 +8,0 @@ }

@@ -436,3 +436,24 @@

});
it('calls function in global scope without global scope registered', function() {
var contextCallback = sinon.stub();
var evt = 'my event';
var key = 'a';
context._register(key, 'A', contextCallback);
context._bindings[key].handler(evt, key);
expect(contextCallback).to.not.be.called;
});
it('calls function in scope without scope registered', function() {
var globalCallback = sinon.stub();
var evt = 'my event';
var key = 'a';
context._register(key, null, globalCallback);
context._context = 'A';
context._bindings[key].handler(evt, key);
expect(globalCallback).to.be.calledWith(evt, key);
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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