Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

awesome-mask

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

awesome-mask - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

scripts/is-character-keypress.js

15

index.js

@@ -11,2 +11,4 @@ 'use strict';

var _isCharacterKeypress = require('./is-character-keypress');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -16,2 +18,6 @@

var mask = ev.target.dataset.mask;
var isCharacter = (0, _isCharacterKeypress.isCharacterKeyPress)(ev) && ev.keyCode !== 9;
if (isCharacter && ev.target.value.length >= ev.target.dataset.mask.length) {
ev.preventDefault();
}
ev.target.value = mask ? _vanillaMasker2.default.toPattern(ev.target.value, mask) : ev.target.value;

@@ -23,10 +29,9 @@ };

el.dataset.mask = binding.value;
el.addEventListener('input', inputHandler);
el.setAttribute("maxlength", el.dataset.mask.length);
el.addEventListener('keydown', inputHandler);
},
update: function update(el, binding) {
el.dataset.mask = binding.value;
},
unbind: function unbind(el) {
el.removeEventListener('input', inputHandler);
el.removeAttribute("maxlength");
el.removeEventListener('keydown', inputHandler);
}
};
{
"name": "awesome-mask",
"version": "0.2.1",
"version": "0.2.2",
"description": "An awesome mask directive for Vue.js using vanilla-masker from `https://github.com/BankFacil/vanilla-masker`",

@@ -28,3 +28,4 @@ "main": "index.js",

"files": [
"index.js"
"index.js",
"scripts"
],

@@ -31,0 +32,0 @@ "devDependencies": {

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