-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5fb5538
commit dc43e69
Showing
9 changed files
with
68 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from "react"; | ||
import {GenerateResult, GeneratorOptionsComponentInterface} from "@/types/generator"; | ||
import {ExportValueType} from "@/constants/enums"; | ||
import {faker} from "@faker-js/faker"; | ||
|
||
// ------------------------------------------------------------------------------------------------------------- | ||
// types | ||
export interface SexGeneratorOptions { | ||
|
||
} | ||
|
||
// ------------------------------------------------------------------------------------------------------------- | ||
// default options | ||
export const SexGeneratorDefaultOptions:SexGeneratorOptions = { | ||
} | ||
|
||
// ------------------------------------------------------------------------------------------------------------- | ||
// generate method | ||
export const generate = (options: any): GenerateResult => { | ||
const value = faker.person.sex(); | ||
|
||
return { | ||
value: value, | ||
stringValue: value, | ||
type: ExportValueType.STRING | ||
} | ||
} | ||
|
||
// ------------------------------------------------------------------------------------------------------------- | ||
// options component | ||
export const SexGeneratorOptionsComponent: React.FunctionComponent<GeneratorOptionsComponentInterface> = ({...props}) => { | ||
const {options, onOptionsChange} = props; | ||
// TODO: implement your own options component here | ||
return null; | ||
} |
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,13 @@ | ||
import {Generator} from "@/types/generator"; | ||
import {DataType, DataTypeCategory} from "@/constants/enums"; | ||
import {SexGeneratorDefaultOptions, SexGeneratorOptionsComponent, generate} from "./Sex"; | ||
|
||
export const SexGenerator: Generator = { | ||
type: DataType.SEX, | ||
category: DataTypeCategory.PERSON, | ||
generate: generate, | ||
optionsComponent: SexGeneratorOptionsComponent, | ||
defaultOptions: SexGeneratorDefaultOptions, | ||
exampleLines: ['"male"', '"female"'] | ||
} | ||
|
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
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