Socket
Socket
Sign inDemoInstall

@mamba/core

Package Overview
Dependencies
Maintainers
4
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mamba/core - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

currency/index.ts

10

CHANGELOG.md

@@ -6,2 +6,12 @@ # Change Log

## [1.2.0](https://github.com/stone-payments/pos-mamba-sdk/compare/@mamba/core@1.1.1...@mamba/core@1.2.0) (2022-09-13)
### Bug Fixes
* 🐛 back and backspace key code conflict ([34fbf45](https://github.com/stone-payments/pos-mamba-sdk/commit/34fbf45d0b69d420d2ea66e15b7ac45768f76d46))
* 🐛 fix hard coded keys and its events ([7caddec](https://github.com/stone-payments/pos-mamba-sdk/commit/7caddec0f31d60c3fe2adb16970703b4c1ff7765))
### [1.1.1](https://github.com/stone-payments/pos-mamba-sdk/compare/@mamba/core@1.1.0...@mamba/core@1.1.1) (2022-08-30)

@@ -8,0 +18,0 @@

3

dist/index.js
import extend from './extend.js';
import * as KEYBOARD from './keymap';
export { extend, KEYBOARD };
import * as CURRENCY from './currency';
export { extend, KEYBOARD, CURRENCY };
export default extend;
//# sourceMappingURL=index.js.map
export { default as KEY_MAP } from './keyMap';
export { default as KEY_NAMES } from './keyNames';
export { default as KEY_CODES, ENTER, KEYBACK, CLOSE, HELP, SHORTCUTS, F23, F24, KEYUP, KEYDOWN, ARROW_UP, ARROW_DOWN, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, } from './keyCodes';
export { default as KEY_CODES, ENTER, CLOSE, HELP, SHORTCUTS, F23, F24, ARROW_UP, ARROW_DOWN, KEYUP, KEYDOWN, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, } from './keyCodes';
export { default as KEY_NAMES_LIST } from './keyNamesList';
export { default as KEY_CODE_LIST } from './keyCodeList';
//# sourceMappingURL=index.js.map
/**
* Represents keycodes of POS physical keyboard
*/
export const BACKSPACE = 8;
/** Alias `BACKSPACE` */
export const KEYBACK = BACKSPACE;
export const BACK = 8;
export const ENTER = 13;

@@ -38,5 +36,3 @@ export const SHORTCUTS = 16; // MP35 F3 of keyIdentifier: "U+1000020"

ENTER,
/** Alias `BACKSPACE` */
KEYBACK,
BACKSPACE,
BACK,
CLOSE,

@@ -48,2 +44,4 @@ HELP,

SPACE,
ARROW_UP,
ARROW_DOWN,
/**

@@ -53,3 +51,2 @@ * @deprecated Use `ARROW_UP`

KEYUP,
ARROW_UP,
/**

@@ -59,3 +56,2 @@ * @deprecated Use `ARROW_DOWN`

KEYDOWN,
ARROW_DOWN,
/** Numbers */

@@ -62,0 +58,0 @@ KEY_0,

@@ -8,4 +8,3 @@ /**

[KEY.ENTER]: KEY_NAME.ENTER,
[KEY.BACKSPACE]: KEY_NAME.BACKSPACE,
[KEY.KEYBACK]: KEY_NAME.BACK,
[KEY.BACK]: KEY_NAME.BACK,
[KEY.CLOSE]: KEY_NAME.CLOSE,

@@ -29,11 +28,12 @@ [KEY.HELP]: KEY_NAME.HELP,

[KEY.SPACE]: KEY_NAME.SPACE,
/**
* @deprecated Use `ARROW_UP`
*/
[KEY.KEYUP]: KEY_NAME.KEYUP,
/**
* @deprecated Use `ARROW_UP`
*/
[KEY.KEYDOWN]: KEY_NAME.KEYDOWN,
/// Comment for reference
// /**
// * @deprecated Use `ARROW_UP`
// */
// [KEY.KEYUP]: KEY_NAME.KEYUP,
// /**
// * @deprecated Use `ARROW_UP`
// */
// [KEY.KEYDOWN]: KEY_NAME.KEYDOWN,
});
//# sourceMappingURL=keyMap.js.map

@@ -1,20 +0,18 @@

const BACK = 'Backspace';
export default Object.freeze({
CLOSE: 'Close',
BACK,
BACKSPACE: BACK,
ENTER: 'Enter',
HELP: 'Help',
SHORTCUTS: 'Shortcuts',
SPACE: 'Space',
CLOSE: 'close',
BACK: 'back',
ENTER: 'enter',
HELP: 'help',
SHORTCUTS: 'shortcuts',
SPACE: 'space',
ARROW_UP: 'keyup',
ARROW_DOWN: 'keydown',
/**
* @deprecated Use `ARROW_UP`
*/
KEYUP: 'KeyUp',
ARROW_UP: 'ArrowUp',
KEYUP: 'keyup',
/**
* @deprecated Use `ARROW_DOWN`
*/
KEYDOWN: 'KeyDown',
ARROW_DOWN: 'ArrowDown',
KEYDOWN: 'keydown',
F24: 'F24',

@@ -21,0 +19,0 @@ F23: 'F23',

import extend from './extend.js';
import * as KEYBOARD from './keymap';
import * as CURRENCY from './currency';
export { extend, KEYBOARD };
export { extend, KEYBOARD, CURRENCY };
export default extend;

@@ -7,3 +7,2 @@ export { default as KEY_MAP } from './keyMap';

ENTER,
KEYBACK,
CLOSE,

@@ -14,6 +13,6 @@ HELP,

F24,
ARROW_UP,
ARROW_DOWN,
KEYUP,
KEYDOWN,
ARROW_UP,
ARROW_DOWN,
KEY_0,

@@ -20,0 +19,0 @@ KEY_1,

@@ -5,5 +5,3 @@ /**

export const BACKSPACE = 8;
/** Alias `BACKSPACE` */
export const KEYBACK = BACKSPACE;
export const BACK = 8;
export const ENTER = 13;

@@ -46,7 +44,3 @@ export const SHORTCUTS = 16; // MP35 F3 of keyIdentifier: "U+1000020"

ENTER,
/** Alias `BACKSPACE` */
KEYBACK,
BACKSPACE,
BACK,
CLOSE, // Escape key

@@ -59,2 +53,5 @@ HELP, // MP35 F1 of keyIdentifier: "U+1000021". `Control` key alias

ARROW_UP,
ARROW_DOWN,
/**

@@ -64,3 +61,2 @@ * @deprecated Use `ARROW_UP`

KEYUP,
ARROW_UP,

@@ -71,3 +67,2 @@ /**

KEYDOWN,
ARROW_DOWN,

@@ -74,0 +69,0 @@ /** Numbers */

@@ -10,4 +10,3 @@ /**

[KEY.ENTER]: KEY_NAME.ENTER,
[KEY.BACKSPACE]: KEY_NAME.BACKSPACE,
[KEY.KEYBACK]: KEY_NAME.BACK,
[KEY.BACK]: KEY_NAME.BACK,
[KEY.CLOSE]: KEY_NAME.CLOSE,

@@ -32,11 +31,12 @@ [KEY.HELP]: KEY_NAME.HELP,

/**
* @deprecated Use `ARROW_UP`
*/
[KEY.KEYUP]: KEY_NAME.KEYUP,
/// Comment for reference
// /**
// * @deprecated Use `ARROW_UP`
// */
// [KEY.KEYUP]: KEY_NAME.KEYUP,
/**
* @deprecated Use `ARROW_UP`
*/
[KEY.KEYDOWN]: KEY_NAME.KEYDOWN,
// /**
// * @deprecated Use `ARROW_UP`
// */
// [KEY.KEYDOWN]: KEY_NAME.KEYDOWN,
});

@@ -1,23 +0,21 @@

const BACK = 'Backspace';
export default Object.freeze({
CLOSE: 'Close',
BACK,
BACKSPACE: BACK,
CLOSE: 'close',
BACK: 'back',
ENTER: 'Enter',
HELP: 'Help',
SHORTCUTS: 'Shortcuts',
SPACE: 'Space',
ENTER: 'enter',
HELP: 'help',
SHORTCUTS: 'shortcuts',
SPACE: 'space',
ARROW_UP: 'keyup',
ARROW_DOWN: 'keydown',
/**
* @deprecated Use `ARROW_UP`
*/
KEYUP: 'KeyUp',
ARROW_UP: 'ArrowUp',
KEYUP: 'keyup',
/**
* @deprecated Use `ARROW_DOWN`
*/
KEYDOWN: 'KeyDown',
ARROW_DOWN: 'ArrowDown',
KEYDOWN: 'keydown',

@@ -24,0 +22,0 @@ F24: 'F24',

{
"name": "@mamba/core",
"version": "1.1.1",
"version": "1.2.0",
"main": "dist/index.js",

@@ -11,3 +11,3 @@ "types": "types/index.d.ts",

"node": ">= 8 || <= 14",
"npm": ">=6"
"npm": ">6"
},

@@ -30,3 +30,3 @@ "repository": {

},
"gitHead": "4e64e02d2e26921589d93a8c8c45e9d58889d0c6"
"gitHead": "35b4ded3263250d164c2724393d7aa8dca572aa6"
}
# Core
Core mamba packages with some essential and shared code.
Pacotes principais do mamba com alguns códigos essenciais e compartilhados.
## Extend
Extend a driver with the base driver.
Estenda um driver com o driver base.

@@ -18,5 +18,17 @@ ```js

## Currency
Fornece constante da moeda no POS.
### Limite máximo
```js
import { CURRENCY } from '@mamba/core';
CURRENCY.LIMIT; // 999999.99
```
## Keymap
Provides the specific key-maps and key-names of POS.
Fornece os mapas-chave e nomes-chave específicos do POS.

@@ -30,4 +42,4 @@ ### KEY_NAMES

KEY_NAMES.ENTER; // 'Enter'
KEY_NAMES_LIST; // ['CLOSE', 'BACK', 'BACKSPACE', 'ENTER', 'HELP', 'SHORTCUTS', 'SPACE', 'KEYUP', 'ARROW_UP', 'KEYDOWN', 'ARROW_DOWN', 'F24', 'F23', 'KEY_0', 'KEY_1', 'KEY_2', 'KEY_3', 'KEY_4', 'KEY_5', 'KEY_6', 'KEY_7', 'KEY_8', 'KEY_9']
KEY_NAMES.ENTER; // 'enter'
KEY_NAMES_LIST; // ['CLOSE', 'BACK', 'ENTER', 'HELP', 'SHORTCUTS', 'SPACE', 'KEYUP', 'ARROW_UP', 'KEYDOWN', 'ARROW_DOWN', 'F24', 'F23', 'KEY_0', 'KEY_1', 'KEY_2', 'KEY_3', 'KEY_4', 'KEY_5', 'KEY_6', 'KEY_7', 'KEY_8', 'KEY_9']
```

@@ -39,9 +51,8 @@

{
CLOSE: 'Close',
BACK: 'Backspace',
BACKSPACE: 'Backspace',
ENTER: 'Enter',
HELP: 'Help',
SHORTCUTS: 'Shortcuts',
SPACE: 'Space',
CLOSE: 'close',
BACK: 'back',
ENTER: 'enter',
HELP: 'help',
SHORTCUTS: 'shortcuts',
SPACE: 'space',
F24: 'F24',

@@ -63,9 +74,9 @@ F23: 'F23',

*/
KEYUP: 'KeyUp',
ARROW_UP: 'ArrowUp',
KEYUP: 'keyup',
ARROW_UP: 'keyup',
/**
* @deprecated Use `ARROW_DOWN`
*/
KEYDOWN: 'KeyDown',
ARROW_DOWN: 'ArrowDown',
KEYDOWN: 'keydown',
ARROW_DOWN: 'keydown',
}

@@ -82,3 +93,3 @@ ```

KEY_CODES.ENTER; // 13
KEY_CODES_LIST; // [13, 8, 8, 27, 17, 16, 134, 135, 32, 38, 38, 40, 40, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57]
KEY_CODES_LIST; // [13, 8, 8, 27, 17, 16, 134, 135, 32, 38, 40, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57]
```

@@ -90,4 +101,3 @@

{
BACKSPACE: 8,
KEYBACK: 8, // `BACKSPACE `Alias`
BACK: 8,
ENTER: 13,

@@ -126,3 +136,3 @@ SHORTCUTS: 16,

Maped key codes to key names
Códigos de chave mapeados para nomes de chave

@@ -146,10 +156,10 @@ [keyboard.getkeyname(keycode)]: #getkeynamekeycode

{
"8": "Backspace",
"13": "Enter",
"16": "Shortcuts",
"17": "Help",
"27": "Close",
"32": "Space",
"38": "KeyUp",
"40": "KeyDown",
"8": "back",
"13": "enter",
"16": "shortcuts",
"17": "help",
"27": "close",
"32": "space",
"38": "keyup",
"40": "keydown",
"48": "0",

@@ -172,3 +182,3 @@ "49": "1",

Let's say you want to do some action on your screen based on some POS key.
Digamos que você queira fazer alguma ação na tela com base em alguma chave POS.

@@ -175,0 +185,0 @@ ```html

import extend from './extend.js';
import * as KEYBOARD from './keymap';
export { extend, KEYBOARD };
import * as CURRENCY from './currency';
export { extend, KEYBOARD, CURRENCY };
export default extend;
export { default as KEY_MAP } from './keyMap';
export { default as KEY_NAMES } from './keyNames';
export { default as KEY_CODES, ENTER, KEYBACK, CLOSE, HELP, SHORTCUTS, F23, F24, KEYUP, KEYDOWN, ARROW_UP, ARROW_DOWN, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, } from './keyCodes';
export { default as KEY_CODES, ENTER, CLOSE, HELP, SHORTCUTS, F23, F24, ARROW_UP, ARROW_DOWN, KEYUP, KEYDOWN, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, } from './keyCodes';
export { default as KEY_NAMES_LIST } from './keyNamesList';
export { default as KEY_CODE_LIST } from './keyCodeList';
/**
* Represents keycodes of POS physical keyboard
*/
export declare const BACKSPACE = 8;
/** Alias `BACKSPACE` */
export declare const KEYBACK = 8;
export declare const BACK = 8;
export declare const ENTER = 13;

@@ -37,5 +35,3 @@ export declare const SHORTCUTS = 16;

ENTER: 13;
/** Alias `BACKSPACE` */
KEYBACK: 8;
BACKSPACE: 8;
BACK: 8;
CLOSE: 27;

@@ -47,2 +43,4 @@ HELP: 17;

SPACE: 32;
ARROW_UP: 38;
ARROW_DOWN: 40;
/**

@@ -52,3 +50,2 @@ * @deprecated Use `ARROW_UP`

KEYUP: 38;
ARROW_UP: 38;
/**

@@ -58,3 +55,2 @@ * @deprecated Use `ARROW_DOWN`

KEYDOWN: 40;
ARROW_DOWN: 40;
/** Numbers */

@@ -61,0 +57,0 @@ KEY_0: 48;

@@ -5,11 +5,11 @@ /**

declare const _default: Readonly<{
13: "Enter";
8: "Backspace";
27: "Close";
17: "Help";
16: "Shortcuts";
13: "enter";
8: "back";
27: "close";
17: "help";
16: "shortcuts";
134: "F23";
135: "F24";
38: "KeyUp";
40: "KeyDown";
38: "keyup";
40: "keydown";
48: "0";

@@ -25,4 +25,4 @@ 49: "1";

57: "9";
32: "Space";
32: "space";
}>;
export default _default;
declare const _default: Readonly<{
CLOSE: "Close";
BACK: "Backspace";
BACKSPACE: "Backspace";
ENTER: "Enter";
HELP: "Help";
SHORTCUTS: "Shortcuts";
SPACE: "Space";
CLOSE: "close";
BACK: "back";
ENTER: "enter";
HELP: "help";
SHORTCUTS: "shortcuts";
SPACE: "space";
ARROW_UP: "keyup";
ARROW_DOWN: "keydown";
/**
* @deprecated Use `ARROW_UP`
*/
KEYUP: "KeyUp";
ARROW_UP: "ArrowUp";
KEYUP: "keyup";
/**
* @deprecated Use `ARROW_DOWN`
*/
KEYDOWN: "KeyDown";
ARROW_DOWN: "ArrowDown";
KEYDOWN: "keydown";
F24: "F24";

@@ -20,0 +19,0 @@ F23: "F23";

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

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