@inquirer/core
Advanced tools
Comparing version 7.0.2 to 7.1.0
@@ -19,2 +19,3 @@ "use strict"; | ||
__exportStar(require('./lib/key.js'), exports); | ||
__exportStar(require('./lib/errors.js'), exports); | ||
var use_prefix_mjs_1 = require('./lib/use-prefix.js'); | ||
@@ -21,0 +22,0 @@ Object.defineProperty(exports, "usePrefix", { enumerable: true, get: function () { return use_prefix_mjs_1.usePrefix; } }); |
@@ -19,2 +19,3 @@ "use strict"; | ||
__exportStar(require('./lib/key.js'), exports); | ||
__exportStar(require('./lib/errors.js'), exports); | ||
var use_prefix_mjs_1 = require('./lib/use-prefix.js'); | ||
@@ -21,0 +22,0 @@ Object.defineProperty(exports, "usePrefix", { enumerable: true, get: function () { return use_prefix_mjs_1.usePrefix; } }); |
@@ -36,2 +36,3 @@ "use strict"; | ||
const hook_engine_mjs_1 = require('./hook-engine.js'); | ||
const errors_mjs_1 = require('./errors.js'); | ||
function createPrompt(view) { | ||
@@ -59,3 +60,3 @@ const prompt = (config, context) => { | ||
onExit(); | ||
reject(new Error(`User force closed the prompt with ${code} ${signal}`)); | ||
reject(new errors_mjs_1.ExitPromptError(`User force closed the prompt with ${code} ${signal}`)); | ||
}); | ||
@@ -83,3 +84,3 @@ function onExit() { | ||
onExit(); | ||
reject(new Error('Prompt was canceled')); | ||
reject(new errors_mjs_1.CancelPromptError()); | ||
}; | ||
@@ -86,0 +87,0 @@ function done(value) { |
@@ -5,2 +5,3 @@ "use strict"; | ||
const node_async_hooks_1 = require("node:async_hooks"); | ||
const errors_mjs_1 = require('./errors.js'); | ||
const hookStorage = new node_async_hooks_1.AsyncLocalStorage(); | ||
@@ -30,3 +31,3 @@ function createStore(rl) { | ||
if (!store) { | ||
throw new Error('[Inquirer] Hook functions can only be called from within a prompt'); | ||
throw new errors_mjs_1.HookError('[Inquirer] Hook functions can only be called from within a prompt'); | ||
} | ||
@@ -88,3 +89,3 @@ return store; | ||
if (cleanFn != null && typeof cleanFn !== 'function') { | ||
throw new Error('useEffect return value must be a cleanup function or nothing.'); | ||
throw new errors_mjs_1.ValidationError('useEffect return value must be a cleanup function or nothing.'); | ||
} | ||
@@ -91,0 +92,0 @@ store.hooksCleanup[index] = cleanFn; |
export * from './lib/key.js'; | ||
export * from './lib/errors.js'; | ||
export { usePrefix } from './lib/use-prefix.js'; | ||
@@ -3,0 +4,0 @@ export { useState } from './lib/use-state.js'; |
{ | ||
"name": "@inquirer/core", | ||
"version": "7.0.2", | ||
"version": "7.1.0", | ||
"engines": { | ||
@@ -60,5 +60,5 @@ "node": ">=18" | ||
"dependencies": { | ||
"@inquirer/type": "^1.2.0", | ||
"@inquirer/type": "^1.2.1", | ||
"@types/mute-stream": "^0.0.4", | ||
"@types/node": "^20.11.25", | ||
"@types/node": "^20.11.26", | ||
"@types/wrap-ansi": "^3.0.0", | ||
@@ -77,3 +77,3 @@ "ansi-escapes": "^4.3.2", | ||
"devDependencies": { | ||
"@inquirer/testing": "^2.1.12" | ||
"@inquirer/testing": "^2.1.13" | ||
}, | ||
@@ -83,3 +83,4 @@ "scripts": { | ||
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json", | ||
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs" | ||
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs", | ||
"attw": "attw --pack" | ||
}, | ||
@@ -101,3 +102,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "85fba2337df29f689d058a9260df163af89caa98" | ||
"gitHead": "2de191afab92c1a214dfe268c80109014803f11b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
83786
84
1639
Updated@inquirer/type@^1.2.1
Updated@types/node@^20.11.26