File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,21 @@ function isLeafNode (node) {
205
205
return false ;
206
206
}
207
207
208
+ /**
209
+ * Copies stuff.
210
+ *
211
+ * If destination is not provided and source is an object or an array, a copy is created & returned,
212
+ * otherwise the source is returned.
213
+ *
214
+ * If destination is provided, all of its properties will be deleted and if source is an object or
215
+ * an array, all of its members will be copied into the destination object. Finally the destination
216
+ * is returned just for kicks.
217
+ *
218
+ * @param {* } source The source to be used during copy.
219
+ * Can be any type including primitives, null and undefined.
220
+ * @param {(Object|Array)= } destination Optional destination into which the source is copied
221
+ * @return {* }
222
+ */
208
223
function copy ( source , destination ) {
209
224
if ( ! destination ) {
210
225
if ( source ) {
You can’t perform that action at this time.
0 commit comments