Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Added check that options is an object #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added check that options is an object #30

wants to merge 1 commit into from

Conversation

rhinoceraptor
Copy link

The motivation for this is that humps' functions may be used as a callback in a map, forEach (or similar), and if the second argument is not an object, the 'process' in options ? ... check will throw an error.

@domchristie
Copy link
Owner

Thanks for this. In this case, is there any harm in a wrapping the converter in a function?

@rhinoceraptor
Copy link
Author

Do you mean the difference between these two?

myArray.map(humps.camelize)

vs

myArray.map(i => humps.camelize(i))

If so, the only real reason is syntactic convenience.

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.

2 participants