Skip to content
This repository was archived by the owner on Dec 19, 2022. It is now read-only.

Conversation

@ghost
Copy link

@ghost ghost commented Apr 8, 2016

s.object() currently accepts arrays. this change checks for arrays being passed in and rejects them...

i suspect this change could have a wide range of impact in the apis where it's used.. needs careful consideration

@TabDigital/ping-api

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @rprieto, @nguyenchr and @kiddkai to be potential reviewers

@rprieto
Copy link
Contributor

rprieto commented Apr 8, 2016

Great catch!

I doubt anyone is using s.object() to match arrays, but technically arrays are objects... But then again null is an object too and we don't allow null :)

I'm quite happy to reject arrays, but maybe as a major bump? Other option, two-birds-on-stone, is to tackle #39 at the same time. Then we could have

// if someone wants to fall back to the previous behaviour
s.object({with: fields, allowArrays: true})

@mehdivk
Copy link
Contributor

mehdivk commented Sep 2, 2016

+1 for #39 and this PR to not allow arrays to be considered object!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants