diff --git a/src/util/index.ts b/src/util/index.ts index dd2f840e7..0c30400d3 100644 --- a/src/util/index.ts +++ b/src/util/index.ts @@ -113,20 +113,14 @@ const passthroughPineOptionKeys = ['$top', '$skip', '$orderby'] as const; export function mergePineOptions< R extends object, TDefault extends Pine.ODataOptions, ->( - defaults: TDefault, - extras: Pine.ODataOptions | undefined, - replace$selects?: boolean, -): TDefault; +>(defaults: TDefault, extras: Pine.ODataOptions | undefined): TDefault; export function mergePineOptions( defaults: Pine.ODataOptions, extras: Pine.ODataOptions | undefined, - replace$selects?: boolean, ): Pine.ODataOptions; export function mergePineOptions( defaults: Pine.ODataOptions, extras: Pine.ODataOptions | undefined, - replace$selects?: boolean, ): Pine.ODataOptions { if (!extras) { return defaults; @@ -143,9 +137,7 @@ export function mergePineOptions( (extras.$select as '*') : [extras.$select]; - if (replace$selects) { - result.$select = extraSelect; - } else if (extraSelect === '*') { + if (extraSelect === '*') { result.$select = '*'; } else { result.$select = [ @@ -176,11 +168,7 @@ export function mergePineOptions( } if (extras.$expand != null) { - result.$expand = mergeExpandOptions( - defaults.$expand, - extras.$expand, - replace$selects, - ); + result.$expand = mergeExpandOptions(defaults.$expand, extras.$expand); } return result; @@ -189,7 +177,6 @@ export function mergePineOptions( const mergeExpandOptions = ( defaultExpand: Pine.Expand | undefined, extraExpand: Pine.Expand | undefined, - replace$selects?: boolean, ): Pine.Expand | undefined => { if (defaultExpand == null) { return extraExpand; @@ -205,7 +192,6 @@ const mergeExpandOptions = ( $defaultExpand[expandKey] = mergePineOptions( $defaultExpand[expandKey] ?? {}, $extraExpand[expandKey], - replace$selects, ); }