Skip to content

Adds option for recursively allowing additional props#1

Merged
andywer merged 1 commit into
andywer:masterfrom
segphault:allow-additional-recursive
Jan 12, 2022
Merged

Adds option for recursively allowing additional props#1
andywer merged 1 commit into
andywer:masterfrom
segphault:allow-additional-recursive

Conversation

@segphault
Copy link
Copy Markdown
Contributor

@segphault segphault commented Jan 12, 2022

This PR adds an option for recursively applying allowAdditionalProps, effectively making it possible to match on an object subset without having to splat any() on every single nested object.

Example:

assert.deepEquals(
  {foo: {bar: "baz", extra: true}, extra: true},
  {foo: {bar: "baz"}},
  {allowAdditionalProps: true})

I realize that this library hasn't been updated in awhile, so no worries if you aren't interested in accepting this. Feel free to close, I'm happy to just make a fork if that's easier.

@andywer
Copy link
Copy Markdown
Owner

andywer commented Jan 12, 2022

Hey @segphault, thanks for contributing!

Yeah, I guess that makes sense 👍

@andywer andywer merged commit 641d316 into andywer:master Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants