@inquirer/core
Advanced tools
Comparing version 8.0.1 to 8.1.0
@@ -67,4 +67,4 @@ "use strict"; | ||
} | ||
catch (err) { | ||
reject(err); | ||
catch (error) { | ||
reject(error); | ||
} | ||
@@ -102,5 +102,5 @@ if (context === null || context === void 0 ? void 0 : context.clearPromptOnDone) { | ||
} | ||
catch (err) { | ||
catch (error) { | ||
onExit(); | ||
reject(err); | ||
reject(error); | ||
} | ||
@@ -107,0 +107,0 @@ } |
"use strict"; | ||
/* eslint @typescript-eslint/no-explicit-any: ["off"] */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +4,0 @@ exports.effectScheduler = exports.handleChange = exports.withPointer = exports.withUpdates = exports.readline = exports.withHooks = void 0; |
@@ -16,3 +16,3 @@ "use strict"; | ||
const offset = ((count % max) + max) % max; | ||
return items.slice(offset).concat(items.slice(0, offset)); | ||
return [...items.slice(offset), ...items.slice(0, offset)]; | ||
} | ||
@@ -34,3 +34,3 @@ /** | ||
// Create a blank array of lines for the page | ||
const pageBuffer = new Array(pageSize); | ||
const pageBuffer = Array.from({ length: pageSize }); | ||
// Render the active item to decide the position | ||
@@ -37,0 +37,0 @@ const activeItem = renderItemAt(requested).slice(0, pageSize); |
@@ -51,3 +51,3 @@ "use strict"; | ||
let prompt = rawPromptLine; | ||
if (this.rl.line.length) { | ||
if (this.rl.line.length > 0) { | ||
prompt = prompt.slice(0, -this.rl.line.length); | ||
@@ -54,0 +54,0 @@ } |
@@ -19,3 +19,3 @@ "use strict"; | ||
writable: true, | ||
value: chalk_1.default.dim(new Array(15).join(figures_1.default.line)) | ||
value: chalk_1.default.dim(Array.from({ length: 15 }).join(figures_1.default.line)) | ||
}); | ||
@@ -22,0 +22,0 @@ Object.defineProperty(this, "type", { |
import type { Prettify, PartialDeep } from '@inquirer/type'; | ||
import { type Theme } from './theme.js'; | ||
export declare function makeTheme<SpecificTheme extends {}>(...themes: ReadonlyArray<undefined | PartialDeep<Theme<SpecificTheme>>>): Prettify<Theme<SpecificTheme>>; | ||
export declare function makeTheme<SpecificTheme extends object>(...themes: ReadonlyArray<undefined | PartialDeep<Theme<SpecificTheme>>>): Prettify<Theme<SpecificTheme>>; |
@@ -18,4 +18,4 @@ import type { Prettify } from '@inquirer/type'; | ||
}; | ||
export type Theme<Extension extends {} = {}> = Prettify<Extension & DefaultTheme>; | ||
export type Theme<Extension extends object = object> = Prettify<Extension & DefaultTheme>; | ||
export declare const defaultTheme: DefaultTheme; | ||
export {}; |
export declare function useRef<Value>(val: Value): { | ||
current: Value; | ||
}; | ||
export declare function useRef<Value>(val?: Value): { | ||
current: Value | undefined; | ||
}; |
type NotFunction<T> = T extends Function ? never : T; | ||
export declare function useState<Value>(defaultValue: NotFunction<Value> | (() => Value)): [Value, (newValue: Value) => void]; | ||
export declare function useState<Value>(defaultValue?: NotFunction<Value> | (() => Value)): [Value | undefined, (newValue?: Value | undefined) => void]; | ||
export {}; |
{ | ||
"name": "@inquirer/core", | ||
"version": "8.0.1", | ||
"version": "8.1.0", | ||
"engines": { | ||
@@ -61,3 +61,3 @@ "node": ">=18" | ||
"@inquirer/figures": "^1.0.1", | ||
"@inquirer/type": "^1.3.0", | ||
"@inquirer/type": "^1.3.1", | ||
"@types/mute-stream": "^0.0.4", | ||
@@ -76,3 +76,3 @@ "@types/node": "^20.12.7", | ||
"devDependencies": { | ||
"@inquirer/testing": "^2.1.17" | ||
"@inquirer/testing": "^2.1.18" | ||
}, | ||
@@ -100,3 +100,3 @@ "scripts": { | ||
}, | ||
"gitHead": "e986c9afc26321c3448f87f55795f7d9b8a9d452" | ||
"gitHead": "d0e92901ebb7eb77d027786a2e1ac41fc15326b6" | ||
} |
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
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
83814
1633
Updated@inquirer/type@^1.3.1