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

Add hints in strict mode #50

Merged
merged 3 commits into from
Aug 25, 2017
Merged

Add hints in strict mode #50

merged 3 commits into from
Aug 25, 2017

Conversation

SimenB
Copy link
Collaborator

@SimenB SimenB commented Aug 23, 2017

Closes #45

meant is not widely used, but it was just merged into npm (npm/npm#10382), so no worries using it IMO.

@SimenB SimenB requested a review from af August 23, 2017 06:32

return envObj[name]
},

set(name) {
set(target, name) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this was a bug fixed in the first commit

@@ -50,6 +50,20 @@ test('strict mode objects throw when attempting to mutate', () => {
const env = cleanEnv({ FOO: 'bar', BAZ: 'baz' }, {
FOO: str()
}, strictOption)
assert.throws(() => env.FOO = 'foooooo')
assert.throws(() => env.FOO = 'foooooo', '[envalid] Attempt to mutate environment value: FOO')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the bugfix (printed [object Object] before)

Copy link

@watilde watilde left a comment

Choose a reason for hiding this comment

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

LGTM at how meant API is used :)

@af
Copy link
Owner

af commented Aug 23, 2017

This looks good! I just need to take it for a spin tonight before merging

const meant = require('meant')


function didYouMean(scmd, commands) {
Copy link
Owner

Choose a reason for hiding this comment

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

Minor point, but it'd be nice to use an arrow function here since most of the rest of the module uses them

@SimenB
Copy link
Collaborator Author

SimenB commented Aug 24, 2017

@af rebased and made into arrow

@af af merged commit 580bb99 into af:master Aug 25, 2017
@af
Copy link
Owner

af commented Aug 25, 2017

👍 👍

@SimenB SimenB deleted the did-you-mean branch August 25, 2017 19:13
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.

3 participants