From 96ed20ca438d5edb43ffc7d4adb6260737c24375 Mon Sep 17 00:00:00 2001 From: Ashish Shubham Date: Fri, 25 Oct 2019 09:43:59 +0530 Subject: [PATCH] [1.0.0] Fixed typos and publish es6 module --- dist/es5/index.js | 150 +++++++++++++++++++++++++++++ dist/es5/index.js.map | 1 + dist/{declarations => }/index.d.ts | 5 +- dist/index.js | 10 +- dist/index.js.map | 1 + index.ts | 3 +- package-lock.json | 8 +- package.json | 13 ++- tsconfig.json | 9 +- 9 files changed, 179 insertions(+), 21 deletions(-) create mode 100644 dist/es5/index.js create mode 100644 dist/es5/index.js.map rename dist/{declarations => }/index.d.ts (97%) create mode 100644 dist/index.js.map diff --git a/dist/es5/index.js b/dist/es5/index.js new file mode 100644 index 0000000..55396d5 --- /dev/null +++ b/dist/es5/index.js @@ -0,0 +1,150 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Key; +(function (Key) { + Key["Backspace"] = "Backspace"; + Key["Tab"] = "Tab"; + Key["Enter"] = "Enter"; + Key["Shift"] = "Shift"; + Key["Control"] = "Control"; + Key["Alt"] = "Alt"; + Key["CapsLock"] = "CapsLock"; + Key["Escape"] = "Escape"; + Key["Space"] = " "; + Key["PageUp"] = "PageUp"; + Key["PageDown"] = "PageDown"; + Key["End"] = "End"; + Key["Home"] = "Home"; + Key["ArrowLeft"] = "ArrowLeft"; + Key["ArrowUp"] = "ArrowUp"; + Key["ArrowRight"] = "ArrowRight"; + Key["ArrowDown"] = "ArrowDown"; + Key["Left"] = "Left"; + Key["Up"] = "Up"; + Key["Right"] = "Right"; + Key["Down"] = "Down"; + Key["Insert"] = "Insert"; + Key["Delete"] = "Delete"; + Key["Zero"] = "0"; + Key["ClosedParen"] = ")"; + Key["One"] = "1"; + Key["ExclamationMark"] = "!"; + Key["Two"] = "2"; + Key["AtSign"] = "@"; + Key["Three"] = "3"; + Key["PoundSign"] = "#"; + Key["Hash"] = "#"; + Key["Four"] = "4"; + Key["DollarSign"] = "$"; + Key["Five"] = "5"; + Key["PercentSign"] = "%"; + Key["Six"] = "6"; + Key["Caret"] = "^"; + Key["Hat"] = "^"; + Key["Seven"] = "7"; + Key["Ampersand"] = "&"; + Key["Eight"] = "8"; + Key["Star"] = "*"; + Key["Asterisk"] = "*"; + Key["Nine"] = "9"; + Key["OpenParen"] = "("; + Key["a"] = "a"; + Key["b"] = "b"; + Key["c"] = "c"; + Key["d"] = "d"; + Key["e"] = "e"; + Key["f"] = "f"; + Key["g"] = "g"; + Key["h"] = "h"; + Key["i"] = "i"; + Key["j"] = "j"; + Key["k"] = "k"; + Key["l"] = "l"; + Key["m"] = "m"; + Key["n"] = "n"; + Key["o"] = "o"; + Key["p"] = "p"; + Key["q"] = "q"; + Key["r"] = "r"; + Key["s"] = "s"; + Key["t"] = "t"; + Key["u"] = "u"; + Key["v"] = "v"; + Key["w"] = "w"; + Key["x"] = "x"; + Key["y"] = "y"; + Key["z"] = "z"; + Key["A"] = "A"; + Key["B"] = "B"; + Key["C"] = "C"; + Key["D"] = "D"; + Key["E"] = "E"; + Key["F"] = "F"; + Key["G"] = "G"; + Key["H"] = "H"; + Key["I"] = "I"; + Key["J"] = "J"; + Key["K"] = "K"; + Key["L"] = "L"; + Key["M"] = "M"; + Key["N"] = "N"; + Key["O"] = "O"; + Key["P"] = "P"; + Key["Q"] = "Q"; + Key["R"] = "R"; + Key["S"] = "S"; + Key["T"] = "T"; + Key["U"] = "U"; + Key["V"] = "V"; + Key["W"] = "W"; + Key["X"] = "X"; + Key["Y"] = "Y"; + Key["Z"] = "Z"; + Key["Meta"] = "Meta"; + Key["LeftWindowKey"] = "Meta"; + Key["RightWindowKey"] = "Meta"; + Key["Numpad0"] = "0"; + Key["Numpad1"] = "1"; + Key["Numpad2"] = "2"; + Key["Numpad3"] = "3"; + Key["Numpad4"] = "4"; + Key["Numpad5"] = "5"; + Key["Numpad6"] = "6"; + Key["Numpad7"] = "7"; + Key["Numpad8"] = "8"; + Key["Numpad9"] = "9"; + Key["Multiply"] = "*"; + Key["Add"] = "+"; + Key["Subtract"] = "-"; + Key["DecimalPoint"] = "."; + Key["MSDecimalPoint"] = "Decimal"; + Key["Divide"] = "/"; + Key["F1"] = "F1"; + Key["F2"] = "F2"; + Key["F3"] = "F3"; + Key["F4"] = "F4"; + Key["F5"] = "F5"; + Key["F6"] = "F6"; + Key["F7"] = "F7"; + Key["F8"] = "F8"; + Key["F9"] = "F9"; + Key["F10"] = "F10"; + Key["F11"] = "F11"; + Key["F12"] = "F12"; + Key["NumLock"] = "NumLock"; + Key["ScrollLock"] = "ScrollLock"; + Key["SemiColon"] = ";"; + Key["Equals"] = "="; + Key["Comma"] = ","; + Key["Dash"] = "-"; + Key["Period"] = "."; + Key["UnderScore"] = "_"; + Key["PlusSign"] = "+"; + Key["ForwardSlash"] = "/"; + Key["Tilde"] = "~"; + Key["GraveAccent"] = "`"; + Key["OpenBracket"] = "["; + Key["ClosedBracket"] = "]"; + Key["Quote"] = "'"; +})(Key = exports.Key || (exports.Key = {})); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/es5/index.js.map b/dist/es5/index.js.map new file mode 100644 index 0000000..0c5645f --- /dev/null +++ b/dist/es5/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;AACA,IAAY,GAiJX;AAjJD,WAAY,GAAG;IACX,8BAAuB,CAAA;IACvB,kBAAW,CAAA;IACX,sBAAe,CAAA;IACf,sBAAe,CAAA;IACf,0BAAmB,CAAA;IACnB,kBAAW,CAAA;IACX,4BAAqB,CAAA;IACrB,wBAAiB,CAAA;IACjB,kBAAW,CAAA;IACX,wBAAiB,CAAA;IACjB,4BAAqB,CAAA;IACrB,kBAAW,CAAA;IACX,oBAAa,CAAA;IACb,8BAAuB,CAAA;IACvB,0BAAmB,CAAA;IACnB,gCAAyB,CAAA;IACzB,8BAAuB,CAAA;IACvB,oBAAa,CAAA;IACb,gBAAS,CAAA;IACT,sBAAe,C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ACP,cAAO,CAAA;IACP,cAAO,CAAA;IACP,cAAO,CAAA;IACP,cAAO,CAAA;IACP,cAAO,CAAA;IACP,cAAO,CAAA;IACP,cAAO,CAAA;IACP,cAAO,CAAA;IACP,oBAAa,CAAA;IACb,6BAAsB,CAAA;IACtB,8BAAuB,CAAA;IACvB,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,oBAAa,CAAA;IACb,qBAAc,CAAA;IACd,gBAAS,CAAA;IACT,qBAAc,CAAA;IACd,yBAAkB,CAAA;IAClB,iCAA0B,CAAA;IAC1B,mBAAY,CAAA;IACZ,gBAAS,CAAA;IACT,gBAAS,CAAA;IACT,gBAAS,CAAA;IACT,gBAAS,CAAA;IACT,gBAAS,CAAA;IACT,gBAAS,CAAA;IACT,gBAAS,CAAA;IACT,gBAAS,CAAA;IACT,gBAAS,CAAA;IACT,kBAAW,CAAA;IACX,kBAAW,CAAA;IACX,kBAAW,CAAA;IACX,0BAAmB,CAAA;IACnB,gCAAyB,CAAA;IACzB,sBAAe,CAAA;IACf,mBAAY,CAAA;IACZ,kBAAW,CAAA;IACX,iBAAU,CAAA;IACV,mBAAY,CAAA;IACZ,uBAAgB,CAAA;IAChB,qBAAc,CAAA;IACd,yBAAkB,CAAA;IAClB,kBAAW,CAAA;IACX,wBAAiB,CAAA;IACjB,wBAAiB,CAAA;IACjB,0BAAmB,CAAA;IACnB,kBAAY,CAAA;AAChB,CAAC,EAjJW,GAAG,GAAH,WAAG,KAAH,WAAG,QAiJd"} \ No newline at end of file diff --git a/dist/declarations/index.d.ts b/dist/index.d.ts similarity index 97% rename from dist/declarations/index.d.ts rename to dist/index.d.ts index b47b3d3..f6efdb3 100644 --- a/dist/declarations/index.d.ts +++ b/dist/index.d.ts @@ -42,7 +42,7 @@ export declare enum Key { Ampersand = "&", Eight = "8", Star = "*", - Asterik = "*", + Asterisk = "*", Nine = "9", OpenParen = "(", a = "a", @@ -114,6 +114,7 @@ export declare enum Key { Add = "+", Subtract = "-", DecimalPoint = ".", + MSDecimalPoint = "Decimal", Divide = "/", F1 = "F1", F2 = "F2", @@ -141,5 +142,5 @@ export declare enum Key { GraveAccent = "`", OpenBracket = "[", ClosedBracket = "]", - Quote = "'", + Quote = "'" } diff --git a/dist/index.js b/dist/index.js index eb9bfd1..b72577b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,6 +1,4 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var Key; +export var Key; (function (Key) { Key["Backspace"] = "Backspace"; Key["Tab"] = "Tab"; @@ -45,7 +43,7 @@ var Key; Key["Ampersand"] = "&"; Key["Eight"] = "8"; Key["Star"] = "*"; - Key["Asterik"] = "*"; + Key["Asterisk"] = "*"; Key["Nine"] = "9"; Key["OpenParen"] = "("; Key["a"] = "a"; @@ -117,6 +115,7 @@ var Key; Key["Add"] = "+"; Key["Subtract"] = "-"; Key["DecimalPoint"] = "."; + Key["MSDecimalPoint"] = "Decimal"; Key["Divide"] = "/"; Key["F1"] = "F1"; Key["F2"] = "F2"; @@ -145,4 +144,5 @@ var Key; Key["OpenBracket"] = "["; Key["ClosedBracket"] = "]"; Key["Quote"] = "'"; -})(Key = exports.Key || (exports.Key = {})); +})(Key || (Key = {})); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..b16f2e6 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,MAAM,CAAN,IAAY,GAiJX;AAjJD,WAAY,GAAG;IACX,8BAAuB,CAAA;IACvB,kBAAW,CAAA;IACX,sBAAe,CAAA;IACf,sBAAe,CAAA;IACf,0BAAmB,CAAA;IACnB,kBAAW,CAAA;IACX,4BAA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;IACnB,kBAAY,CAAA;AAChB,CAAC,EAjJW,GAAG,KAAH,GAAG,QAiJd"} \ No newline at end of file diff --git a/index.ts b/index.ts index 8dc6691..f9bc7cd 100644 --- a/index.ts +++ b/index.ts @@ -43,7 +43,7 @@ export enum Key { Ampersand = '&', Eight = '8', Star = '*', - Asterik = '*', + Asterisk = '*', Nine = '9', OpenParen = '(', a = 'a', @@ -115,6 +115,7 @@ export enum Key { Add = '+', Subtract = '-', DecimalPoint = '.', + MSDecimalPoint = 'Decimal', Divide = '/', F1 = 'F1', F2 = 'F2', diff --git a/package-lock.json b/package-lock.json index 6c813ab..7120091 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "w3c-keys", - "version": "0.3.0", + "version": "0.3.6", "lockfileVersion": 1, "requires": true, "dependencies": { "typescript": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.4.2.tgz", - "integrity": "sha1-+DlfhdRZJ2BnyYiqQYN6j4KHCEQ=", + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.4.tgz", + "integrity": "sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg==", "dev": true } } diff --git a/package.json b/package.json index a6eb157..5355bed 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,14 @@ { "name": "w3c-keys", - "version": "0.3.6", + "version": "1.0.1", "description": "keyboardEvent.key compatible key codes with Typescript Definitions. Edit", - "main": "dist/index.js", - "types": "dist/declarations/index.d.ts", + "main": "dist/es5/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", "scripts": { - "build": "tsc" + "build": "tsc", + "build:es5": "tsc -p . --module commonjs --outDir dist/es5 --target es5", + "prepublish": "npm run build ; npm run build:es5" }, "repository": { "type": "git", @@ -27,6 +30,6 @@ }, "homepage": "https://github.com/ashubham/w3c-keys#readme", "devDependencies": { - "typescript": "^2.4.2" + "typescript": "^3.6.4" } } diff --git a/tsconfig.json b/tsconfig.json index 191114a..66d5b93 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,11 @@ { "compilerOptions": { "declaration": true, - "declarationDir": "dist/declarations", - "module": "commonjs", - "target": "es5", - "outDir": "dist" + "declarationDir": "dist", + "module": "esnext", + "target": "es2018", + "outDir": "dist", + "sourceMap": true }, "files": [ "index.ts"