Comparing version 10.0.2 to 10.0.3
@@ -25,3 +25,3 @@ import { input, select, number, confirm, rawlist, expand, checkbox, password, editor } from '@inquirer/prompts'; | ||
type PromptConfigMap<A extends Answers> = { | ||
[key in keyof QuestionMap]: DistributiveMerge<QuestionMap[keyof QuestionMap], { | ||
[key in keyof QuestionMap]: Readonly<DistributiveMerge<QuestionMap[keyof QuestionMap], { | ||
type: keyof QuestionMap; | ||
@@ -34,9 +34,9 @@ name: KeyUnion<A>; | ||
default?: Pick<QuestionMap[keyof QuestionMap], 'default'> | AsyncGetterFunction<Pick<QuestionMap[keyof QuestionMap], 'default'> | string[], Prettify<A>>; | ||
}>; | ||
}>>; | ||
}; | ||
export type Question<A extends Answers> = PromptConfigMap<A>[keyof PromptConfigMap<A>]; | ||
export type QuestionAnswerMap<A extends Answers> = { | ||
export type QuestionAnswerMap<A extends Answers> = Readonly<{ | ||
[name in KeyUnion<A>]: Omit<Question<A>, 'name'>; | ||
} | never; | ||
export type QuestionArray<A extends Answers> = Question<A>[] | never; | ||
}> | never; | ||
export type QuestionArray<A extends Answers> = readonly Question<A>[] | never; | ||
export type QuestionObservable<A extends Answers> = Observable<Question<A>> | never; | ||
@@ -43,0 +43,0 @@ export type StreamOptions = Prettify<Parameters<typeof input>[1] & { |
@@ -12,3 +12,2 @@ import { Observable } from 'rxjs'; | ||
run(): Promise<any>; | ||
close(): void; | ||
} | ||
@@ -15,0 +14,0 @@ /** |
@@ -83,2 +83,5 @@ "use strict"; | ||
} | ||
function isQuestionArray(questions) { | ||
return Array.isArray(questions); | ||
} | ||
function isQuestionMap(questions) { | ||
@@ -170,3 +173,3 @@ return Object.values(questions).every((maybeQuestion) => typeof maybeQuestion === 'object' && | ||
if (!this.prompts[question.type]) { | ||
question.type = 'input'; | ||
question = Object.assign({}, question, { type: 'input' }); | ||
} | ||
@@ -207,3 +210,3 @@ return (0, rxjs_1.defer)(() => (0, rxjs_1.of)(question)); | ||
let obs; | ||
if (Array.isArray(questions)) { | ||
if (isQuestionArray(questions)) { | ||
obs = (0, rxjs_1.from)(questions); | ||
@@ -210,0 +213,0 @@ } |
{ | ||
"name": "inquirer", | ||
"version": "10.0.2", | ||
"version": "10.0.3", | ||
"description": "A collection of common interactive command line user interfaces.", | ||
@@ -58,3 +58,3 @@ "author": "Simon Boudrias <admin@simonboudrias.com>", | ||
"dependencies": { | ||
"@inquirer/prompts": "^5.1.3", | ||
"@inquirer/prompts": "^5.2.0", | ||
"@inquirer/type": "^1.5.0", | ||
@@ -89,3 +89,3 @@ "@types/mute-stream": "^0.0.4", | ||
"typings": "./dist/cjs/types/index.d.ts", | ||
"gitHead": "eb7a658ca58d8cc5863efb9289ae1b42e818bdd0" | ||
"gitHead": "6e2ddec8ca97ee176f080efd2cba76e39b5b9628" | ||
} |
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
66622
866
Updated@inquirer/prompts@^5.2.0