Socket
Socket
Sign inDemoInstall

@inquirer/core

Package Overview
Dependencies
22
Maintainers
0
Versions
69
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.2.3 to 8.2.4

3

dist/cjs/lib/create-prompt.js

@@ -29,3 +29,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createPrompt = void 0;
exports.createPrompt = createPrompt;
const readline = __importStar(require("node:readline"));

@@ -120,2 +120,1 @@ const type_1 = require("@inquirer/type");

}
exports.createPrompt = createPrompt;
"use strict";
/* eslint @typescript-eslint/no-explicit-any: ["off"] */
Object.defineProperty(exports, "__esModule", { value: true });
exports.effectScheduler = exports.handleChange = exports.withPointer = exports.withUpdates = exports.readline = exports.withHooks = void 0;
exports.effectScheduler = void 0;
exports.withHooks = withHooks;
exports.readline = readline;
exports.withUpdates = withUpdates;
exports.withPointer = withPointer;
exports.handleChange = handleChange;
const node_async_hooks_1 = require("node:async_hooks");

@@ -26,3 +31,2 @@ const errors_mjs_1 = require('./errors.js');

}
exports.withHooks = withHooks;
// Safe getStore utility that'll return the store or throw if undefined.

@@ -39,3 +43,2 @@ function getStore() {

}
exports.readline = readline;
// Merge state updates happening within the callback function to avoid multiple renders.

@@ -59,3 +62,2 @@ function withUpdates(fn) {

}
exports.withUpdates = withUpdates;
function withPointer(cb) {

@@ -77,7 +79,5 @@ const store = getStore();

}
exports.withPointer = withPointer;
function handleChange() {
getStore().handleChange();
}
exports.handleChange = handleChange;
exports.effectScheduler = {

@@ -84,0 +84,0 @@ queue(cb) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeTheme = void 0;
exports.makeTheme = makeTheme;
const theme_mjs_1 = require('./theme.js');

@@ -34,2 +34,1 @@ function isPlainObject(value) {

}
exports.makeTheme = makeTheme;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.lines = void 0;
exports.lines = lines;
const utils_mjs_1 = require('../utils.js');

@@ -63,2 +63,1 @@ function split(content, width) {

}
exports.lines = lines;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.infinite = exports.finite = void 0;
exports.finite = finite;
exports.infinite = infinite;
/**

@@ -16,3 +17,2 @@ * Creates the next position for the active item considering a finite list of

}
exports.finite = finite;
/**

@@ -33,2 +33,1 @@ * Creates the next position for the active item considering an infinitely

}
exports.infinite = infinite;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.usePagination = void 0;
exports.usePagination = usePagination;
const use_ref_mjs_1 = require('../use-ref.js');

@@ -34,2 +34,1 @@ const utils_mjs_1 = require('../utils.js');

}
exports.usePagination = usePagination;

@@ -7,3 +7,3 @@ "use strict";

exports.Separator = void 0;
const chalk_1 = __importDefault(require("chalk"));
const picocolors_1 = __importDefault(require("picocolors"));
const figures_1 = __importDefault(require("@inquirer/figures"));

@@ -20,3 +20,3 @@ /**

writable: true,
value: chalk_1.default.dim(Array.from({ length: 15 }).join(figures_1.default.line))
value: picocolors_1.default.dim(Array.from({ length: 15 }).join(figures_1.default.line))
});

@@ -23,0 +23,0 @@ Object.defineProperty(this, "type", {

@@ -7,19 +7,19 @@ "use strict";

exports.defaultTheme = void 0;
const chalk_1 = __importDefault(require("chalk"));
const picocolors_1 = __importDefault(require("picocolors"));
const cli_spinners_1 = __importDefault(require("cli-spinners"));
exports.defaultTheme = {
prefix: chalk_1.default.green('?'),
prefix: picocolors_1.default.green('?'),
spinner: {
interval: cli_spinners_1.default.dots.interval,
frames: cli_spinners_1.default.dots.frames.map((frame) => chalk_1.default.yellow(frame)),
frames: cli_spinners_1.default.dots.frames.map((frame) => picocolors_1.default.yellow(frame)),
},
style: {
answer: chalk_1.default.cyan,
message: chalk_1.default.bold,
error: (text) => chalk_1.default.red(`> ${text}`),
defaultAnswer: (text) => chalk_1.default.dim(`(${text})`),
help: chalk_1.default.dim,
highlight: chalk_1.default.cyan,
key: (text) => chalk_1.default.cyan.bold(`<${text}>`),
answer: picocolors_1.default.cyan,
message: picocolors_1.default.bold,
error: (text) => picocolors_1.default.red(`> ${text}`),
defaultAnswer: (text) => picocolors_1.default.dim(`(${text})`),
help: picocolors_1.default.dim,
highlight: picocolors_1.default.cyan,
key: (text) => picocolors_1.default.cyan(picocolors_1.default.bold(`<${text}>`)),
},
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useEffect = void 0;
exports.useEffect = useEffect;
const hook_engine_mjs_1 = require('./hook-engine.js');

@@ -15,2 +15,1 @@ function useEffect(cb, depArray) {

}
exports.useEffect = useEffect;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useKeypress = void 0;
exports.useKeypress = useKeypress;
const use_ref_mjs_1 = require('./use-ref.js');

@@ -20,2 +20,1 @@ const use_effect_mjs_1 = require('./use-effect.js');

}
exports.useKeypress = useKeypress;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useMemo = void 0;
exports.useMemo = useMemo;
const hook_engine_mjs_1 = require('./hook-engine.js');

@@ -18,2 +18,1 @@ function useMemo(fn, dependencies) {

}
exports.useMemo = useMemo;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.usePrefix = void 0;
exports.usePrefix = usePrefix;
const node_async_hooks_1 = require("node:async_hooks");

@@ -38,2 +38,1 @@ const use_state_mjs_1 = require('./use-state.js');

}
exports.usePrefix = usePrefix;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useRef = void 0;
exports.useRef = useRef;
const use_state_mjs_1 = require('./use-state.js');

@@ -8,2 +8,1 @@ function useRef(val) {

}
exports.useRef = useRef;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useState = void 0;
exports.useState = useState;
const hook_engine_mjs_1 = require('./hook-engine.js');

@@ -23,2 +23,1 @@ function useState(defaultValue) {

}
exports.useState = useState;

@@ -6,3 +6,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.readlineWidth = exports.breakLines = void 0;
exports.breakLines = breakLines;
exports.readlineWidth = readlineWidth;
const cli_width_1 = __importDefault(require("cli-width"));

@@ -26,3 +27,2 @@ const wrap_ansi_1 = __importDefault(require("wrap-ansi"));

}
exports.breakLines = breakLines;
/**

@@ -35,2 +35,1 @@ * Returns the width of the active readline, or 80 as default value.

}
exports.readlineWidth = readlineWidth;

@@ -15,3 +15,3 @@ import { type Prettify } from '@inquirer/type';

export declare function lines<T>({ items, width, renderItem, active, position: requested, pageSize, }: {
items: readonly T[];
items: ReadonlyArray<T>;
/** The width of a rendered line in characters. */

@@ -18,0 +18,0 @@ width: number;

@@ -5,3 +5,3 @@ import type { Prettify } from '@inquirer/type';

export declare function usePagination<T>({ items, active, renderItem, pageSize, loop, }: {
items: readonly T[];
items: ReadonlyArray<T>;
/** The index of the active item. */

@@ -8,0 +8,0 @@ active: number;

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import * as readline from 'node:readline';

@@ -4,0 +2,0 @@ import MuteStream from 'mute-stream';

import type { InquirerReadline } from './read-line.type.js';
export declare function useEffect(cb: (rl: InquirerReadline) => void | (() => void), depArray: unknown[]): void;
export declare function useEffect(cb: (rl: InquirerReadline) => void | (() => void), depArray: ReadonlyArray<unknown>): void;

@@ -1,1 +0,1 @@

export declare function useMemo<Value>(fn: () => Value, dependencies: unknown[]): Value;
export declare function useMemo<Value>(fn: () => Value, dependencies: ReadonlyArray<unknown>): Value;
{
"name": "@inquirer/core",
"version": "8.2.3",
"version": "8.2.4",
"engines": {

@@ -63,9 +63,9 @@ "node": ">=18"

"@types/mute-stream": "^0.0.4",
"@types/node": "^20.14.6",
"@types/node": "^20.14.9",
"@types/wrap-ansi": "^3.0.0",
"ansi-escapes": "^4.3.2",
"chalk": "^4.1.2",
"cli-spinners": "^2.9.2",
"cli-width": "^4.1.0",
"mute-stream": "^1.0.0",
"picocolors": "^1.0.1",
"signal-exit": "^4.1.0",

@@ -76,3 +76,3 @@ "strip-ansi": "^6.0.1",

"devDependencies": {
"@inquirer/testing": "^2.1.22"
"@inquirer/testing": "^2.1.23"
},

@@ -102,3 +102,3 @@ "scripts": {

"sideEffects": false,
"gitHead": "cc52a353abb1b7f3b3dc81b9e6da7ed478099dbf"
"gitHead": "d5f62c6ee3e671f7d1b776b85d43781869d70918"
}

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

```ts
import chalk from 'chalk';
import pc from 'picocolors';
import {

@@ -48,8 +48,8 @@ createPrompt,

if (status === 'done') {
formattedValue = chalk.cyan(value);
formattedValue = pc.cyan(value);
} else {
defaultValue = chalk.dim(config.default === false ? ' (y/N)' : ' (Y/n)');
defaultValue = pc.dim(config.default === false ? ' (y/N)' : ' (Y/n)');
}
const message = chalk.bold(config.message);
const message = pc.bold(config.message);
return `${prefix} ${message}${defaultValue} ${formattedValue}`;

@@ -56,0 +56,0 @@ },

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

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc