Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Made paths accept null #247

Closed
wants to merge 1 commit into from
Closed

Made paths accept null #247

wants to merge 1 commit into from

Conversation

scriptcoded
Copy link

What: Made paths accept null as value instead of an empty array.

Why: See #238

How: Removed options.paths default to []. Also added a check for paths == null

Checklist:

  • Documentation (Not done. At further though this might be necessary though. I'd like your opinion)
  • Tests
  • Ready to be merged
  • Added myself to contributors table (Shouldn't this be done though All Contributors Bot?)

@@ -35,7 +35,7 @@ export default function(options, storage, key) {
}

function reducer(state, paths) {
return paths.length === 0
return paths === null || paths === undefined
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about !Array.isArray(path) instead of checking both null and undefined?

@robinvdvleuten
Copy link
Owner

Maybe it is a good idea to add a note to the paths option in the README about this check?

@scriptcoded
Copy link
Author

Sorry for letting this dangle. Totally fell between my fingers. Glad you implemented it, thank you.

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.

None yet

2 participants