Skip to content

migrate http-assert to another deep equality library #16

Open

Description

@43081j

http-assert can be found here:
https://github.com/jshttp/http-assert

This package is depended on by koa:
https://github.com/koajs/koa/blob/5f159415e58c42b54cb0703d7cfb10870d33d65f/package.json#L50

deep-equal has 18 dependencies, it should be possible to move to a lighter library.

Some options are:

Activity

  1. mehulkar commented on Jan 29, 2024

    @mehulkar

    Test suite passes, but no idea if that's enough for this jshttp/http-assert#15

  2. 43081j commented on Jan 29, 2024

    @43081j
    CollaboratorAuthor

    awesome work @mehulkar , if you need any help along the way do feel free to pull me into an issue/pr

    looks like they want to maintain deep loose equality.

    it would basically mean something like equal({a: null}, {a: undefined}) would be true if we did it non-strict.

    deep-eql does let you pass a custom comparator, something like:

    deepEqual(left, right, {
      comparator: (a, b) => {
        if(typeof a === 'object' || typeof b === 'object') {
          return null; // this tells deep-eql to carry on using default behaviour
        }
        return a == b;
      }
    });

    maybe we could do this inside http-assert.

    some day i could talk to the other chai maintainers about having a loose equality comparator built in too maybe.

  3. added
    has issueAn issue for contact or tracking was created in the target repository
    blockedThis issue should be checked regurlarly if the condition to unblock it is met
    and removed
    help wantedExtra attention is needed
    on Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedThis issue should be checked regurlarly if the condition to unblock it is methas issueAn issue for contact or tracking was created in the target repository

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions