diff --git a/src/util/index.ts b/src/util/index.ts index e4f9e6d33..dd2f840e7 100644 --- a/src/util/index.ts +++ b/src/util/index.ts @@ -99,15 +99,6 @@ export type ExtendedPineTypedResult< > = TBaseResult & IfDefined>; -const knownPineOptionKeys = new Set([ - '$top', - '$skip', - '$select', - '$expand', - '$filter', - '$orderby', -]); - const passthroughPineOptionKeys = ['$top', '$skip', '$orderby'] as const; // Merging two sets of pine options sensibly is more complicated than it sounds. @@ -141,14 +132,6 @@ export function mergePineOptions( return defaults; } - // TOOD: Consider dropping in the next major - const unknownPineOption = Object.keys(extras).find( - (key) => !knownPineOptionKeys.has(key), - ); - if (unknownPineOption != null) { - throw new Error(`Unknown pine option: ${unknownPineOption}`); - } - const result = { ...defaults }; if (extras.$select != null) { @@ -257,21 +240,6 @@ const convertExpandToObject = ( ); } - // Check the options in this object are the ones we know how to merge - for (const expandKey of Object.keys(expandOption) as Array< - keyof typeof expandOption - >) { - const expandRelationshipOptions = expandOption[expandKey]; - - // TOOD: Consider dropping in the next major - const unknownPineOption = Object.keys(expandRelationshipOptions ?? {}).find( - (key) => !knownPineOptionKeys.has(key), - ); - if (unknownPineOption != null) { - throw new Error(`Unknown pine expand options: ${unknownPineOption}`); - } - } - if (cloneIfNeeded) { return { ...expandOption }; } diff --git a/tests/util.spec.ts b/tests/util.spec.ts index 6b04e464e..6d9526aa9 100644 --- a/tests/util.spec.ts +++ b/tests/util.spec.ts @@ -240,13 +240,6 @@ describe('Pine option merging', function () { }); }); - it('rejects any unknown extra options', () => { - // @ts-expect-error b/c it's not typed - expect(() => mergePineOptions({}, { unknownKey: 'value' })).to.throw( - 'Unknown pine option: unknownKey', - ); - }); - it('ignores any unknown default options', () => { // @ts-expect-error b/c it's not typed expect(() => mergePineOptions({ unknownKey: 'value' }, {})).not.to.throw();