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 typo #375

Merged
merged 1 commit into from
May 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/convict/MIGRATING_FROM_CONVICT_5_TO_6.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ New post-`[email protected]` code:
const convict = require('convict')
const convict_format_with_validator = require('convict-format-with-validator')
const convict_format_with_moment = require('convict-format-with-moment')
const json5 = require('json5')
const JSON5 = require('json5')

// Use this only if you use the "email", "ipaddress" or "url" format
convict.addFormats(convict_format_with_validator)
Expand All @@ -32,7 +32,7 @@ convict.addFormats(convict_format_with_moment)

// Use this only if you have a .json configuration file in JSON5 format
// (i.e. with comments, etc.).
convict.addParser({extension: 'json', parse: JSON.parse})
convict.addParser({extension: 'json', parse: JSON5.parse})
Copy link
Contributor

Choose a reason for hiding this comment

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

@madarche are you sure this isn’t a typo? Using the native JSON.parse on json5 would throw an error here, and i believe the current json5 import from line 25 is currently unused.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@pdehaan you're right! I've mistakenly closed this PR: I've thought its aim was just to rename json5JSON5. And @xamgore sorry!


const config = convict(config_schema)
```