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

@maskito/kit

Package Overview
Dependencies
Maintainers
4
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maskito/kit - npm Package Compare versions

Comparing version 0.8.1 to 0.9.0

lib/processors/prefix-postprocessor.d.ts

1

index.d.ts

@@ -6,3 +6,4 @@ export { maskitoDateOptionsGenerator } from './lib/masks/date';

export { maskitoTimeOptionsGenerator } from './lib/masks/time';
export { maskitoPrefixPostprocessorGenerator } from './lib/processors';
export { MaskitoDateMode, MaskitoDateSegments, MaskitoTimeMode, MaskitoTimeSegments, } from './lib/types';
//# sourceMappingURL=index.d.ts.map

@@ -311,2 +311,27 @@ import { maskitoPipe } from '@maskito/core';

function maskitoPrefixPostprocessorGenerator(prefix) {
return ({
value,
selection
}, initialElementState) => {
const minCaretIndex = prefix.length;
if (value.length < minCaretIndex && initialElementState.value) {
return {
selection: [minCaretIndex, minCaretIndex],
value: prefix
};
}
const [from, to] = selection;
return value.length && !value.startsWith(prefix) ? {
selection: [from + prefix.length, to + prefix.length],
value: prefix + value
} : {
selection,
value
};
};
}
function createValidDatePreprocessor({

@@ -1217,2 +1242,2 @@ dateModeTemplate,

export { maskitoDateOptionsGenerator, maskitoDateRangeOptionsGenerator, maskitoDateTimeOptionsGenerator, maskitoNumberOptionsGenerator, maskitoParseNumber, maskitoTimeOptionsGenerator };
export { maskitoDateOptionsGenerator, maskitoDateRangeOptionsGenerator, maskitoDateTimeOptionsGenerator, maskitoNumberOptionsGenerator, maskitoParseNumber, maskitoPrefixPostprocessorGenerator, maskitoTimeOptionsGenerator };

@@ -375,2 +375,27 @@ (function (global, factory) {

function maskitoPrefixPostprocessorGenerator(prefix) {
return function (_a, initialElementState) {
var value = _a.value,
selection = _a.selection;
var minCaretIndex = prefix.length;
if (value.length < minCaretIndex && initialElementState.value) {
return {
selection: [minCaretIndex, minCaretIndex],
value: prefix
};
}
var from = selection[0],
to = selection[1];
return value.length && !value.startsWith(prefix) ? {
selection: [from + prefix.length, to + prefix.length],
value: prefix + value
} : {
selection: selection,
value: value
};
};
}
function createValidDatePreprocessor(_a) {

@@ -1359,2 +1384,3 @@ var dateModeTemplate = _a.dateModeTemplate,

exports.maskitoParseNumber = maskitoParseNumber;
exports.maskitoPrefixPostprocessorGenerator = maskitoPrefixPostprocessorGenerator;
exports.maskitoTimeOptionsGenerator = maskitoTimeOptionsGenerator;

@@ -1361,0 +1387,0 @@

export { createMinMaxDatePostprocessor } from './min-max-date-postprocessor';
export { maskitoPrefixPostprocessorGenerator } from './prefix-postprocessor';
export { createValidDatePreprocessor } from './valid-date-preprocessor';
export { createZeroPlaceholdersPreprocessor } from './zero-placeholders-preprocessor';
//# sourceMappingURL=index.d.ts.map

4

package.json
{
"name": "@maskito/kit",
"version": "0.8.1",
"version": "0.9.0",
"description": "The optional framework-agnostic Maskito's package with ready-to-use masks",

@@ -33,3 +33,3 @@ "keywords": [

"peerDependencies": {
"@maskito/core": "^0.8.1"
"@maskito/core": "^0.9.0"
},

@@ -36,0 +36,0 @@ "main": "./index.umd.js",

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