|
|
@ -1294,10 +1294,10 @@ class Collection<T> {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Cast the collection to an array.
|
|
|
|
* Cast the collection to an array.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
toArray(): any[] {
|
|
|
|
toArray(recursive = true): any[] {
|
|
|
|
const returns: any = []
|
|
|
|
const returns: any = []
|
|
|
|
for ( const item of this.storedItems ) {
|
|
|
|
for ( const item of this.storedItems ) {
|
|
|
|
if ( item instanceof Collection ) {
|
|
|
|
if ( recursive && item instanceof Collection ) {
|
|
|
|
returns.push(item.toArray())
|
|
|
|
returns.push(item.toArray())
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
returns.push(item)
|
|
|
|
returns.push(item)
|
|
|
|