Skip to content

Commit

Permalink
fix: fix inquirer prompt for subject DID during SDR
Browse files Browse the repository at this point in the history
fixes #790
  • Loading branch information
mirceanis committed Dec 21, 2021
1 parent 3d9cf88 commit f6a2390
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/cli/src/sdr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ sdr
message: 'Subject DID',
type: 'autocomplete',
pageSize: 15,
suggestOnly: true,
source: async (answers: any, input: string) => {
const res = fuzzy
.filter(input, subjects)
.map((el: any) => (typeof el === 'string' ? el : el.original))
return res
},
validate(val) {
validate: (val) => {
if (val && typeof val !== 'string') {
val = val.value
}
if (!val || !val.startsWith('did:')) {
return "Subject DID does not start with 'did:'..."
}
Expand Down

0 comments on commit f6a2390

Please sign in to comment.