Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@inquirer/core

Package Overview
Dependencies
Maintainers
3
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inquirer/core - npm Package Compare versions

Comparing version 10.1.0 to 10.1.1

24

dist/commonjs/lib/create-prompt.js

@@ -38,3 +38,22 @@ "use strict";

const errors_js_1 = require("./errors.js");
function getCallSites() {
const _prepareStackTrace = Error.prepareStackTrace;
try {
let result = [];
Error.prepareStackTrace = (_, callSites) => {
const callSitesWithoutCurrent = callSites.slice(1);
result = callSitesWithoutCurrent;
return callSitesWithoutCurrent;
};
// eslint-disable-next-line @typescript-eslint/no-unused-expressions, unicorn/error-message
new Error().stack;
return result;
}
finally {
Error.prepareStackTrace = _prepareStackTrace;
}
}
function createPrompt(view) {
const callSites = getCallSites();
const callerFilename = callSites[1]?.getFileName?.();
const prompt = (config, context = {}) => {

@@ -87,2 +106,7 @@ // Default `input` to stdin

});
// Typescript won't allow this, but not all users rely on typescript.
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (nextView === undefined) {
throw new Error(`Prompt functions must return a string.\n at ${callerFilename}`);
}
const [content, bottomContent] = typeof nextView === 'string' ? [nextView] : nextView;

@@ -89,0 +113,0 @@ screen.render(content, bottomContent);

@@ -9,3 +9,22 @@ import * as readline from 'node:readline';

import { AbortPromptError, CancelPromptError, ExitPromptError } from './errors.js';
function getCallSites() {
const _prepareStackTrace = Error.prepareStackTrace;
try {
let result = [];
Error.prepareStackTrace = (_, callSites) => {
const callSitesWithoutCurrent = callSites.slice(1);
result = callSitesWithoutCurrent;
return callSitesWithoutCurrent;
};
// eslint-disable-next-line @typescript-eslint/no-unused-expressions, unicorn/error-message
new Error().stack;
return result;
}
finally {
Error.prepareStackTrace = _prepareStackTrace;
}
}
export function createPrompt(view) {
const callSites = getCallSites();
const callerFilename = callSites[1]?.getFileName?.();
const prompt = (config, context = {}) => {

@@ -58,2 +77,7 @@ // Default `input` to stdin

});
// Typescript won't allow this, but not all users rely on typescript.
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (nextView === undefined) {
throw new Error(`Prompt functions must return a string.\n at ${callerFilename}`);
}
const [content, bottomContent] = typeof nextView === 'string' ? [nextView] : nextView;

@@ -60,0 +84,0 @@ screen.render(content, bottomContent);

8

package.json
{
"name": "@inquirer/core",
"version": "10.1.0",
"version": "10.1.1",
"description": "Core Inquirer prompt API",

@@ -89,6 +89,6 @@ "keywords": [

"@arethetypeswrong/cli": "^0.17.0",
"@inquirer/testing": "^2.1.37",
"@inquirer/testing": "^2.1.38",
"@repo/tsconfig": "workspace:*",
"@types/mute-stream": "^0.0.4",
"@types/node": "^22.9.0",
"@types/node": "^22.10.1",
"@types/wrap-ansi": "^3.0.0",

@@ -112,3 +112,3 @@ "tshy": "^3.0.2"

},
"gitHead": "84e49bdb552e1cb4f035d644190913f367a66e74"
"gitHead": "5713287885155c0081fca4190c17c18c598d9602"
}

@@ -299,3 +299,3 @@ # `@inquirer/core`

The [default theme keys cover](https://github.com/SBoudrias/Inquirer.js/blob/theme/packages/core/src/lib/theme.mts):
The [default theme keys cover](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/core/src/lib/theme.ts):

@@ -325,10 +325,10 @@ ```ts

- [Confirm Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/confirm/src/index.mts)
- [Input Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/src/index.mts)
- [Password Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/password/src/index.mts)
- [Editor Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/editor/src/index.mts)
- [Select Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/select/src/index.mts)
- [Checkbox Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/checkbox/src/index.mts)
- [Rawlist Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/rawlist/src/index.mts)
- [Expand Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/expand/src/index.mts)
- [Confirm Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/confirm/src/index.ts)
- [Input Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/src/index.ts)
- [Password Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/password/src/index.ts)
- [Editor Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/editor/src/index.ts)
- [Select Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/select/src/index.ts)
- [Checkbox Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/checkbox/src/index.ts)
- [Rawlist Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/rawlist/src/index.ts)
- [Expand Prompt](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/expand/src/index.ts)

@@ -335,0 +335,0 @@ ```ts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc