Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix readJSON docs #103

Merged
merged 1 commit into from
Mar 31, 2018
Merged

Fix readJSON docs #103

merged 1 commit into from
Mar 31, 2018

Conversation

zcei
Copy link
Contributor

@zcei zcei commented Mar 30, 2018

Currently the docs do not match the actual behavior of the library.

readJSON never actually attempts to read a non-existent file, but guards it with an exists call:

if (this.exists(filepath)) {
try {
return JSON.parse(this.read(filepath));
} catch (error) {
throw new Error('Could not parse JSON in file: ' + filepath + '. Detail: ' + error.message);
}
} else {
return defaults;
}

@SBoudrias
Copy link
Owner

Thanks!!

@SBoudrias SBoudrias merged commit 052403e into SBoudrias:master Mar 31, 2018
@zcei zcei deleted the patch-1 branch March 31, 2018 19:11
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