Functor
Functor copied to clipboard
Changed `maybe`'s handling of an empty object
The current implementation throws an error if config doesn't have the key or the path is wrong:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received an instance of Object
The reason is that an empty object passed from fp.path is regarded as a truthy value and readFile is called, while expected to be silently ommited.
Added isJust check to handle empty object cases.