<commit_before>(function (factory) {
    if (typeof exports === 'object') {
        // Node/CommonJS
        factory(require('jquery'), require('underscore'));
    } else {
        // Browser globals
        factory(jQuery, _);
    }
}(function ($, _) {

  function addChar(position, maskChar) {
    return function(char){
      return function(string){
        if(string.length === position && char !== maskChar){
          string = (string + maskChar);
        }
        return string;
      };
    };
  }

  function readMaskDefinition(maskChars){
    return function(maskDefinition){
      return _.compact(_.map(maskDefinition, function(letter, index){
        return (maskChars.indexOf(letter) >= 0 ? null : [index, letter]);
      }));
    };
  }

  function applyMask(maskFunctions){
    return function(string, newChar){
      var addNewCharFunctions = _.map(maskFunctions, function(el){ return el(newChar); });
      var applyMaskFunctions = _.reduce(addNewCharFunctions, function(memo, f){ 
        return (_.isFunction(memo) ? _.compose(f, memo) : f); 
      });
      return applyMaskFunctions(string);
    }
  }

  // On key press
  //applyMask(addMaskFunctions, 'tes', 't');

  $.fixedMask = {
    maskChars: '9A'
  };
  $.fixedMask.readMask = readMaskDefinition($.fixedMask.maskChars);
    
  $.fn.extend({
    fixedMask: function(mask, settings){
      return this.each(function() {
        // Store array of mask functions in element data
        var input = $(this);
        var addMaskFunctions = _.map($.fixedMask.readMask(mask || input.data('fixed-mask')), function(maskChar){ return addChar(maskChar[0], maskChar[1]); });
        input.data('applyMask', applyMask(addMaskFunctions));
        input.keypress(function(event){<commit_msg>fixing lint warning messages<commit_after>(function (factory) {
    if (typeof exports === 'object') {
        // Node/CommonJS
        factory(require('jquery'), require('underscore'));
    } else {
        // Browser globals
        factory(jQuery, _);
    }
}(function ($, _) {

  function addChar(position, maskChar) {
    return function(char){
      return function(string){
        if(string.length === position && char !== maskChar){
          string = (string + maskChar);
        }
        return string;
      };
    };
  }

  function readMaskDefinition(maskChars){
    return function(maskDefinition){
      return _.compact(_.map(maskDefinition, function(letter, index){
        return (maskChars.indexOf(letter) >= 0 ? null : [index, letter]);
      }));
    };
  }

  function applyMask(maskFunctions){
    return function(string, newChar){
      var addNewCharFunctions = _.map(maskFunctions, function(el){ return el(newChar); });
      var applyMaskFunctions = _.reduce(addNewCharFunctions, function(memo, f){ 
        return (_.isFunction(memo) ? _.compose(f, memo) : f); 
      });
      return applyMaskFunctions(string);
    };
  }

  // On key press
  //applyMask(addMaskFunctions, 'tes', 't');

  $.fixedMask = {
    maskChars: '9A'
  };
  $.fixedMask.readMask = readMaskDefinition($.fixedMask.maskChars);
    
  $.fn.extend({
    fixedMask: function(mask){
      return this.each(function() {
        // Store array of mask functions in element data
        var input = $(this);
        var addMaskFunctions = _.map($.fixedMask.readMask(mask || input.data('fixed-mask')), function(maskChar){ return addChar(maskChar[0], maskChar[1]); });
        input.data('applyMask', applyMask(addMaskFunctions));
        input.keypress(function(event){
{'fraction_non_alphanumeric': 0.14877910278250994, 'fraction_numerical': 0.002271436683702442, 'mean_word_length': 2.971815107102593, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1324066', 'n_tokens_mistral': 1034, 'n_tokens_neox': 1005, 'n_words': 213}