From 771fed80025368a7da1f593344c4a704443eca2e Mon Sep 17 00:00:00 2001 From: garrettmills Date: Tue, 5 Apr 2022 10:41:23 -0500 Subject: [PATCH] Make parameter middleware handler call collection.toArray NON-recursively --- package.json | 2 +- .../kernel/module/ExecuteResolvedRoutePreflightHTTPModule.ts | 2 +- src/util/collection/Collection.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 41e862e..a08e46b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@extollo/lib", - "version": "0.9.27", + "version": "0.9.28", "description": "The framework library that lifts up your code.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/http/kernel/module/ExecuteResolvedRoutePreflightHTTPModule.ts b/src/http/kernel/module/ExecuteResolvedRoutePreflightHTTPModule.ts index 5107ac7..dad812c 100644 --- a/src/http/kernel/module/ExecuteResolvedRoutePreflightHTTPModule.ts +++ b/src/http/kernel/module/ExecuteResolvedRoutePreflightHTTPModule.ts @@ -39,7 +39,7 @@ export class ExecuteResolvedRoutePreflightHTTPModule extends AbstractResolvedRou return unleft(resolveResult) } - route.resolvedParameters = unright(resolveResult).toArray() + route.resolvedParameters = unright(resolveResult).toArray(false) } return request diff --git a/src/util/collection/Collection.ts b/src/util/collection/Collection.ts index 18defbf..7767551 100644 --- a/src/util/collection/Collection.ts +++ b/src/util/collection/Collection.ts @@ -1294,10 +1294,10 @@ class Collection { /** * Cast the collection to an array. */ - toArray(): any[] { + toArray(recursive = true): any[] { const returns: any = [] for ( const item of this.storedItems ) { - if ( item instanceof Collection ) { + if ( recursive && item instanceof Collection ) { returns.push(item.toArray()) } else { returns.push(item)