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

react-input-mask

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-input-mask - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

6

build/InputElement.js

@@ -178,3 +178,3 @@ // https://github.com/sanniassin/react-input-mask

var char = substr.shift();
if (this.isAllowedChar(char, i, state)) {
if (this.isAllowedChar(char, i, state, true)) {
if (i < value.length) {

@@ -220,3 +220,5 @@ if (maskChar || isFilled) {

var state = arguments.length <= 2 || arguments[2] === undefined ? this.state : arguments[2];
var allowMaskChar = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
var mask = state.mask;
var maskChar = state.maskChar;

@@ -228,3 +230,3 @@ if (this.isPermanentChar(pos, state)) {

var charRule = this.charsRules[ruleChar];
return new RegExp(charRule).test(char || "");
return new RegExp(charRule).test(char || "") || allowMaskChar && char === maskChar;
},

@@ -231,0 +233,0 @@ isPermanentChar: function (pos) {

@@ -160,3 +160,3 @@ // https://github.com/sanniassin/react-input-mask

var char = substr.shift();
if (this.isAllowedChar(char, i, state)) {
if (this.isAllowedChar(char, i, state, true)) {
if (i < value.length) {

@@ -201,4 +201,4 @@ if (maskChar || isFilled) {

},
isAllowedChar: function(char, pos, state = this.state) {
var { mask } = state;
isAllowedChar: function(char, pos, state = this.state, allowMaskChar = false) {
var { mask, maskChar } = state;
if (this.isPermanentChar(pos, state)) {

@@ -209,3 +209,3 @@ return mask[pos] === char;

var charRule = this.charsRules[ruleChar];
return (new RegExp(charRule)).test(char || "");
return (new RegExp(charRule)).test(char || "") || (allowMaskChar && char === maskChar);
},

@@ -212,0 +212,0 @@ isPermanentChar: function(pos, state = this.state) {

{
"name": "react-input-mask",
"description": "Masked input component for React",
"version": "0.5.1",
"version": "0.5.2",
"homepage": "https://github.com/sanniassin/react-input-mask",

@@ -6,0 +6,0 @@ "license": "MIT",

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