| root = true | ||
| [*] | ||
| indent_style = space | ||
| indent_size = 2 | ||
| end_of_line = lf | ||
| charset = utf-8 | ||
| trim_trailing_whitespace = true | ||
| insert_final_newline = true | ||
| [*.md] | ||
| trim_trailing_whitespace = false |
+1
-1
| { | ||
| "name": "keycodes", | ||
| "description": "Key codes and names", | ||
| "version": "0.1.1", | ||
| "version": "0.2.0", | ||
| "keywords": [ | ||
@@ -6,0 +6,0 @@ "key", |
+7
-35
@@ -1,8 +0,3 @@ | ||
| 'use strict'; | ||
| /** | ||
| * Keys | ||
| */ | ||
| var keys = { | ||
@@ -14,2 +9,4 @@ ctrl: 17, | ||
| shift: 16, | ||
| windows: 91, | ||
| command: 91, | ||
| esc: 27, | ||
@@ -34,2 +31,3 @@ escape: 27, | ||
| pause: 19, | ||
| 'break': 19, | ||
| insert: 45, | ||
@@ -44,9 +42,8 @@ 'delete': 46, | ||
| right: 39, | ||
| down: 40 | ||
| down: 40, | ||
| capslock: 20, | ||
| numlock: 144, | ||
| scrolllock: 145 | ||
| }; | ||
| /** | ||
| * Functions | ||
| */ | ||
| for (var f = 1; f < 20; f++) { | ||
@@ -56,11 +53,2 @@ keys['f' + f] = 111 + f; | ||
| /** | ||
| * Expose keycodes | ||
| * | ||
| * @param {String|Number} input | ||
| * @return {Number|String} | ||
| * @api public | ||
| */ | ||
| module.exports = function(input) { | ||
@@ -71,10 +59,2 @@ if (typeof input === 'string') return code(input); | ||
| /** | ||
| * Get code | ||
| * | ||
| * @param {String} input | ||
| * @return {Number} | ||
| * @api private | ||
| */ | ||
| function code(input) { | ||
@@ -84,10 +64,2 @@ return keys[input.toLowerCase()] || input.toUpperCase().charCodeAt(0); | ||
| /** | ||
| * Get key | ||
| * | ||
| * @param {Number} input | ||
| * @return {String} | ||
| * @api private | ||
| */ | ||
| function key(input) { | ||
@@ -94,0 +66,0 @@ for (var k in keys) { |
+1
-1
| { | ||
| "name": "keycodes", | ||
| "description": "Key codes and names", | ||
| "version": "0.1.1", | ||
| "version": "0.2.0", | ||
| "keywords": [ | ||
@@ -6,0 +6,0 @@ "key", |
+8
-1
@@ -1,5 +0,7 @@ | ||
| # keycodes [](https://travis-ci.org/andrepolischuk/keycodes) | ||
| # keycodes [![Build Status][travis-image]][travis-url] | ||
| > Key codes and names | ||
| [keycodes-cli][keycodes-cli] - CLI for this module | ||
| ## Install | ||
@@ -37,1 +39,6 @@ | ||
| MIT | ||
| [travis-url]: https://travis-ci.org/andrepolischuk/keycodes | ||
| [travis-image]: https://travis-ci.org/andrepolischuk/keycodes.svg?branch=master | ||
| [keycodes-cli]: https://github.com/andrepolischuk/keycodes-cli |
+10
-2
@@ -1,4 +0,2 @@ | ||
| 'use strict'; | ||
| var keycode = require('./'); | ||
@@ -14,2 +12,4 @@ var assert = require('assert'); | ||
| assert(keycode('shift') === 16); | ||
| assert(keycode('windows') === 91); | ||
| assert(keycode('command') === 91); | ||
| assert(keycode('esc') === 27); | ||
@@ -34,2 +34,3 @@ assert(keycode('escape') === 27); | ||
| assert(keycode('pause') === 19); | ||
| assert(keycode('break') === 19); | ||
| assert(keycode('insert') === 45); | ||
@@ -45,2 +46,5 @@ assert(keycode('delete') === 46); | ||
| assert(keycode('down') === 40); | ||
| assert(keycode('capslock') === 20); | ||
| assert(keycode('numlock') === 144); | ||
| assert(keycode('scrolllock') === 145); | ||
| assert(keycode('f1') === 112); | ||
@@ -102,2 +106,3 @@ assert(keycode('f2') === 113); | ||
| assert(keycode(16) === 'shift'); | ||
| assert(keycode(91) === 'windows'); | ||
| assert(keycode(27) === 'esc'); | ||
@@ -130,2 +135,5 @@ assert(keycode(192) === '`'); | ||
| assert(keycode(40) === 'down'); | ||
| assert(keycode(20) === 'capslock'); | ||
| assert(keycode(144) === 'numlock'); | ||
| assert(keycode(145) === 'scrolllock'); | ||
| assert(keycode(112) === 'f1'); | ||
@@ -132,0 +140,0 @@ assert(keycode(113) === 'f2'); |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
8803
6.48%8
14.29%44
18.92%0
-100%258
-4.09%