diff --git a/lib/types/relationship-types.js b/lib/types/relationship-types.js --- a/lib/types/relationship-types.js +++ b/lib/types/relationship-types.js @@ -83,15 +83,10 @@ | TraditionalRelationshipRequest | FarcasterRelationshipRequest; -const exactlyTwoDictEntriesValidator = t.refinement( - t.dict(t.String, t.String), - dict => Object.keys(dict).length === 2, -); - export const farcasterRelationshipRequestValidator: TInterface = tShape({ action: tString('farcaster'), - userIDsToFID: exactlyTwoDictEntriesValidator, + userIDsToFID: t.dict(t.String, t.String), }); type SharedRelationshipRow = { diff --git a/lib/types/relationship-types.test.js b/lib/types/relationship-types.test.js --- a/lib/types/relationship-types.test.js +++ b/lib/types/relationship-types.test.js @@ -3,7 +3,7 @@ import { farcasterRelationshipRequestValidator } from './relationship-types.js'; describe('updateFarcasterRelationshipInputValidator', () => { - test('SHOULD validate input with exactly 2 userIDsToFID entries', () => { + test('SHOULD validate input with 2 userIDsToFID entries', () => { const input = { action: 'farcaster', userIDsToFID: { @@ -14,28 +14,6 @@ expect(farcasterRelationshipRequestValidator.is(input)).toBe(true); }); - test('SHOULD NOT validate input with > 2 userIDsToFID entries', () => { - const input = { - action: 'farcaster', - userIDsToFID: { - '256': 'f256', - '512': 'f512', - '1024': 'f1024', - }, - }; - expect(farcasterRelationshipRequestValidator.is(input)).toBe(false); - }); - - test('SHOULD NOT validate input with < 2 userIDsToFID entries', () => { - const input = { - action: 'farcaster', - userIDsToFID: { - '256': 'f256', - }, - }; - expect(farcasterRelationshipRequestValidator.is(input)).toBe(false); - }); - test('Should not validate if action is not farcaster', () => { const input = { action: 'NOT_FARCASTER',