"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get getCodeValue () {
        return getCodeValue;
    },
    get getFieldPattern () {
        return getFieldPattern;
    },
    get getPlaceholderValue () {
        return getPlaceholderValue;
    }
});
const getFieldPattern = (allowedSymbols)=>{
    if (!allowedSymbols) {
        return null;
    }
    if (typeof allowedSymbols === 'string') {
        return new RegExp(allowedSymbols, 'g');
    }
    return allowedSymbols;
};
const getCodeValue = (codeLength, value)=>{
    if (!value.length) {
        return new Array(codeLength).fill('');
    }
    return value.slice(0, codeLength).split('');
};
const getPlaceholderValue = (codeLength, placeholder)=>{
    if (!placeholder || typeof placeholder !== 'string') {
        return null;
    }
    if (placeholder.length === 1) {
        return Array(codeLength).fill(placeholder);
    }
    return placeholder.slice(0, codeLength).split('');
};
