"use strict";exports.__esModule = true;exports.DEFINITIONS = exports.DEFAULT_MASK_CHAR = void 0;exports.getDefinitions = getDefinitions;exports.getMaskChar = getMaskChar;

var _utils = require("../../lib/utils");

var DEFAULT_MASK_CHAR = exports.DEFAULT_MASK_CHAR = '_';
var DEFINITIONS = exports.DEFINITIONS = Object.freeze({ '9': /[0-9]/, a: /[A-Za-z]/, '*': /[A-Za-z0-9]/ });

function getDefinitions(formatChars) {
  if ((0, _utils.isNonNullable)(formatChars)) {
    var chars = {};

    for (var key in formatChars) {
      chars[key] = new RegExp(formatChars[key]);
    }

    return chars;
  }

  return DEFINITIONS;
}

function getMaskChar(maskChar) {
  return !maskChar ? DEFAULT_MASK_CHAR : maskChar;
}