-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(formatter): Add trim whitespace transformer to text action
- Loading branch information
1 parent
200e6d9
commit 3a5723d
Showing
4 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/backend/src/apps/formatter/actions/text/transformers/trim-whitespace.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { IGlobalVariable } from '@automatisch/types'; | ||
|
||
const trimWhitespace = ($: IGlobalVariable) => { | ||
const input = $.step.parameters.input as string; | ||
return input.trim(); | ||
}; | ||
|
||
export default trimWhitespace; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...ckend/src/apps/formatter/dynamic-fields/list-transform-options/options/trim-whitespace.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const trimWhitespace = [ | ||
{ | ||
label: 'Input', | ||
key: 'input', | ||
type: 'string' as const, | ||
required: true, | ||
description: 'Text you want to remove leading and trailing spaces.', | ||
variables: true, | ||
}, | ||
]; | ||
|
||
export default trimWhitespace; |