<commit_before>/**
* Module that contains interaction helpers for JSAV.
* Depends on core.js, anim.js
*/
(function($) {
  "use strict";
  var parseValueEffectParameters = function() {
    // parse the passed arguments
    // possibilities are:
    //  - array, ind, array, ind
    //  - array, ind, node
    //  - node, array, ind
    //  - node, node
    var params = {
        args1: [],
        args2: [],
        from: arguments[0] // first param is always 1st structure
    };
    if (arguments.length === 2) { // two nodes passed
      params.to = arguments[1];
    } else if (arguments.length === 4) { // case of two arrays
      params.args1 = [ arguments[1] ];
      params.to = arguments[2];
      params.args2 = [ arguments[3] ];
    } else { // one array, one node
      if (typeof arguments[1] === "object") { // second param not number or string
        params.to = arguments[1];
        params.args2 = [ arguments[2] ];
      } else { // 2nd param is an index
        params.args1 = [ arguments[1] ];
        params.to = arguments[2];
      }
    }
    return params;
  };
  var doValueEffect = function(opts) {
    // get the values of the from and to elements
    var from = opts.from, // cache the values
        to = opts.to,
        val = from.value.apply(from, opts.args1),
        oldValue = to.value.apply(to, opts.args2),
        $fromValElem, $toValElem, toPos;
    // set the value in original structure to empty string or, if undoing, the old value
    if (opts.mode === "swap") {
      from.value.apply(from, opts.args1.concat([ oldValue, {record: false} ]));
    } else if (opts.mode === "move" || typeof opts.old !== "undefined") {<commit_msg>Fixed a bug in the swap/move effects argument parsing<commit_after>/**
* Module that contains interaction helpers for JSAV.
* Depends on core.js, anim.js
*/
(function($) {
  "use strict";
  var parseValueEffectParameters = function() {
    // parse the passed arguments
    // possibilities are:
    //  - array, ind, array, ind
    //  - array, ind, node
    //  - node, array, ind
    //  - node, node
    var params = { args1: [],
                   args2: [],
                   from: arguments[0] // first param is always 1st structure
                 };
    var secondstrPos = 1;
    if (typeof arguments[1] === "number") { // array index
      params.args1 = [ arguments[1] ];
      secondstrPos = 2; // 2nd structure will be at arg index 2
    }
    params.to = arguments[secondstrPos];
    if (typeof arguments[secondstrPos + 1] === "number") { // array index
      params.args2 = [ arguments[secondstrPos + 1] ];
    }
    return params;
  };
  var doValueEffect = function(opts) {
    // get the values of the from and to elements
    var from = opts.from, // cache the values
        to = opts.to,
        val = from.value.apply(from, opts.args1),
        oldValue = to.value.apply(to, opts.args2),
        $fromValElem, $toValElem, toPos;
    // set the value in original structure to empty string or, if undoing, the old value
    if (opts.mode === "swap") {
      from.value.apply(from, opts.args1.concat([ oldValue, {record: false} ]));
    } else if (opts.mode === "move" || typeof opts.old !== "undefined") {
{'fraction_non_alphanumeric': 0.140625, 'fraction_numerical': 0.0125, 'mean_word_length': 2.266326530612245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3571953', 'n_tokens_mistral': 983, 'n_tokens_neox': 966, 'n_words': 310}