New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ks-util

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ks-util - npm Package Compare versions

Comparing version
1.11.2
to
1.11.3
+1
-1
package.json
{
"name": "ks-util",
"version": "1.11.2",
"version": "1.11.3",
"description": "Miscellaneous utility functions",

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

export interface FontMetrics {
font: string;
lineHeight: number;
ascent: number;
fullAscent: number;
descent: number;
leading: number;
}
export declare function extendDelimited(base: string, newItem: string, delimiter?: string): string;
export declare function beep(): void;
export declare function getCssValue(element: Element, property: string): string;
export declare function getFont(element: Element): string;
export declare function getFontMetrics(elementOrFont: Element | string): FontMetrics;
export declare function getTextWidth(items: string | string[], font: string | HTMLElement, fallbackFont?: string): number;
export declare function restrictPixelWidth(text: string, font: string | HTMLElement, maxWidth: number, clipString?: string): string;
export declare function isSafari(): boolean;
export declare function isFirefox(): boolean;
export declare function isIE(): boolean;
export declare function isEdge(): boolean;
export declare function isWindows(): boolean;
export declare function isRaspbian(): boolean;
export declare function isIOS(): boolean;
export declare function isAndroid(): boolean;
export declare function padLeft(item: string | number, length: number, padChar?: string): string;
export declare function padRight(item: string, length: number, padChar?: string): string;
export declare function urlEncodeParams(params: {
[key: string]: string;
}): string;
export declare function compareStrings(a: string, b: string): number;
export declare function compareCaseInsensitive(a: string, b: string): number;
export declare function compareCaseSecondary(a: string, b: string): number;
export declare function replace(str: string, searchStr: string, replaceStr: string, caseInsensitive?: boolean): string;
export declare function strokeLine(context: CanvasRenderingContext2D, x0: number, y0: number, x1: number, y1: number): void;
export declare function strokeCircle(context: CanvasRenderingContext2D, cx: number, cy: number, radius: number): void;
export declare function strokeEllipse(context: CanvasRenderingContext2D, cx: number, cy: number, rx: number, ry: number): void;
export declare function fillEllipse(context: CanvasRenderingContext2D, cx: number, cy: number, rx: number, ry: number): void;
export declare function colorFromRGB(r: number, g: number, b: number, alpha?: number): string;
export declare function colorFrom24BitInt(i: number, alpha?: number): string;
export declare function colorFromByteArray(array: number[], offset: number): string;
export interface RGBA {
r: number;
g: number;
b: number;
alpha: number;
}
export declare function parseColor(color: string): RGBA;
export declare function replaceAlpha(color: string, newAlpha: number): string;
export declare function blendColors(color1: string, color2: string): string;
export declare function drawOutlinedText(context: CanvasRenderingContext2D, text: string, x: number, y: number, outlineStyle?: string, fillStyle?: string): void;
export declare function getPixel(imageData: ImageData, x: number, y: number): number;
export declare function setPixel(imageData: ImageData, x: number, y: number, pixel: number): void;
export declare function toDefaultLocaleFixed(n: number, minFracDigits?: number, maxFracDigits?: number): string;
export declare function isFullScreen(): boolean;
export declare function toggleFullScreen(): void;
export declare function setFullScreen(full: boolean): void;
export declare function toBoolean(str: any, defaultValue?: boolean): boolean;
export declare function eventToKey(event: KeyboardEvent): string;
"use strict";
/*
Copyright © 2017-2019 Kerry Shetline, kerry@shetline.com
MIT license: https://opensource.org/licenses/MIT
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var forEach_1 = __importDefault(require("lodash/forEach"));
var isNil_1 = __importDefault(require("lodash/isNil"));
var isString_1 = __importDefault(require("lodash/isString"));
var ks_math_1 = require("ks-math");
function extendDelimited(base, newItem, delimiter) {
if (delimiter === void 0) { delimiter = ', '; }
if (!base)
return newItem;
else
return base + delimiter + newItem;
}
exports.extendDelimited = extendDelimited;
function beep() {
var audioContext = new (window.AudioContext);
var oscillator = audioContext.createOscillator();
var gain = audioContext.createGain();
oscillator.type = 'square';
oscillator.frequency.value = 440;
oscillator.connect(gain);
gain.gain.value = 0.025;
gain.connect(audioContext.destination);
oscillator.start();
setTimeout(function () {
oscillator.stop();
oscillator.disconnect();
gain.disconnect();
// noinspection JSIgnoredPromiseFromCall
audioContext.close();
}, 100);
}
exports.beep = beep;
function getCssValue(element, property) {
return document.defaultView.getComputedStyle(element, null).getPropertyValue(property);
}
exports.getCssValue = getCssValue;
function getFont(element) {
var style = document.defaultView.getComputedStyle(element, null);
var font = style.getPropertyValue('font');
if (!font) {
var fontStyle = style.getPropertyValue('font-style');
var fontVariant = style.getPropertyValue('font-variant');
var fontWeight = style.getPropertyValue('font-weight');
var fontSize = style.getPropertyValue('font-size');
var fontFamily = style.getPropertyValue('font-family');
font = (fontStyle + ' ' + fontVariant + ' ' + fontWeight + ' ' + fontSize + ' ' + fontFamily).replace(/ +/g, ' ').trim();
}
return font;
}
exports.getFont = getFont;
var cachedMetrics = {};
function getFontMetrics(elementOrFont) {
var font;
if (isString_1.default(elementOrFont))
font = elementOrFont;
else
font = getFont(elementOrFont);
var metrics = cachedMetrics[font];
if (metrics)
return metrics;
var testFont = font;
var fontSize = 12;
var testFontSize = 12;
var fontParts = /(.*?\b)((?:\d|\.)+)(px\b.*)/.exec(font);
// Double the font size so there's more pixel detail to scan, then scale down the result afterward.
if (fontParts) {
fontSize = parseFloat(fontParts[2]);
testFontSize = fontSize * 2;
testFont = fontParts[1] + testFontSize + fontParts[3];
}
var PADDING = 50;
var sampleText1 = 'Eg';
var sampleText2 = 'ÅÊ';
var lineHeight = fontSize * 1.2;
var heightDiv = document.createElement('div');
heightDiv.style.position = 'absolute';
heightDiv.style.opacity = '0';
heightDiv.style.font = font;
heightDiv.innerHTML = sampleText1 + '<br>' + sampleText1;
document.body.appendChild(heightDiv);
var heightDivHeight = parseFloat(getCssValue(heightDiv, 'height').replace('px', ''));
if (heightDivHeight >= fontSize * 2)
lineHeight = heightDivHeight / 2;
document.body.removeChild(heightDiv);
var canvas = getFontMetrics.canvas || (getFontMetrics.canvas =
document.createElement('canvas'));
canvas.width = testFontSize * 2 + PADDING;
canvas.height = testFontSize * 3;
canvas.style.opacity = '1';
var context = canvas.getContext('2d');
var w = canvas.width, w4 = w * 4, h = canvas.height, baseline = h / 2;
context.fillStyle = 'white';
context.fillRect(-1, -1, w + 2, h + 2);
context.fillStyle = 'black';
context.font = testFont;
context.fillText(sampleText1, PADDING / 2, baseline);
var pixels = context.getImageData(0, 0, w, h).data;
var i = 0;
var len = pixels.length;
// Finding the ascent uses a normal, forward scanline
while (++i < len && pixels[i] > 192) { }
var ascent = Math.floor(i / w4);
// Finding the descent uses a reverse scanline
i = len - 1;
while (--i > 0 && pixels[i] > 192) { }
var descent = Math.floor(i / w4);
context.fillStyle = 'white';
context.fillRect(-1, -1, w + 2, h + 2);
context.fillStyle = 'black';
context.fillText(sampleText2, PADDING / 2, baseline);
pixels = context.getImageData(0, 0, w, h).data;
// Finding the full ascent, including diacriticals.
i = 0;
while (++i < len && pixels[i] > 192) { }
var fullAscent = Math.floor(i / w4);
ascent = baseline - ascent;
fullAscent = baseline - fullAscent;
descent = descent - baseline;
if (testFontSize > fontSize) {
ascent = Math.ceil(ascent / 2);
fullAscent = Math.ceil(fullAscent / 2);
descent = Math.ceil(descent / 2);
}
var leading = lineHeight - fullAscent - descent;
metrics = { font: font, lineHeight: lineHeight, ascent: ascent, fullAscent: fullAscent, descent: descent, leading: leading };
cachedMetrics[font] = metrics;
return metrics;
}
exports.getFontMetrics = getFontMetrics;
function getTextWidth(items, font, fallbackFont) {
var canvas = (getTextWidth.canvas ||
(getTextWidth.canvas = document.createElement('canvas')));
var context = canvas.getContext('2d');
var maxWidth = 0;
var elementFont;
if (typeof font === 'string')
elementFont = font;
else if (typeof font === 'object')
elementFont = getFont(font);
if (elementFont)
context.font = elementFont;
else if (fallbackFont)
context.font = fallbackFont;
else
context.font = 'normal 12px sans-serif';
if (!Array.isArray(items))
items = [items];
for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
var item = items_1[_i];
var width = context.measureText(item).width;
maxWidth = Math.max(maxWidth, width);
}
return maxWidth;
}
exports.getTextWidth = getTextWidth;
function restrictPixelWidth(text, font, maxWidth, clipString) {
if (clipString === void 0) { clipString = '\u2026'; }
var width = getTextWidth(text, font);
var takeOffEnd = 1;
while (width > maxWidth) {
text = text.substring(0, text.length - takeOffEnd) + clipString;
takeOffEnd = 1 + clipString.length;
width = getTextWidth(text, font);
}
return text;
}
exports.restrictPixelWidth = restrictPixelWidth;
function isSafari() {
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent) && !isEdge();
}
exports.isSafari = isSafari;
function isFirefox() {
return /firefox/i.test(navigator.userAgent) && !/seamonkey/i.test(navigator.userAgent);
}
exports.isFirefox = isFirefox;
function isIE() {
return /(?:\b(MS)?IE\s+|\bTrident\/7\.0;.*\s+rv:)(\d+)/.test(navigator.userAgent);
}
exports.isIE = isIE;
function isEdge() {
return /\bedge\b/i.test(navigator.userAgent) && isWindows();
}
exports.isEdge = isEdge;
function isWindows() {
return navigator.appVersion.includes('Windows') || navigator.platform.startsWith('Win');
}
exports.isWindows = isWindows;
function isRaspbian() {
return navigator.userAgent.includes('Raspbian');
}
exports.isRaspbian = isRaspbian;
function isIOS() {
return !!navigator.platform.match(/i(Pad|Pod|Phone)/i);
}
exports.isIOS = isIOS;
function isAndroid() {
return navigator.userAgent.includes('Android');
}
exports.isAndroid = isAndroid;
function padLeft(item, length, padChar) {
if (padChar === void 0) { padChar = ' '; }
var sign = '';
if (typeof item === 'number' && item < 0 && padChar === '0') {
sign = '-';
item = -item;
--length;
}
var result = String(item);
while (result.length < length) {
result = padChar + result;
}
return sign + result;
}
exports.padLeft = padLeft;
function padRight(item, length, padChar) {
if (!padChar) {
padChar = ' ';
}
while (item.length < length) {
item += padChar;
}
return item;
}
exports.padRight = padRight;
function urlEncodeParams(params) {
var result = [];
forEach_1.default(params, function (value, key) {
if (!isNil_1.default(value))
result.push(key + '=' + encodeURIComponent(value));
});
return result.join('&');
}
exports.urlEncodeParams = urlEncodeParams;
function compareStrings(a, b) {
return (a < b ? -1 : (a > b ? 1 : 0));
}
exports.compareStrings = compareStrings;
function compareCaseInsensitive(a, b) {
a = a.toLowerCase();
b = b.toLowerCase();
return (a < b ? -1 : (a > b ? 1 : 0));
}
exports.compareCaseInsensitive = compareCaseInsensitive;
function compareCaseSecondary(a, b) {
var a1 = a.toLowerCase();
var b1 = b.toLowerCase();
var result = (a1 < b1 ? -1 : (a1 > b1 ? 1 : 0));
if (result !== 0)
return result;
return (a < b ? -1 : (a > b ? 1 : 0));
}
exports.compareCaseSecondary = compareCaseSecondary;
function replace(str, searchStr, replaceStr, caseInsensitive) {
if (caseInsensitive === void 0) { caseInsensitive = false; }
// escape regexp special characters in search string
searchStr = searchStr.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
return str.replace(new RegExp(searchStr, 'g' + (caseInsensitive ? 'i' : '')), replaceStr);
}
exports.replace = replace;
function strokeLine(context, x0, y0, x1, y1) {
context.beginPath();
context.moveTo(x0, y0);
context.lineTo(x1, y1);
context.stroke();
context.closePath();
}
exports.strokeLine = strokeLine;
function strokeCircle(context, cx, cy, radius) {
context.beginPath();
context.arc(cx, cy, radius, 0, Math.PI * 2, false);
context.stroke();
context.closePath();
}
exports.strokeCircle = strokeCircle;
function strokeEllipse(context, cx, cy, rx, ry) {
context.save();
context.beginPath();
context.translate(cx - rx, cy - ry);
context.scale(rx, ry);
context.arc(1, 1, 1, 0, Math.PI * 2, false);
context.restore();
context.stroke();
context.closePath();
}
exports.strokeEllipse = strokeEllipse;
function fillEllipse(context, cx, cy, rx, ry) {
context.save();
context.beginPath();
context.translate(cx - rx, cy - ry);
context.scale(rx, ry);
context.arc(1, 1, 1, 0, Math.PI * 2, false);
context.restore();
context.fill();
}
exports.fillEllipse = fillEllipse;
function colorFromRGB(r, g, b, alpha) {
if (alpha === void 0) { alpha = 1.0; }
r = ks_math_1.min(ks_math_1.max(ks_math_1.round(r), 0), 255);
g = ks_math_1.min(ks_math_1.max(ks_math_1.round(g), 0), 255);
b = ks_math_1.min(ks_math_1.max(ks_math_1.round(b), 0), 255);
if (alpha >= 1.0)
return ('#' + padLeft(r.toString(16), 2, '0')
+ padLeft(g.toString(16), 2, '0')
+ padLeft(b.toString(16), 2, '0')).toUpperCase();
else
return 'rgba(' + r + ',' + g + ',' + b + ',' + ks_math_1.max(alpha, 0) + ')';
}
exports.colorFromRGB = colorFromRGB;
function colorFrom24BitInt(i, alpha) {
if (alpha === void 0) { alpha = 1.0; }
var r = (i & 0xFF0000) >> 16;
var g = (i & 0x00FF00) >> 8;
var b = i & 0x0000FF;
return colorFromRGB(r, g, b, alpha);
}
exports.colorFrom24BitInt = colorFrom24BitInt;
function colorFromByteArray(array, offset) {
var r = array[offset];
var g = array[offset + 1];
var b = array[offset + 2];
var alpha = array[offset + 4] / 255;
return colorFromRGB(r, g, b, alpha);
}
exports.colorFromByteArray = colorFromByteArray;
var colorNameRegex = /[a-z]+/i;
var rgbRegex = /rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/;
var rgbaRegex = /rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([0-9.]+)\s*\)/;
var utilContext;
function parseColor(color) {
var match = colorNameRegex.exec(color);
if (match) {
if (!utilContext) {
var canvas = document.createElement('canvas');
utilContext = canvas.getContext('2d');
}
utilContext.fillStyle = color; // Let the context parse the color name.
color = String(utilContext.fillStyle); // Get the same color back in hex/RGB form.
}
if (color.startsWith('#')) {
if (color.length === 4)
return { r: parseInt(color.substr(1, 1) + color.substr(1, 1), 16),
g: parseInt(color.substr(2, 1) + color.substr(2, 1), 16),
b: parseInt(color.substr(3, 1) + color.substr(3, 1), 16),
alpha: 1.0 };
else if (color.length === 7)
return { r: parseInt(color.substr(1, 2), 16),
g: parseInt(color.substr(3, 2), 16),
b: parseInt(color.substr(5, 2), 16),
alpha: 1.0 };
}
match = rgbRegex.exec(color);
if (match)
return { r: Number(match[1]), g: Number(match[2]), b: Number(match[3]), alpha: 1 };
match = rgbaRegex.exec(color);
if (match)
return { r: Number(match[1]), g: Number(match[2]), b: Number(match[3]), alpha: Number(match[4]) };
return { r: 0, g: 0, b: 0, alpha: 0 };
}
exports.parseColor = parseColor;
function replaceAlpha(color, newAlpha) {
var rgba = parseColor(color);
return colorFromRGB(rgba.r, rgba.g, rgba.b, newAlpha);
}
exports.replaceAlpha = replaceAlpha;
function blendColors(color1, color2) {
var c1 = parseColor(color1);
var c2 = parseColor(color2);
var r1 = c1.r;
var g1 = c1.g;
var b1 = c1.b;
var a1 = c1.alpha;
var r2 = c2.r;
var g2 = c2.g;
var b2 = c2.b;
var a2 = c2.alpha;
return colorFromRGB(ks_math_1.floor((r1 + r2 + 1) / 2), ks_math_1.floor((g1 + g2 + 1) / 2), ks_math_1.floor((b1 + b2 + 1) / 2), (a1 + a2) / 2);
}
exports.blendColors = blendColors;
function drawOutlinedText(context, text, x, y, outlineStyle, fillStyle) {
context.save();
context.lineWidth = 4;
context.lineJoin = 'round';
if (outlineStyle)
context.strokeStyle = outlineStyle;
if (fillStyle)
context.fillStyle = fillStyle;
context.strokeText(text, x, y);
context.fillText(text, x, y);
context.restore();
}
exports.drawOutlinedText = drawOutlinedText;
function getPixel(imageData, x, y) {
if (x < 0 || y < 0 || x >= imageData.width || y >= imageData.height)
return 0;
var offset = (y * imageData.width + x) * 4;
return (imageData.data[offset] << 16) |
(imageData.data[offset + 1] << 8) |
imageData.data[offset + 2] |
(imageData.data[offset + 3] << 24);
}
exports.getPixel = getPixel;
function setPixel(imageData, x, y, pixel) {
if (x < 0 || y < 0 || x >= imageData.width || y >= imageData.height)
return;
var offset = (y * imageData.width + x) * 4;
imageData.data[offset] = (pixel & 0x00FF0000) >> 16;
imageData.data[offset + 1] = (pixel & 0x0000FF00) >> 8;
imageData.data[offset + 2] = pixel & 0x000000FF;
imageData.data[offset + 3] = ((pixel & 0xFF000000) >> 24) & 0xFF;
}
exports.setPixel = setPixel;
function toDefaultLocaleFixed(n, minFracDigits, maxFracDigits) {
var options = {};
if (minFracDigits !== undefined)
options.minimumFractionDigits = minFracDigits;
if (maxFracDigits !== undefined)
options.maximumFractionDigits = maxFracDigits;
return n.toLocaleString(undefined, options);
}
exports.toDefaultLocaleFixed = toDefaultLocaleFixed;
function isFullScreen() {
var fsDoc = document;
return !!(fsDoc.fullscreenElement || fsDoc.mozFullScreenElement || fsDoc.webkitFullscreenElement || fsDoc.msFullscreenElement);
}
exports.isFullScreen = isFullScreen;
function toggleFullScreen() {
var fsDoc = document;
if (!isFullScreen()) {
var fsDocElem = document.documentElement;
if (fsDocElem.requestFullscreen)
fsDocElem.requestFullscreen();
else if (fsDocElem.msRequestFullscreen)
fsDocElem.msRequestFullscreen();
else if (fsDocElem.mozRequestFullScreen)
fsDocElem.mozRequestFullScreen();
else if (fsDocElem.webkitRequestFullscreen)
fsDocElem.webkitRequestFullscreen();
}
else if (fsDoc.exitFullscreen)
fsDoc.exitFullscreen();
else if (fsDoc.msExitFullscreen)
fsDoc.msExitFullscreen();
else if (fsDoc.mozCancelFullScreen)
fsDoc.mozCancelFullScreen();
else if (fsDoc.webkitExitFullscreen)
fsDoc.webkitExitFullscreen();
}
exports.toggleFullScreen = toggleFullScreen;
function setFullScreen(full) {
if (full !== isFullScreen())
toggleFullScreen();
}
exports.setFullScreen = setFullScreen;
function toBoolean(str, defaultValue) {
if (/^(true|t|yes|y)$/i.test(str))
return true;
else if (/^(false|f|no|n)$/i.test(str))
return false;
var n = Number(str);
if (!isNaN(n))
return n !== 0;
return defaultValue;
}
exports.toBoolean = toBoolean;
function eventToKey(event) {
var key = event.key;
if (key === undefined) {
var charCode = event.charCode;
if (charCode !== 0) {
key = String.fromCodePoint(charCode);
}
else {
var keyCode = event.keyCode || event.which;
switch (keyCode) {
case 8:
key = 'Backspace';
break;
case 9:
key = 'Tab';
break;
case 12:
key = 'Clear';
break;
case 13:
key = 'Enter';
break;
case 16:
key = 'Shift';
break;
case 17:
key = 'Control';
break;
case 18:
key = 'Alt';
break;
case 19:
key = 'Pause';
break;
case 20:
key = 'CapsLock';
break;
case 27:
key = 'Escape';
break;
case 33:
key = 'PageUp';
break;
case 34:
key = 'PageDown';
break;
case 35:
key = 'End';
break;
case 36:
key = 'Home';
break;
case 37:
key = 'ArrowLeft';
break;
case 38:
key = 'ArrowUp';
break;
case 39:
key = 'ArrowRight';
break;
case 40:
key = 'ArrowDown';
break;
case 44:
key = 'PrintScreen';
break;
case 45:
key = 'Insert';
break;
case 46:
key = 'Delete';
break;
case 91:
key = 'OS';
break;
case 93:
key = 'ContextMenu';
break;
case 144:
key = 'NumLock';
break;
case 145:
key = 'ScrollLock';
break;
case 224:
key = 'Meta';
break;
default:
if (112 <= keyCode && keyCode <= 135)
key = 'F' + (keyCode - 111);
}
}
}
else {
switch (key) {
case 'Left':
case 'UIKeyInputLeftArrow':
key = 'ArrowLeft';
break;
case 'Up':
case 'UIKeyInputUpArrow':
key = 'ArrowUp';
break;
case 'Right':
case 'UIKeyInputRightArrow':
key = 'ArrowRight';
break;
case 'Down':
case 'UIKeyInputDownArrow':
key = 'ArrowDown';
break;
case 'Add':
key = '+';
break;
case 'Subtract':
key = '-';
break;
case 'Multiply':
key = '*';
break;
case 'Divide':
key = '/';
break;
case 'Decimal':
key = '.';
break;
case 'Apps':
key = 'ContextMenu';
break;
case 'Del ':
key = 'Delete';
break;
case 'Esc':
key = 'Escape';
break;
case 'Scroll':
key = 'ScrollLock';
break;
case 'Spacebar':
key = ' ';
break;
case 'Win':
key = 'Meta';
break;
}
}
return key;
}
exports.eventToKey = eventToKey;
//# sourceMappingURL=ks-util.js.map