jquery.mask.js

About this file

Please refer to Igor Escobar's documentation for jquery Mask.

Code Check Report




   46:34  error    Unexpected require()                         global-require
   77:29  error    Empty block statement                        no-empty
   96:29  error    Empty block statement                        no-empty
  136:27  warning  Method 'getRegexMask' has a complexity of 7  complexity
  231:24  warning  Method 'getMasked' has a complexity of 16    complexity
  318:17  error    Expected return with your callback function  callback-return
  319:17  error    Expected return with your callback function  callback-return
  320:17  error    Expected return with your callback function  callback-return
  416:25  warning  Function has a complexity of 7               complexity
  426:21  error    Empty block statement                        no-empty

✖ 10 problems (7 errors, 3 warnings)
                        

Documentation drawn from source code

/**
* jquery.mask.js
* @version: v1.14.0
* @author: Igor Escobar
*
*
*
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
/* jshint laxbreak: true */
/* global define */
(function (factory, jQuery, Zepto) {
  if (typeof define === 'function' && define.amd) {
}(function ($) {
  var Mask = function (el, mask, options) {
    getCaret: function () {
    setCaret: function(pos) {
    events: function() {
     .on('keydown.mask', function(e) {
     .on('paste.mask drop.mask', function() {
      setTimeout(function() {
     .on('change.mask', function(){
     .on('blur.mask', function(){
     .on('blur.mask', function() {
     .on('focus.mask', function (e) {
     .on('focusout.mask', function() {
    getRegexMask: function() {
    destroyEvents: function() {
    val: function(v) {
    getMCharsBeforeCount: function(index, onCleanVal) {
    caretPos: function (originalCaretPos, oldLength, newLength, maskDif) {
    behaviour: function(e) {
    getMasked: function(skipMaskChars, val) {
      check = function () {
      check = function () {
    callbacks: function (e) {
      callback = function(name, criteria, args) {
       if (typeof options[name] === 'function' && criteria) {
   mask = typeof mask === 'function' ? mask(p.val(), undefined, el, options) : mask;
   jMask.remove = function() {
   jMask.getCleanVal = function() {
   jMask.getMaskedVal = function(val) {
  jMask.init = function(onlyMask) {
  var HTMLAttributes = function () {
  notSameMaskObject = function(field, mask, options) {
    if (typeof mask === 'function') {
  eventSupported = function(eventName) {
    isSupported = typeof el[eventName] === 'function';
  $.fn.mask = function(mask, options) {
    maskFunction = function() {
    $.maskWatchers[selector] = setInterval(function(){
  $.fn.masked = function(val) {
  $.fn.unmask = function() {
   return this.each(function() {
  $.fn.cleanVal = function() {
  $.applyDataMask = function(selector) {
  setInterval(function() {

Source code