-
Notifications
You must be signed in to change notification settings - Fork 65
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
Conversation
|
||
return envObj[name] | ||
}, | ||
|
||
set(name) { | ||
set(target, name) { |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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)
There was a problem hiding this 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 :)
This looks good! I just need to take it for a spin tonight before merging |
lib/strictProxy.js
Outdated
const meant = require('meant') | ||
|
||
|
||
function didYouMean(scmd, commands) { |
There was a problem hiding this comment.
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
@af rebased and made into arrow |
👍 👍 |
Closes #45
meant
is not widely used, but it was just merged intonpm
(npm/npm#10382), so no worries using it IMO.