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

@fastkit/keybord

Package Overview
Dependencies
Maintainers
1
Versions
168
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastkit/keybord - npm Package Compare versions

Comparing version 0.6.10 to 0.6.11

37

dist/keybord.cjs.js

@@ -5,2 +5,4 @@ 'use strict';

var helpers = require('@fastkit/helpers');
function Special(key) {

@@ -54,3 +56,36 @@ return key;

function createSetting(rawKBSettings) {
const _settings = Array.isArray(rawKBSettings)
? rawKBSettings
: [rawKBSettings];
const computedSettings = [];
if (!helpers.IN_WINDOW)
return computedSettings;
_settings.forEach((_setting) => {
const { target = document, event = 'keydown', capture = false } = _setting;
const setting = {
..._setting,
target,
event,
capture,
};
let bucket = computedSettings.find((b) => b.target === target && b.event === event && b.capture === capture);
if (!bucket) {
bucket = {
target,
event,
capture,
settings: [],
handler: (ev) => {
bucket &&
bucket.settings.forEach(({ key, handler }) => {
if (!key || Key.is(ev.key, key)) {
handler(ev);
}
});
},
};
computedSettings.push(bucket);
}
bucket.settings.push(setting);
});
return computedSettings;

@@ -65,3 +100,3 @@ }

constructor(settings) {
this.settings = createSetting();
this.settings = createSetting(settings);
}

@@ -68,0 +103,0 @@ run() {

@@ -5,2 +5,4 @@ 'use strict';

var helpers = require('@fastkit/helpers');
function Special(key) {

@@ -54,3 +56,36 @@ return key;

function createSetting(rawKBSettings) {
const _settings = Array.isArray(rawKBSettings)
? rawKBSettings
: [rawKBSettings];
const computedSettings = [];
if (!helpers.IN_WINDOW)
return computedSettings;
_settings.forEach((_setting) => {
const { target = document, event = 'keydown', capture = false } = _setting;
const setting = {
..._setting,
target,
event,
capture,
};
let bucket = computedSettings.find((b) => b.target === target && b.event === event && b.capture === capture);
if (!bucket) {
bucket = {
target,
event,
capture,
settings: [],
handler: (ev) => {
bucket &&
bucket.settings.forEach(({ key, handler }) => {
if (!key || Key.is(ev.key, key)) {
handler(ev);
}
});
},
};
computedSettings.push(bucket);
}
bucket.settings.push(setting);
});
return computedSettings;

@@ -65,3 +100,3 @@ }

constructor(settings) {
this.settings = createSetting();
this.settings = createSetting(settings);
}

@@ -68,0 +103,0 @@ run() {

4

dist/keybord.esm-bundler.js

@@ -0,1 +1,3 @@

import { IN_WINDOW } from '@fastkit/helpers';
function Special(key) {

@@ -53,3 +55,3 @@ return key;

const computedSettings = [];
if (!(typeof document !== 'undefined'))
if (!IN_WINDOW)
return computedSettings;

@@ -56,0 +58,0 @@ _settings.forEach((_setting) => {

{
"name": "@fastkit/keybord",
"version": "0.6.10",
"version": "0.6.11",
"description": "@fastkit/keybord",

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

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