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

keyboard-layout

Package Overview
Dependencies
Maintainers
6
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keyboard-layout - npm Package Compare versions

Comparing version 1.3.1 to 2.0.0

21

lib/keyboard-layout.js

@@ -7,11 +7,5 @@ 'use strict'

const emitter = new Emitter()
const keymapsByLayoutName = new Map()
let currentKeymap = null
let currentKeyboardLayout = null
let currentKeyboardLanguage = null
const manager = new KeyboardLayoutManager(() => {
currentKeymap = null
currentKeyboardLayout = null
currentKeyboardLanguage = null
emitter.emit('did-change-current-keyboard-layout', getCurrentKeyboardLayout())

@@ -21,4 +15,7 @@ })

function getCurrentKeymap () {
const currentLayout = getCurrentKeyboardLayout()
let currentKeymap = keymapsByLayoutName.get(currentLayout)
if (!currentKeymap) {
currentKeymap = manager.getCurrentKeymap()
keymapsByLayoutName.set(currentLayout, currentKeymap)
}

@@ -29,13 +26,7 @@ return currentKeymap

function getCurrentKeyboardLayout () {
if (!currentKeyboardLayout) {
currentKeyboardLayout = manager.getCurrentKeyboardLayout()
}
return currentKeyboardLayout
return manager.getCurrentKeyboardLayout()
}
function getCurrentKeyboardLanguage () {
if (!currentKeyboardLanguage) {
currentKeyboardLanguage = manager.getCurrentKeyboardLanguage()
}
return currentKeyboardLanguage
return manager.getCurrentKeyboardLanguage()
}

@@ -42,0 +33,0 @@

{
"name": "keyboard-layout",
"version": "1.3.1",
"version": "2.0.0",
"description": "Read and observe the current keyboard layout on OS X.",

@@ -5,0 +5,0 @@ "main": "./lib/keyboard-layout",

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