Skip to content

Commit

Permalink
fix: add inputs property to get multiple inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Avivbens committed Jun 7, 2024
1 parent 09f9ed2 commit 4d3429a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/app/client/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,14 @@ alfredClient.cache.setWithTTL(SOME_DATA_KEY, data, { maxAge: CACHE_TTL })
## `input: string`

Get the input passed into the script filter (by `$1` or `{query}`).

::: tip TIP :zap:
In case you have multiple inputs, you can use the `inputs` property to get all of them.
:::

## `inputs: string[]`

Get multiple inputs passed into the script filter (by `$1`, `$2`, `$3`, etc).
::: tip TIP :zap:
In case you have only one input, you can use the `input` property to get it.
:::
12 changes: 12 additions & 0 deletions src/core/fast-alfred.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,21 @@ export class FastAlfred {
/**
* @description
* Get the input passed into the script filter (by `$1` or `{query}`)
*
* @note
* If you're passing multiple inputs, you can use the `inputs` property
*/
public readonly input: string = argv[2]

/**
* @description
* Get all the inputs passed into the script filter
*
* @note
* If you're passing only one input, you can use the `input` property
*/
public readonly inputs: string[] = argv.slice(2)

/**
* @description
* Outputs the script filter object to interacts with Alfred
Expand Down

0 comments on commit 4d3429a

Please sign in to comment.