mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Rename params of arrayCopy and baseCopy.
This commit is contained in:
committed by
jdalton
parent
29b7ca4c25
commit
f1be3df112
@@ -1393,22 +1393,22 @@
|
|||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies the values of `array` to `other`.
|
* Copies the values of `source` to `array`.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Array} array The array to copy values from.
|
* @param {Array} source The array to copy values from.
|
||||||
* @param {Array} [other=[]] The array to copy values to.
|
* @param {Array} [array=[]] The array to copy values to.
|
||||||
* @returns {Array} Returns `other`.
|
* @returns {Array} Returns `array`.
|
||||||
*/
|
*/
|
||||||
function arrayCopy(array, other) {
|
function arrayCopy(source, array) {
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = array.length;
|
length = source.length;
|
||||||
|
|
||||||
other || (other = Array(length));
|
array || (array = Array(length));
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
other[index] = array[index];
|
array[index] = source[index];
|
||||||
}
|
}
|
||||||
return other;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1721,27 +1721,27 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies the properties of `object` to `other`.
|
* Copies the properties of `source` to `object`.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Object} object The object to copy properties from.
|
* @param {Object} source The object to copy properties from.
|
||||||
* @param {Object} [other={}] The object to copy properties to.
|
* @param {Object} [object={}] The object to copy properties to.
|
||||||
* @param {Array} props The property names to copy.
|
* @param {Array} props The property names to copy.
|
||||||
* @returns {Object} Returns `other`.
|
* @returns {Object} Returns `object`.
|
||||||
*/
|
*/
|
||||||
function baseCopy(object, other, props) {
|
function baseCopy(source, object, props) {
|
||||||
if (!props) {
|
if (!props) {
|
||||||
props = other;
|
props = object;
|
||||||
other = {};
|
object = {};
|
||||||
}
|
}
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = props.length;
|
length = props.length;
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
var key = props[index];
|
var key = props[index];
|
||||||
other[key] = object[key];
|
object[key] = source[key];
|
||||||
}
|
}
|
||||||
return other;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user