-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
gender transformer
1 parent
be0291c
commit 167c5a8
Showing
5 changed files
with
94 additions
and
3 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
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,84 @@ | ||
--- | ||
title: Gender | ||
id: gender | ||
hide_title: true | ||
slug: /transformers/system/gender | ||
--- | ||
|
||
import { TransformerPageHeader } from '@site/src/CustomComponents/TransformerPageHeader.tsx'; | ||
|
||
import { DocsTable } from '@site/src/CustomComponents/DocsTable.tsx'; | ||
|
||
<TransformerPageHeader | ||
title="Gender" | ||
type="string" | ||
apiRef="https://github.com/nucleuscloud/neosync/blob/main/worker/internal/benthos/transformers/gender.go" | ||
/> | ||
|
||
## Definition | ||
|
||
The gender transformer randomly selects a gender value from a predefined list of genders. Here is the list: | ||
|
||
<DocsTable | ||
headers={['Gender', 'Abbreviation']} | ||
rowData={[ | ||
{ | ||
data: ['male', 'm'], | ||
}, | ||
{ | ||
data: ['female', 'f'], | ||
}, | ||
{ | ||
data: ['nonbinary', 'n'], | ||
}, | ||
{ | ||
data: ['undefined', 'u'], | ||
}, | ||
]} | ||
/> | ||
|
||
By default, the gender transformer does not abbreviate the gender. If you'd like to return an abbreviated gender, pass in the `abbreviate` config. | ||
|
||
## Configurations | ||
|
||
Depending on your validations, you may want to configure the output gender. The gender transformer has the following configurations: | ||
|
||
<DocsTable | ||
headers={[ | ||
'Name', | ||
'Description', | ||
'Default', | ||
'Example Input', | ||
'Example Output', | ||
]} | ||
rowData={[ | ||
{ | ||
data: [ | ||
'Abbreviate', | ||
'Abbreviate will abbreviate the output gender so that it is only one character. ', | ||
'false', | ||
'N/A', | ||
'u', | ||
], | ||
}, | ||
]} | ||
/> | ||
|
||
## Examples | ||
|
||
There are several ways you can mix-and-match configurations to get different full name formats. Here are some possible combinations: | ||
|
||
<DocsTable | ||
headers={['Abbreviate', 'Example Input', 'Example Output']} | ||
rowData={[ | ||
{ | ||
data: ['false', 'N/A', 'male'], | ||
}, | ||
{ | ||
data: ['true', 'N/A', 'f'], | ||
}, | ||
{ | ||
data: ['false', 'female', 'nonbinary'], | ||
}, | ||
]} | ||
/> |
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
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
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