@maskito/kit
Advanced tools
Comparing version 1.8.1 to 1.8.2
@@ -444,9 +444,7 @@ import { MASKITO_DEFAULT_OPTIONS, maskitoTransform } from '@maskito/core'; | ||
const [from, to] = selection; | ||
const requiredPrefix = Array.from(prefix).reduce((computedPrefix, char, i) => { | ||
const newValue = computedPrefix + value; | ||
return newValue[i] === char ? computedPrefix : computedPrefix + char; | ||
}, ''); | ||
const prefixedValue = Array.from(prefix).reduce((modifiedValue, char, i) => modifiedValue[i] === char ? modifiedValue : modifiedValue.slice(0, i) + char + modifiedValue.slice(i), value); | ||
const addedCharsCount = prefixedValue.length - value.length; | ||
return { | ||
selection: [from + requiredPrefix.length, to + requiredPrefix.length], | ||
value: requiredPrefix + value | ||
selection: [from + addedCharsCount, to + addedCharsCount], | ||
value: prefixedValue | ||
}; | ||
@@ -453,0 +451,0 @@ } : identity; |
{ | ||
"name": "@maskito/kit", | ||
"version": "1.8.1", | ||
"version": "1.8.2", | ||
"description": "The optional framework-agnostic Maskito's package with ready-to-use masks", | ||
@@ -33,3 +33,3 @@ "keywords": [ | ||
"peerDependencies": { | ||
"@maskito/core": "^1.8.1" | ||
"@maskito/core": "^1.8.2" | ||
}, | ||
@@ -36,0 +36,0 @@ "main": "./index.umd.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
197446
3925