Skip to content

Commit

Permalink
last name transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
evisdrenova committed Nov 13, 2023
1 parent 167c5a8 commit 0bbacdf
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
66 changes: 66 additions & 0 deletions docs/docs/transformers/system/last-name.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: Last Name
id: last-name
hide_title: true
slug: /transformers/system/last-name
---

import { TransformerPageHeader } from '@site/src/CustomComponents/TransformerPageHeader.tsx';

import { DocsTable } from '@site/src/CustomComponents/DocsTable.tsx';

<TransformerPageHeader
title="Last Name"
type="string"
apiRef="https://github.com/nucleuscloud/neosync/blob/main/worker/internal/benthos/transformers/lastname.go"
/>

## Definition

The last name transformer generates a valid last name from a list of predefined last name values. You can see the entire list of last name value [here.](https://github.com/nucleuscloud/neosync/blob/main/worker/internal/benthos/transformers/data-sets/last-names.json).

By default, the last name transformer generates a last name of random length. To preserve the length of the input last name, you can set the `preserveLength` config.

## Configurations

Depending on your validations, you may want to configure the output last name. The last name transformer has the following configurations:

<DocsTable
headers={[
'Name',
'Description',
'Default',
'Example Input',
'Example Output',
]}
rowData={[
{
data: [
'PreserveLength',
'Preserve Length will ensure that the output last name is the same length as the input last name. The preserveLength config only preserves names up to 12 characters long.',
'false',
'Hills',
'Kunze',
],
},
]}
/>

## Examples

There are several ways you can mix-and-match configurations to get different last name formats. Here are some possible combinations:

<DocsTable
headers={['PreserveLength', 'Example Input', 'Example Output']}
rowData={[
{
data: ['false', 'Lei', 'Dach'],
},
{
data: ['true', 'Littel', 'Sporer'],
},
{
data: ['false', 'Johnsonston', 'Rodriguezon'],
},
]}
/>
5 changes: 5 additions & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ const sidebars = {
id: 'transformers/system/first-name',
label: 'First Name',
},
{
type: 'doc',
id: 'transformers/system/last-name',
label: 'Last Name',
},
{
type: 'doc',
id: 'transformers/system/full-name',
Expand Down

0 comments on commit 0bbacdf

Please sign in to comment.