{"size": 948, "ext": "js", "max_stars_repo_path": "lib/swapIndex.js", "max_stars_repo_name": "dgpgdev/junctions", "max_stars_repo_stars_event_min_datetime": "2017-11-02T10:27:28.000Z", "max_stars_repo_stars_event_max_datetime": "2017-12-07T16:51:11.000Z", "max_issues_repo_path": "lib/swapIndex.js", "max_issues_repo_name": "dgpgdev/junctions", "max_issues_repo_issues_event_min_datetime": "2021-03-01T20:30:56.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-20T21:07:57.000Z", "max_forks_repo_path": "lib/swapIndex.js", "max_forks_repo_name": "dgpgdev/junctions-fp", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 27.0857142857, "max_line_length": 95, "alphanum_fraction": 0.6793248945}
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _curry = require('./curry');

var _curry2 = _interopRequireDefault(_curry);

var _equal = require('./equal');

var _equal2 = _interopRequireDefault(_equal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Interverti les items de la liste
 * @memberOf List
 * @function swapIndex
 * @param {any} a le premier item a intervertir
 * @param {any} b le deuxième item a intervertir
 * @param {array} array la liste des items a testé
 * @returns {array} un nouveau tableau
 * @instance
 * @example {@lang javascript}const items = [1, 2, 3, 4, 5, 6]
swap(3, 5, items)) // return [1, 2, 3, 6, 5, 4]
*/
var swapIndex = (0, _curry2.default)(function (aIndex, bIndex, arr) {
  var newArr = arr.splice(0);
  newArr[aIndex] = arr[bIndex];
  newArr[bIndex] = arr[aIndex];
  return newArr;
});
exports.default = swapIndex;