main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
656 bytes
|
Rev | Line | |
---|
[d565449] | 1 | import LazyWrapper from './_LazyWrapper.js';
|
---|
| 2 | import LodashWrapper from './_LodashWrapper.js';
|
---|
| 3 | import copyArray from './_copyArray.js';
|
---|
| 4 |
|
---|
| 5 | /**
|
---|
| 6 | * Creates a clone of `wrapper`.
|
---|
| 7 | *
|
---|
| 8 | * @private
|
---|
| 9 | * @param {Object} wrapper The wrapper to clone.
|
---|
| 10 | * @returns {Object} Returns the cloned wrapper.
|
---|
| 11 | */
|
---|
| 12 | function wrapperClone(wrapper) {
|
---|
| 13 | if (wrapper instanceof LazyWrapper) {
|
---|
| 14 | return wrapper.clone();
|
---|
| 15 | }
|
---|
| 16 | var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
|
---|
| 17 | result.__actions__ = copyArray(wrapper.__actions__);
|
---|
| 18 | result.__index__ = wrapper.__index__;
|
---|
| 19 | result.__values__ = wrapper.__values__;
|
---|
| 20 | return result;
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | export default wrapperClone;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.