the editable site (validation-lab)
This commit is contained in:
commit
3ac81d5a52
13454 files changed
+2227005
No files matched your search
+25
@@ -0,0 +1,25 @@
|
||||
import prompts from "prompts";
|
||||
class PromptsPrompt {
|
||||
#force;
|
||||
constructor({ force }) {
|
||||
this.#force = force;
|
||||
}
|
||||
async confirm({
|
||||
message,
|
||||
defaultValue
|
||||
}) {
|
||||
if (this.#force) {
|
||||
return true;
|
||||
}
|
||||
const { value } = await prompts({
|
||||
type: "confirm",
|
||||
name: "value",
|
||||
message,
|
||||
initial: defaultValue
|
||||
});
|
||||
return value;
|
||||
}
|
||||
}
|
||||
export {
|
||||
PromptsPrompt
|
||||
};
|
||||
Reference in new issue
Block a user