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.0 to 1.3.1

21

lib/keyboard-layout.js

@@ -7,5 +7,11 @@ '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())

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

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

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

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

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

{
"name": "keyboard-layout",
"version": "1.3.0",
"version": "1.3.1",
"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