Skip to content

Types: patch return type doesn't include the possibility of undefined #82

@ArthurHoaro

Description

@ArthurHoaro

Small TypeScript typing issue: resouce.patch() is typed to return a resource, while it can return undefined if nothing was updated.

Expected Behavior

Return type of resource.patch(...) is <resource> | undefined.

Actual Behavior

Return type of resource.patch(...) is <resource>.

Steps To Reproduce

In a TS project, call

  import { default as SCIMMY, type Messages } from 'scimmy';

  const user = await new SCIMMY.Resources.User().patch(
    {} as unknown as Messages.PatchOp,
    context,
  );

and check user type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions