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

Bugfix/133 toggle defaults #134

Merged
merged 4 commits into from Feb 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -9,5 +9,5 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{json,yml,md}]
[*.{js,json,yml,md}]
indent_style = space
4 changes: 2 additions & 2 deletions lib/elements/toggle.js
Expand Up @@ -18,8 +18,8 @@ class TogglePrompt extends Prompt {
super(opts);
this.msg = opts.message;
this.value = !!opts.initial;
this.active = opts.active;
this.inactive = opts.inactive;
this.active = opts.active || 'on';
this.inactive = opts.inactive || 'off';
this.initialValue = this.value;
this.render();
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "prompts",
"version": "2.0.2",
"version": "2.0.3",
"description": "Lightweight, beautiful and user-friendly prompts",
"license": "MIT",
"repository": "terkelg/prompts",
Expand Down
6 changes: 3 additions & 3 deletions test/prompts.js
Expand Up @@ -51,6 +51,6 @@ test('injects', t => {
t.same(bar, { b:2, c:3 }, 'immediately handles two prompts at once');
t.same(prompt._injected, [], 'leaves behind empty internal array when exhausted');
t.end();
})
})
})
});
});
});