@inquirer/editor
Advanced tools
Comparing version 1.2.9 to 1.2.10
@@ -11,8 +11,11 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const chalk_1 = require("chalk"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const external_editor_1 = require("external-editor"); | ||
const core_1 = require("@inquirer/core"); | ||
exports.default = (0, core_1.createPrompt)((config, done) => { | ||
const { waitForUseInput = true } = config; | ||
const { waitForUseInput = true, validate = () => true } = config; | ||
const [status, setStatus] = (0, core_1.useState)('pending'); | ||
@@ -30,3 +33,3 @@ const [value, setValue] = (0, core_1.useState)(config.default || ''); | ||
setStatus('loading'); | ||
const isValid = yield config.validate(answer); | ||
const isValid = yield validate(answer); | ||
if (isValid === true) { | ||
@@ -33,0 +36,0 @@ setError(undefined); |
@@ -11,8 +11,11 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const chalk_1 = require("chalk"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const external_editor_1 = require("external-editor"); | ||
const core_1 = require("@inquirer/core"); | ||
exports.default = (0, core_1.createPrompt)((config, done) => { | ||
const { waitForUseInput = true } = config; | ||
const { waitForUseInput = true, validate = () => true } = config; | ||
const [status, setStatus] = (0, core_1.useState)('pending'); | ||
@@ -30,3 +33,3 @@ const [value, setValue] = (0, core_1.useState)(config.default || ''); | ||
setStatus('loading'); | ||
const isValid = yield config.validate(answer); | ||
const isValid = yield validate(answer); | ||
if (isValid === true) { | ||
@@ -33,0 +36,0 @@ setError(undefined); |
@@ -1,8 +0,8 @@ | ||
import { type AsyncPromptConfig } from '@inquirer/core'; | ||
type EditorConfig = AsyncPromptConfig & { | ||
default?: string; | ||
postfix?: string; | ||
waitForUseInput?: boolean; | ||
}; | ||
declare const _default: import("@inquirer/type").Prompt<string, EditorConfig>; | ||
declare const _default: import("@inquirer/type").Prompt<string, { | ||
message: string | Promise<string> | (() => Promise<string>); | ||
default?: string | undefined; | ||
postfix?: string | undefined; | ||
waitForUseInput?: boolean | undefined; | ||
validate?: ((value: string) => string | boolean | Promise<string | boolean>) | undefined; | ||
}>; | ||
export default _default; |
{ | ||
"name": "@inquirer/editor", | ||
"version": "1.2.9", | ||
"version": "1.2.10", | ||
"description": "Inquirer multiline editor prompt", | ||
@@ -57,4 +57,4 @@ "main": "./dist/cjs/index.js", | ||
"dependencies": { | ||
"@inquirer/core": "^4.1.0", | ||
"@inquirer/type": "^1.1.3", | ||
"@inquirer/core": "^5.0.0", | ||
"@inquirer/type": "^1.1.4", | ||
"chalk": "^4.1.2", | ||
@@ -86,3 +86,3 @@ "external-editor": "^3.1.0" | ||
}, | ||
"gitHead": "f5c544a8ded1c7dfb6ac8364759955e8f2ecfb0c" | ||
"gitHead": "c2d1c5fdfd1029f78351fb04e06f1cfb29d55bb6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14898
222
+ Added@inquirer/core@5.1.2(transitive)
+ Added@types/mute-stream@0.0.4(transitive)
- Removed@inquirer/core@4.1.0(transitive)
- Removed@types/mute-stream@0.0.1(transitive)
Updated@inquirer/core@^5.0.0
Updated@inquirer/type@^1.1.4