%PDF- %PDF-
Direktori : /home/emergentqj/actioncivile/pre-auth/.4cc3a2e1590a4463a5f392ddcc26929e/static/node_modules/redux-form/es/structure/plain/ |
Current File : /home/emergentqj/actioncivile/pre-auth/.4cc3a2e1590a4463a5f392ddcc26929e/static/node_modules/redux-form/es/structure/plain/splice.js |
var splice = function splice(array, index, removeNum, value) { array = array || []; if (index < array.length) { if (value === undefined && !removeNum) { // inserting undefined var _copy2 = [].concat(array); _copy2.splice(index, 0, true); // temporary placeholder _copy2[index] = undefined; // set to undefined return _copy2; } if (value != null) { var _copy3 = [].concat(array); _copy3.splice(index, removeNum, value); // removing and adding return _copy3; } var _copy = [].concat(array); _copy.splice(index, removeNum); // removing return _copy; } if (removeNum) { // trying to remove non-existant item: return original array return array; } // trying to add outside of range: just set value var copy = [].concat(array); copy[index] = value; return copy; }; export default splice;