index.js 863 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * lodash 3.0.0 (Custom Build) <https://lodash.com/>
  3. * Build: `lodash modern modularize exports="npm" -o ./`
  4. * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
  5. * Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE>
  6. * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  7. * Available under MIT license <https://lodash.com/license>
  8. */
  9. /**
  10. * Copies the values of `source` to `array`.
  11. *
  12. * @private
  13. * @param {Array} source The array to copy values from.
  14. * @param {Array} [array=[]] The array to copy values to.
  15. * @returns {Array} Returns `array`.
  16. */
  17. function arrayCopy(source, array) {
  18. var index = -1,
  19. length = source.length;
  20. array || (array = Array(length));
  21. while (++index < length) {
  22. array[index] = source[index];
  23. }
  24. return array;
  25. }
  26. module.exports = arrayCopy;