├── .browserslistrc ├── .editorconfig ├── .env ├── .eslintignore ├── .eslintrc.json ├── .github ├── ISSUE_TEMPLATE │ ├── 1-bug-report.yaml │ ├── 2-feature-request.yaml │ └── 3-support-request.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── ci.yml │ └── docs.yml ├── .gitignore ├── .husky ├── .gitignore ├── commit-msg └── pre-commit ├── .nvmrc ├── .prettierignore ├── .prettierrc ├── .vscode ├── extensions.json └── settings.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── babel.config.json ├── changelog.config.js ├── contribute.gif ├── docs-generator.js ├── docs ├── .gitignore ├── README.md ├── babel.config.js ├── docs │ ├── factories.mdx │ └── getting-started.mdx ├── docusaurus.config.js ├── package-lock.json ├── package.json ├── sidebars.js ├── src │ ├── components │ │ ├── HomepageFeatures.js │ │ └── HomepageFeatures.module.css │ ├── consolePlayground │ │ └── index.js │ ├── css │ │ └── custom.css │ ├── pages │ │ ├── index.js │ │ └── index.module.css │ └── theme │ │ └── ReactLiveScope │ │ └── index.js ├── static │ ├── .nojekyll │ └── img │ │ ├── docusaurus.png │ │ ├── favicon.ico │ │ ├── logo.png │ │ ├── logo.svg │ │ ├── tutorial │ │ ├── docsVersionDropdown.png │ │ └── localeDropdown.png │ │ ├── undraw_docusaurus_mountain.svg │ │ ├── undraw_docusaurus_react.svg │ │ └── undraw_docusaurus_tree.svg ├── updating-docs.md └── yarn.lock ├── jest.config.ts ├── jest.preset.js ├── jsdoc.json ├── logo.png ├── migrations.json ├── nx.json ├── package-lock.json ├── package.json ├── packages ├── .gitkeep └── falso │ ├── .babelrc │ ├── .browserslistrc │ ├── .eslintrc.json │ ├── CHANGELOG.md │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── project.json │ ├── rollup.config.js │ ├── src │ ├── babel.config.json │ ├── index.ts │ ├── lib │ │ ├── abbreviation.json │ │ ├── abbreviation.ts │ │ ├── abn.ts │ │ ├── accessory.json │ │ ├── accessory.ts │ │ ├── account.ts │ │ ├── address.ts │ │ ├── adjective.json │ │ ├── adjective.ts │ │ ├── aggregation.ts │ │ ├── airline.json │ │ ├── airline.ts │ │ ├── airport-code.ts │ │ ├── airport-name.ts │ │ ├── airport.json │ │ ├── airport.ts │ │ ├── alpha-numeric.ts │ │ ├── alpha.ts │ │ ├── american-football-team.json │ │ ├── american-football-team.ts │ │ ├── amount.ts │ │ ├── animal-type.json │ │ ├── animal-type.ts │ │ ├── animal.json │ │ ├── animal.ts │ │ ├── arn.ts │ │ ├── avatar.ts │ │ ├── aws-region.json │ │ ├── aws-region.ts │ │ ├── aws-request-id.ts │ │ ├── aws-service.json │ │ ├── aws-service.ts │ │ ├── baseball-team.json │ │ ├── baseball-team.ts │ │ ├── basketball-team.json │ │ ├── basketball-team.ts │ │ ├── bear.json │ │ ├── bear.ts │ │ ├── between-date.ts │ │ ├── bic.ts │ │ ├── binary.ts │ │ ├── bird.i18n.json │ │ ├── bird.ts │ │ ├── bitcoin-address.ts │ │ ├── book.json │ │ ├── book.ts │ │ ├── boolean.ts │ │ ├── brand.json │ │ ├── brand.ts │ │ ├── browser.json │ │ ├── browser.ts │ │ ├── cardinal-direction.json │ │ ├── cardinal-direction.ts │ │ ├── cat.json │ │ ├── cat.ts │ │ ├── catch-phrase.json │ │ ├── catch-phrase.ts │ │ ├── cetacean.json │ │ ├── cetacean.ts │ │ ├── chance-boolean.ts │ │ ├── city.i18n.json │ │ ├── city.ts │ │ ├── clothing-size.json │ │ ├── clothing-size.ts │ │ ├── code-snippet.json │ │ ├── code-snippet.ts │ │ ├── collection.ts │ │ ├── color.json │ │ ├── color.ts │ │ ├── company-name.json │ │ ├── company-name.ts │ │ ├── core │ │ │ ├── core.ts │ │ │ ├── types.ts │ │ │ └── validators.ts │ │ ├── country-code.json │ │ ├── country-code.ts │ │ ├── country.json │ │ ├── country.ts │ │ ├── county.json │ │ ├── county.ts │ │ ├── cow.json │ │ ├── cow.ts │ │ ├── credit-card-brand.json │ │ ├── credit-card-brand.ts │ │ ├── credit-card-cvv.ts │ │ ├── credit-card-number.json │ │ ├── credit-card-number.ts │ │ ├── credit-card.ts │ │ ├── crocodilia.json │ │ ├── crocodilia.ts │ │ ├── currency-code.json │ │ ├── currency-code.ts │ │ ├── currency-name.json │ │ ├── currency-name.ts │ │ ├── currency-symbol.json │ │ ├── currency-symbol.ts │ │ ├── database-collation.json │ │ ├── database-collation.ts │ │ ├── database-column.json │ │ ├── database-column.ts │ │ ├── database-engine.json │ │ ├── database-engine.ts │ │ ├── database-type.json │ │ ├── database-type.ts │ │ ├── database.json │ │ ├── database.ts │ │ ├── department.json │ │ ├── department.ts │ │ ├── direction.json │ │ ├── direction.ts │ │ ├── directory-path.json │ │ ├── directory-path.ts │ │ ├── dog.json │ │ ├── dog.ts │ │ ├── domain-name.ts │ │ ├── domain-suffix.json │ │ ├── domain-suffix.ts │ │ ├── drinks.json │ │ ├── drinks.ts │ │ ├── email-provider.json │ │ ├── email-provider.ts │ │ ├── email.ts │ │ ├── emoji.json │ │ ├── emoji.ts │ │ ├── ethereum-address.json │ │ ├── ethereum-address.ts │ │ ├── factories │ │ │ ├── incremental-date.ts │ │ │ └── incremental-number.ts │ │ ├── file-ext.json │ │ ├── file-ext.ts │ │ ├── file-name.json │ │ ├── file-name.ts │ │ ├── file-path.json │ │ ├── file-path.ts │ │ ├── file-type.json │ │ ├── file-type.ts │ │ ├── first-name.json │ │ ├── first-name.ts │ │ ├── fish.json │ │ ├── fish.ts │ │ ├── flight-details.ts │ │ ├── flight-number.ts │ │ ├── float.ts │ │ ├── font-family.json │ │ ├── font-family.ts │ │ ├── font-size.ts │ │ ├── food.json │ │ ├── food.ts │ │ ├── football-team.json │ │ ├── football-team.ts │ │ ├── frequency.json │ │ ├── frequency.ts │ │ ├── full-address.ts │ │ ├── full-name.ts │ │ ├── future-date.ts │ │ ├── gender-code.json │ │ ├── gender.json │ │ ├── gender.ts │ │ ├── git-branch.json │ │ ├── git-branch.ts │ │ ├── git-commit-entry.ts │ │ ├── git-commit-message.ts │ │ ├── git-commit-sha.ts │ │ ├── git-short-sha.ts │ │ ├── hex.ts │ │ ├── hexa-decimal.ts │ │ ├── horse.json │ │ ├── horse.ts │ │ ├── hsl.ts │ │ ├── http-method.json │ │ ├── http-method.ts │ │ ├── i18n │ │ │ ├── .gitkeep │ │ │ ├── ar │ │ │ │ ├── bird.i18n.json │ │ │ │ ├── bird.ts │ │ │ │ └── index.ts │ │ │ ├── de │ │ │ │ ├── bird.i18n.json │ │ │ │ ├── bird.ts │ │ │ │ ├── city.i18n.json │ │ │ │ ├── city.ts │ │ │ │ ├── index.ts │ │ │ │ ├── state-abbr.i18n.json │ │ │ │ ├── state-abbr.ts │ │ │ │ ├── state.i18n.json │ │ │ │ └── state.ts │ │ │ ├── es │ │ │ │ ├── bird.i18n.json │ │ │ │ ├── bird.ts │ │ │ │ └── index.ts │ │ │ ├── fr │ │ │ │ ├── bird.i18n.json │ │ │ │ ├── bird.ts │ │ │ │ └── index.ts │ │ │ ├── he │ │ │ │ ├── accessory.i18n.json │ │ │ │ ├── accessory.ts │ │ │ │ ├── airline.i18n.json │ │ │ │ ├── airline.ts │ │ │ │ ├── airport.i18n.json │ │ │ │ ├── airport.ts │ │ │ │ ├── american-football-team.i18n.json │ │ │ │ ├── american-football-team.ts │ │ │ │ ├── animal-type.i18n.json │ │ │ │ ├── animal-type.ts │ │ │ │ ├── animal.i18n.json │ │ │ │ ├── animal.ts │ │ │ │ ├── baseball-team.18n.json │ │ │ │ ├── baseball-team.ts │ │ │ │ ├── bear.18n.json │ │ │ │ ├── bear.ts │ │ │ │ ├── bird.i18n.json │ │ │ │ ├── bird.ts │ │ │ │ ├── book.i18n.json │ │ │ │ ├── book.ts │ │ │ │ ├── brand.18n.json │ │ │ │ ├── brand.ts │ │ │ │ ├── cardinal-direction.18n.json │ │ │ │ ├── cardinal-direction.ts │ │ │ │ ├── clothing-size.i18n.json │ │ │ │ ├── clothing-size.ts │ │ │ │ ├── first-name.i18n.json │ │ │ │ ├── first-name.ts │ │ │ │ ├── food.i18n.json │ │ │ │ ├── food.ts │ │ │ │ ├── gender.i18n.json │ │ │ │ ├── gender.ts │ │ │ │ ├── horse.i18n.json │ │ │ │ ├── horse.ts │ │ │ │ ├── index.ts │ │ │ │ ├── language.i18n.json │ │ │ │ ├── language.ts │ │ │ │ ├── last-name.i18n.json │ │ │ │ ├── last-name.ts │ │ │ │ ├── person-title.i18n.json │ │ │ │ ├── person-title.ts │ │ │ │ ├── pronoun.i18n.json │ │ │ │ ├── pronoun.ts │ │ │ │ ├── weekday.i18n.json │ │ │ │ └── weekday.ts │ │ │ ├── hi │ │ │ │ ├── bird.i18n.json │ │ │ │ ├── bird.ts │ │ │ │ └── index.ts │ │ │ ├── ko │ │ │ │ ├── bird.i18n.json │ │ │ │ ├── bird.ts │ │ │ │ └── index.ts │ │ │ ├── pt-br │ │ │ │ ├── bird.i18n.json │ │ │ │ ├── bird.ts │ │ │ │ ├── first-name.i18n.json │ │ │ │ ├── index.ts │ │ │ │ └── last-name.i18n.json │ │ │ ├── ru │ │ │ │ ├── bird.i18n.json │ │ │ │ ├── bird.ts │ │ │ │ ├── first-name.i18n.json │ │ │ │ └── index.ts │ │ │ ├── se │ │ │ │ ├── bird.i18n.json │ │ │ │ ├── bird.ts │ │ │ │ └── index.ts │ │ │ └── zh │ │ │ │ ├── bird.i18n.json │ │ │ │ ├── bird.ts │ │ │ │ └── index.ts │ │ ├── iban.ts │ │ ├── ice-hockey-team.json │ │ ├── ice-hockey-team.ts │ │ ├── img.ts │ │ ├── integration.json │ │ ├── integration.ts │ │ ├── ip.ts │ │ ├── ipv6.ts │ │ ├── job-area.json │ │ ├── job-area.ts │ │ ├── job-descriptor.json │ │ ├── job-descriptor.ts │ │ ├── job-title.json │ │ ├── job-title.ts │ │ ├── job-type.json │ │ ├── job-type.ts │ │ ├── json.ts │ │ ├── language-code.json │ │ ├── language.json │ │ ├── language.ts │ │ ├── last-name.json │ │ ├── last-name.ts │ │ ├── latitude.ts │ │ ├── line.ts │ │ ├── lines.json │ │ ├── lines.ts │ │ ├── lion.json │ │ ├── lion.ts │ │ ├── locale.json │ │ ├── locale.ts │ │ ├── longitude.ts │ │ ├── mac.ts │ │ ├── mask.ts │ │ ├── mime-type.json │ │ ├── mime-type.ts │ │ ├── month.json │ │ ├── month.ts │ │ ├── motorcycle-manufacturer.json │ │ ├── motorcycle-manufacturer.ts │ │ ├── movie-character.json │ │ ├── movie-character.ts │ │ ├── movie.json │ │ ├── movie.ts │ │ ├── music-genre.json │ │ ├── music-genre.ts │ │ ├── nearby-gpscoordinate.ts │ │ ├── noun.json │ │ ├── noun.ts │ │ ├── number.ts │ │ ├── oauth-provider.json │ │ ├── oauth-provider.ts │ │ ├── octal.ts │ │ ├── ordinal-direction.json │ │ ├── ordinal-direction.ts │ │ ├── paragraph.json │ │ ├── paragraph.ts │ │ ├── password.ts │ │ ├── past-date.ts │ │ ├── permission.json │ │ ├── permission.ts │ │ ├── person-title.json │ │ ├── person-title.ts │ │ ├── phone-number.json │ │ ├── phone-number.ts │ │ ├── phrase.json │ │ ├── phrase.ts │ │ ├── port.ts │ │ ├── post.ts │ │ ├── priority.json │ │ ├── priority.ts │ │ ├── product-adjective.json │ │ ├── product-adjective.ts │ │ ├── product-category.json │ │ ├── product-category.ts │ │ ├── product-description.json │ │ ├── product-description.ts │ │ ├── product-material.json │ │ ├── product-material.ts │ │ ├── product-name.json │ │ ├── product-name.ts │ │ ├── product.json │ │ ├── product.ts │ │ ├── programming-language.json │ │ ├── programming-language.ts │ │ ├── pronoun.json │ │ ├── pronoun.ts │ │ ├── protocol-full.json │ │ ├── protocol.json │ │ ├── protocol.ts │ │ ├── quote.json │ │ ├── quote.ts │ │ ├── rabbit.json │ │ ├── rabbit.ts │ │ ├── rand.ts │ │ ├── random.ts │ │ ├── recent-date.ts │ │ ├── resolution.json │ │ ├── resolution.ts │ │ ├── rgb.ts │ │ ├── role.json │ │ ├── role.ts │ │ ├── routing-number.ts │ │ ├── seat-number.ts │ │ ├── semver.ts │ │ ├── sentence.json │ │ ├── sentence.ts │ │ ├── sequence.ts │ │ ├── shape.json │ │ ├── shape.ts │ │ ├── singer.json │ │ ├── singer.ts │ │ ├── skill.json │ │ ├── skill.ts │ │ ├── slug.ts │ │ ├── snake.json │ │ ├── snake.ts │ │ ├── social.json │ │ ├── social.ts │ │ ├── song.json │ │ ├── song.ts │ │ ├── soon-date.ts │ │ ├── sports-team.ts │ │ ├── sports.json │ │ ├── sports.ts │ │ ├── state-abbr.i18n.json │ │ ├── state-abbr.ts │ │ ├── state.i18n.json │ │ ├── state.ts │ │ ├── status.json │ │ ├── status.ts │ │ ├── street-address.ts │ │ ├── street-name.json │ │ ├── street-name.ts │ │ ├── subscription-plan.json │ │ ├── subscription-plan.ts │ │ ├── superhero-name.ts │ │ ├── superhero.json │ │ ├── superhero.ts │ │ ├── svg.json │ │ ├── svg.ts │ │ ├── swift.ts │ │ ├── text-range.ts │ │ ├── text.ts │ │ ├── time-zone.json │ │ ├── time-zone.ts │ │ ├── todo.ts │ │ ├── transaction-type.json │ │ ├── transaction-type.ts │ │ ├── url.ts │ │ ├── user-agent.json │ │ ├── user-agent.ts │ │ ├── user-name.ts │ │ ├── user.ts │ │ ├── utils │ │ │ ├── objectKeys.ts │ │ │ └── validators.utils.ts │ │ ├── uuid.ts │ │ ├── vehicle-fuel.json │ │ ├── vehicle-fuel.ts │ │ ├── vehicle-manufacturer.json │ │ ├── vehicle-manufacturer.ts │ │ ├── vehicle-model.json │ │ ├── vehicle-model.ts │ │ ├── vehicle-type.json │ │ ├── vehicle-type.ts │ │ ├── vehicle.json │ │ ├── vehicle.ts │ │ ├── verb.json │ │ ├── verb.ts │ │ ├── weekday.json │ │ ├── weekday.ts │ │ ├── word.json │ │ ├── word.ts │ │ └── zip-code.ts │ └── tests │ │ ├── abn.spec.ts │ │ ├── accessory.spec.ts │ │ ├── account.spec.ts │ │ ├── address.spec.ts │ │ ├── adjective.spec.ts │ │ ├── aggregation.spec.ts │ │ ├── airport-code.spec.ts │ │ ├── airport-name.spec.ts │ │ ├── alpha-numeric.spec.ts │ │ ├── amount.spec.ts │ │ ├── aws-request-id.spec.ts │ │ ├── aws-service.spec.ts │ │ ├── between-date.spec.ts │ │ ├── bic.spec.ts │ │ ├── binary.spec.ts │ │ ├── bird.spec.ts │ │ ├── book.spec.ts │ │ ├── brand.spec.ts │ │ ├── browser.spec.ts │ │ ├── chance-boolean.spec.ts │ │ ├── city.spec.ts │ │ ├── clothing-size.spec.ts │ │ ├── code-snippet.spec.ts │ │ ├── collection.spec.ts │ │ ├── country-code.spec.ts │ │ ├── credit-card-number.spec.ts │ │ ├── credit-card.spec.ts │ │ ├── database.spec.ts │ │ ├── dates.spec.ts │ │ ├── drinks.spec.ts │ │ ├── email.spec.ts │ │ ├── emoji.spec.ts │ │ ├── first-name.spec.ts │ │ ├── flight-details.spec.ts │ │ ├── flight-number.spec.ts │ │ ├── float.spec.ts │ │ ├── font-family.spec.ts │ │ ├── font-size.spec.ts │ │ ├── food.spec.ts │ │ ├── frequency.spec.ts │ │ ├── full-address.spec.ts │ │ ├── full-name.spec.ts │ │ ├── future-date.spec.ts │ │ ├── gender.spec.ts │ │ ├── get-random-in-range.spec.ts │ │ ├── hex.spec.ts │ │ ├── hsl.spec.ts │ │ ├── iban.spec.ts │ │ ├── incremental-date.spec.ts │ │ ├── incremental-number.spec.ts │ │ ├── integrations.spec.ts │ │ ├── json.spec.ts │ │ ├── language.spec.ts │ │ ├── last-name.spec.ts │ │ ├── line.spec.ts │ │ ├── mask.spec.ts │ │ ├── max-char-count.spec.ts │ │ ├── month.spec.ts │ │ ├── motorcycle-manufacturer.spec.ts │ │ ├── movie-character.spec.ts │ │ ├── movie.spec.ts │ │ ├── noun.spec.ts │ │ ├── number.spec.ts │ │ ├── octal.spec.ts │ │ ├── password.spec.ts │ │ ├── past-date.spec.ts │ │ ├── permission.spec.ts │ │ ├── phone-number.spec.ts │ │ ├── post.spec.ts │ │ ├── priority.spec.ts │ │ ├── product-category.spec.ts │ │ ├── product.spec.ts │ │ ├── protocol.spec.ts │ │ ├── quote.spec.ts │ │ ├── rand.spec.ts │ │ ├── resolution.spec.ts │ │ ├── rgb.spec.ts │ │ ├── seat-number.spec.ts │ │ ├── seed.spec.ts │ │ ├── sentence.spec.ts │ │ ├── sequence.spec.ts │ │ ├── shape.spec.ts │ │ ├── singer.spec.ts │ │ ├── slug.spec.ts │ │ ├── song.spec.ts │ │ ├── sports.spec.ts │ │ ├── state-abbr.spec.ts │ │ ├── state.spec.ts │ │ ├── status.spec.ts │ │ ├── subscription-plan.spec.ts │ │ ├── superhero-name.spec.ts │ │ ├── superhero.spec.ts │ │ ├── svg.spec.ts │ │ ├── swift.spec.ts │ │ ├── text-range.spec.ts │ │ ├── text.spec.ts │ │ ├── todo.spec.ts │ │ ├── user-name.spec.ts │ │ ├── user.spec.ts │ │ └── uuid.spec.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── scripts └── update-functions-count.js ├── tools ├── executors │ ├── build-locales │ │ ├── executor.json │ │ ├── index.ts │ │ ├── package.json │ │ └── schema.json │ ├── manipulator │ │ ├── executor.json │ │ ├── index.js │ │ ├── index.ts │ │ ├── package.json │ │ └── schema.json │ └── translate │ │ ├── .gitignore │ │ ├── README.md │ │ ├── constants.ts │ │ ├── executor.json │ │ ├── files │ │ ├── .gitignore │ │ ├── .gitkeep │ │ └── google-cloud-secret.example.json │ │ ├── generate.ts │ │ ├── index.ts │ │ ├── options.ts │ │ ├── package.json │ │ ├── schema.json │ │ ├── translate.ts │ │ └── write.ts ├── tsconfig.tools.json └── workspace-plugin │ └── src │ └── generators │ └── falso │ ├── index.ts │ └── schema.json └── tsconfig.base.json /.browserslistrc: -------------------------------------------------------------------------------- 1 | last 2 versions 2 | not IE 11 -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | 15 | [*.mdx] 16 | max_line_length = off 17 | trim_trailing_whitespace = false 18 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | # Nx 18 enables using plugins to infer targets by default 2 | # This is disabled for existing workspaces to maintain compatibility 3 | # For more info, see: https://nx.dev/concepts/inferred-tasks 4 | NX_ADD_PLUGINS=false -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/2-feature-request.yaml: -------------------------------------------------------------------------------- 1 | name: 'Feature Request' 2 | description: Suggest a feature for Falso Library 3 | 4 | body: 5 | - type: textarea 6 | id: description 7 | attributes: 8 | label: Description 9 | validations: 10 | required: true 11 | 12 | - type: textarea 13 | id: proposed-solution 14 | attributes: 15 | label: Proposed solution 16 | 17 | - type: textarea 18 | id: alternatives-considered 19 | attributes: 20 | label: Alternatives considered 21 | 22 | - type: dropdown 23 | id: contribute 24 | attributes: 25 | label: Do you want to create a pull request? 26 | options: 27 | - 'Yes' 28 | - 'No' 29 | validations: 30 | required: true -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/3-support-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'Support Request' 3 | about: Questions and requests for support 4 | --- 5 | 6 | Please do not file questions or support requests on the GitHub issues tracker. 7 | 8 | You can get your questions answered using other communication channels. Please see: 9 | 10 | https://github.com/ngneat/falso/discussions 11 | 12 | Thank you! 13 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: [pull_request] 3 | 4 | env: 5 | NODE_VERSION: 20 6 | 7 | jobs: 8 | test: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v3 12 | - uses: actions/setup-node@v3 13 | with: 14 | node-version: ${{ env.NODE_VERSION }} 15 | cache: 'npm' 16 | 17 | - name: Install dependencies 18 | run: npm i 19 | 20 | - name: Run tests 21 | run: npm test 22 | build: 23 | runs-on: ubuntu-latest 24 | steps: 25 | - uses: actions/checkout@v3 26 | 27 | - uses: actions/setup-node@v3 28 | with: 29 | node-version: ${{ env.NODE_VERSION }} 30 | cache: 'npm' 31 | 32 | - name: Install dependencies 33 | run: npm i 34 | 35 | - name: Build 36 | run: npm run build 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | .history 20 | 21 | # IDE - VSCode 22 | .vscode/* 23 | !.vscode/settings.json 24 | !.vscode/tasks.json 25 | !.vscode/launch.json 26 | !.vscode/extensions.json 27 | 28 | # misc 29 | /.sass-cache 30 | /connect.lock 31 | /coverage 32 | /libpeerconnection.log 33 | npm-debug.log 34 | yarn-error.log 35 | testem.log 36 | /typings 37 | 38 | # System Files 39 | .DS_Store 40 | Thumbs.db 41 | 42 | .nx/cache 43 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no-install commitlint --edit $1 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | node scripts/update-functions-count.js && npx lint-staged 5 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Add files here to ignore them from prettier formatting 2 | 3 | /dist 4 | /coverage 5 | 6 | /.nx/cache -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "nrwl.angular-console", 4 | "esbenp.prettier-vscode", 5 | "dbaeumer.vscode-eslint", 6 | "firsttris.vscode-jest-runner" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true 3 | } 4 | -------------------------------------------------------------------------------- /babel.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "babelrcRoots": ["*"] 3 | } 4 | -------------------------------------------------------------------------------- /contribute.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngneat/falso/449ee5470ae52c973f7e4b487620d23e5e38686d/contribute.gif -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | 22 | # Falso package for live code 23 | src/theme/ReactLiveScope/falso.min.js 24 | 25 | # Auto-generated docs 26 | docs/auto-generated 27 | -------------------------------------------------------------------------------- /docs/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /docs/src/components/HomepageFeatures.module.css: -------------------------------------------------------------------------------- 1 | .features { 2 | display: flex; 3 | align-items: center; 4 | padding: 2rem 0; 5 | width: 100%; 6 | } 7 | 8 | .featureSvg { 9 | height: 200px; 10 | width: 200px; 11 | } 12 | -------------------------------------------------------------------------------- /docs/src/consolePlayground/index.js: -------------------------------------------------------------------------------- 1 | import * as falso from '../theme/ReactLiveScope/falso.min'; 2 | 3 | if (typeof window !== 'undefined') { 4 | window.onload = function () { 5 | const titleStyles = 'color:#8a76d9; font-size: 22px; font-weight:bold;'; 6 | const copyStyles = 'color:white; font-size: 14px'; 7 | const exampleStyles = 'color:#8a76d9; font-size: 14px;'; 8 | console.log('%c🎩Falso\n' + '%cYou can use _ to access Falso functions here in the console. \n\n%c' + 'For example: _.randFullName()', titleStyles, copyStyles, exampleStyles) 9 | 10 | window._ = falso; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /docs/src/pages/index.module.css: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS files with the .module.css suffix will be treated as CSS modules 3 | * and scoped locally. 4 | */ 5 | 6 | .heroBanner { 7 | padding: 4rem 0; 8 | text-align: center; 9 | position: relative; 10 | overflow: hidden; 11 | background: transparent; 12 | border-bottom: 1px solid rgba(60, 60, 67, 0.12); 13 | } 14 | 15 | html[data-theme='dark'] .heroBanner { 16 | border-color: #3b3b3b; 17 | } 18 | 19 | @media screen and (max-width: 966px) { 20 | .heroBanner { 21 | padding: 2rem; 22 | } 23 | } 24 | 25 | .buttons { 26 | display: flex; 27 | align-items: center; 28 | justify-content: center; 29 | } 30 | -------------------------------------------------------------------------------- /docs/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngneat/falso/449ee5470ae52c973f7e4b487620d23e5e38686d/docs/static/.nojekyll -------------------------------------------------------------------------------- /docs/static/img/docusaurus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngneat/falso/449ee5470ae52c973f7e4b487620d23e5e38686d/docs/static/img/docusaurus.png -------------------------------------------------------------------------------- /docs/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngneat/falso/449ee5470ae52c973f7e4b487620d23e5e38686d/docs/static/img/favicon.ico -------------------------------------------------------------------------------- /docs/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngneat/falso/449ee5470ae52c973f7e4b487620d23e5e38686d/docs/static/img/logo.png -------------------------------------------------------------------------------- /docs/static/img/tutorial/docsVersionDropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngneat/falso/449ee5470ae52c973f7e4b487620d23e5e38686d/docs/static/img/tutorial/docsVersionDropdown.png -------------------------------------------------------------------------------- /docs/static/img/tutorial/localeDropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngneat/falso/449ee5470ae52c973f7e4b487620d23e5e38686d/docs/static/img/tutorial/localeDropdown.png -------------------------------------------------------------------------------- /docs/updating-docs.md: -------------------------------------------------------------------------------- 1 | ## Updating the Auto-Generated Docs 2 | 3 | All the function's docs are auto-generated by parsing JSDoc into `mdx` files. 4 | 5 | In order to update the docs for a specific function you just need to update the JSDoc above it. 6 | -------------------------------------------------------------------------------- /jest.config.ts: -------------------------------------------------------------------------------- 1 | const { getJestProjects } = require('@nx/jest'); 2 | 3 | export default { 4 | projects: getJestProjects(), 5 | }; 6 | -------------------------------------------------------------------------------- /jest.preset.js: -------------------------------------------------------------------------------- 1 | const nxPreset = require('@nx/jest/preset').default; 2 | 3 | module.exports = { 4 | ...nxPreset, 5 | /* TODO: Update to latest Jest snapshotFormat 6 | * By default Nx has kept the older style of Jest Snapshot formats 7 | * to prevent breaking of any existing tests with snapshots. 8 | * It's recommend you update to the latest format. 9 | * You can do this by removing snapshotFormat property 10 | * and running tests with --update-snapshot flag. 11 | * Example: "nx affected --targets=test --update-snapshot" 12 | * More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format 13 | */ 14 | snapshotFormat: { escapeString: true, printBasicPrototype: true }, 15 | }; 16 | -------------------------------------------------------------------------------- /jsdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": { 3 | "includePattern": ".+\\.ts(doc|x)?$", 4 | "excludePattern": ".+\\.(test|spec).(ts|js)" 5 | }, 6 | "plugins": ["node_modules/jsdoc-babel"], 7 | "babel": { 8 | "extensions": ["ts"], 9 | "ignore": ["**/*.(test|spec).(ts|js)"], 10 | "presets": [["@babel/preset-env"], "@babel/preset-typescript"], 11 | "plugins": [] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngneat/falso/449ee5470ae52c973f7e4b487620d23e5e38686d/logo.png -------------------------------------------------------------------------------- /packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngneat/falso/449ee5470ae52c973f7e4b487620d23e5e38686d/packages/.gitkeep -------------------------------------------------------------------------------- /packages/falso/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["@nx/js/babel"] 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /packages/falso/.browserslistrc: -------------------------------------------------------------------------------- 1 | last 2 versions 2 | not IE 11 -------------------------------------------------------------------------------- /packages/falso/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../.eslintrc.json"], 3 | "ignorePatterns": ["!**/*"], 4 | "overrides": [ 5 | { 6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], 7 | "rules": {} 8 | }, 9 | { 10 | "files": ["*.ts", "*.tsx"], 11 | "rules": {} 12 | }, 13 | { 14 | "files": ["*.js", "*.jsx"], 15 | "rules": {} 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /packages/falso/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'falso', 4 | 5 | globals: {}, 6 | testEnvironment: 'node', 7 | transform: { 8 | '^.+\\.[tj]sx?$': [ 9 | 'ts-jest', 10 | { 11 | tsconfig: '/tsconfig.spec.json', 12 | }, 13 | ], 14 | }, 15 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], 16 | coverageDirectory: '../../coverage/packages/falso', 17 | preset: '../../jest.preset.js', 18 | }; 19 | -------------------------------------------------------------------------------- /packages/falso/rollup.config.js: -------------------------------------------------------------------------------- 1 | const terser = require('@rollup/plugin-terser'); 2 | 3 | module.exports = (config) => { 4 | return { 5 | ...config, 6 | plugins: [...config.plugins, terser()] 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /packages/falso/src/babel.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@nx/js/babel", 5 | { 6 | "useBuiltIns": "usage" 7 | } 8 | ] 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /packages/falso/src/lib/abbreviation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "SCSI", 4 | "SMTP", 5 | "ADP", 6 | "TCP", 7 | "PNG", 8 | "EXE", 9 | "AI", 10 | "RAM", 11 | "RSS", 12 | "GB", 13 | "SSL", 14 | "CSS", 15 | "SAS", 16 | "SDD", 17 | "PCI", 18 | "IB", 19 | "SQL", 20 | "XML", 21 | "THX", 22 | "AGP", 23 | "HTTP", 24 | "SMS", 25 | "FTP", 26 | "JBOD", 27 | "XSS", 28 | "HDD", 29 | "JSON", 30 | "COM" 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /packages/falso/src/lib/abbreviation.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { data } from './abbreviation.json'; 3 | 4 | /** 5 | * Generate a random abbreviation. 6 | * 7 | * @category text 8 | * 9 | * @example 10 | * 11 | * randAbbreviation() 12 | * 13 | * @example 14 | * 15 | * randAbbreviation({ length: 10 }) 16 | * 17 | */ 18 | export function randAbbreviation( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/accessory.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './accessory.json'; 3 | 4 | /** 5 | * Generate a random accessory. 6 | * 7 | * @category Commerce 8 | * 9 | * @example 10 | * 11 | * randAccessory() 12 | * 13 | * @example 14 | * 15 | * randAccessory({ length: 10 }) 16 | * 17 | */ 18 | export function randAccessory( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/adjective.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './adjective.json'; 3 | 4 | /** 5 | * Generate a random adjective. 6 | * 7 | * @category text 8 | * 9 | * @example 10 | * 11 | * randAdjective() 12 | * 13 | * @example 14 | * 15 | * randAdjective({ length: 10 }) 16 | * 17 | */ 18 | export function randAdjective( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/airline.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './airline.json'; 3 | 4 | /** 5 | * Generate a random airline. 6 | * 7 | * @category flight 8 | * 9 | * @example 10 | * 11 | * randAirline() 12 | * 13 | * @example 14 | * 15 | * randAirline({ length: 10 }) 16 | * 17 | */ 18 | export function randAirline( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/airport-code.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './airport.json'; 3 | import { rand } from './rand'; 4 | 5 | /** 6 | * Generate a random airport code. 7 | * 8 | * @category flight 9 | * 10 | * @example 11 | * 12 | * randAirportCode() 13 | * 14 | * @example 15 | * 16 | * randAirportCode({ length: 10 }) 17 | * 18 | */ 19 | export function randAirportCode( 20 | options?: Options 21 | ) { 22 | const factory: () => string = () => { 23 | return rand(data.map(({ code }) => code)); 24 | }; 25 | 26 | return fake(factory, options); 27 | } 28 | -------------------------------------------------------------------------------- /packages/falso/src/lib/airport-name.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './airport.json'; 3 | import { rand } from './rand'; 4 | 5 | /** 6 | * Generate a random airport name. 7 | * 8 | * @category flight 9 | * 10 | * @example 11 | * 12 | * randAirportName() 13 | * 14 | * @example 15 | * 16 | * randAirportName({ length: 10 }) 17 | * 18 | */ 19 | export function randAirportName( 20 | options?: Options 21 | ) { 22 | const factory: () => string = () => { 23 | return rand(data.map(({ name }) => name)); 24 | }; 25 | 26 | return fake(factory, options); 27 | } 28 | -------------------------------------------------------------------------------- /packages/falso/src/lib/airport.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './airport.json'; 3 | 4 | export interface Airport { 5 | name: string; 6 | code: string; 7 | city: string; 8 | country: string; 9 | } 10 | 11 | /** 12 | * Generate a random airport. 13 | * 14 | * @category flight 15 | * 16 | * @example 17 | * 18 | * randAirport() 19 | * 20 | * @example 21 | * 22 | * randAirport({ length: 10 }) 23 | * 24 | */ 25 | export function randAirport( 26 | options?: Options 27 | ) { 28 | return fake(data, options); 29 | } 30 | -------------------------------------------------------------------------------- /packages/falso/src/lib/alpha-numeric.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { randBoolean } from './boolean'; 3 | import { randAlpha } from './alpha'; 4 | import { randNumber } from './number'; 5 | 6 | /** 7 | * Get a random alpha or numeric. 8 | * 9 | * @category text 10 | * 11 | * @example 12 | * 13 | * randAlphaNumeric() 14 | * 15 | * @example 16 | * 17 | * randAlphaNumeric({ length: 3 }) 18 | * 19 | */ 20 | export function randAlphaNumeric( 21 | options?: Options 22 | ) { 23 | return fake( 24 | () => (randBoolean() ? randAlpha() : randNumber({ min: 0, max: 9 })), 25 | options 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /packages/falso/src/lib/alpha.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { alphaChars } from './sequence'; 3 | 4 | /** 5 | * Get a random alpha. 6 | * 7 | * @category text 8 | * 9 | * @example 10 | * 11 | * randAlpha() 12 | * 13 | * @example 14 | * 15 | * randAlpha({ length: 3 }) 16 | * 17 | */ 18 | export function randAlpha( 19 | options?: Options 20 | ) { 21 | return fake(alphaChars.split(''), options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/american-football-team.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './american-football-team.json'; 3 | 4 | /** 5 | * Generate a random american football team. 6 | * 7 | * @category sports 8 | * 9 | * @example 10 | * 11 | * randAmericanFootballTeam() 12 | * 13 | * @example 14 | * 15 | * randAmericanFootballTeam({ length: 10 }) 16 | * 17 | */ 18 | export function randAmericanFootballTeam( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/animal-type.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "bird", 4 | "cetacean", 5 | "rabbit", 6 | "bear", 7 | "cat", 8 | "snake", 9 | "cow", 10 | "insect", 11 | "crocodile", 12 | "horse", 13 | "fish", 14 | "dog", 15 | "lion" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /packages/falso/src/lib/animal-type.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './animal-type.json'; 3 | 4 | /** 5 | * Generate a random animal type. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randAnimalType() 12 | * 13 | * @example 14 | * 15 | * randAnimalType({ length: 10 }) 16 | * 17 | */ 18 | export function randAnimalType( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/animal.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './animal.json'; 3 | 4 | /** 5 | * Generate a random animal. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randAnimal() 12 | * 13 | * @example 14 | * 15 | * randAnimal({ length: 10 }) 16 | * 17 | */ 18 | export function randAnimal( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/avatar.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | 3 | interface AvatarOptions extends FakeOptions { 4 | size?: number; 5 | } 6 | 7 | /** 8 | * Generate a random avatar. 9 | * 10 | * @category person 11 | * 12 | * @example 13 | * 14 | * randAvatar() 15 | * 16 | * @example 17 | * 18 | * randAvatar({ length: 10 }) 19 | * 20 | * @example 21 | * 22 | * randAvatar({ size: 200 }) // default is 100 23 | * 24 | */ 25 | export function randAvatar( 26 | options?: Options 27 | ) { 28 | const size = options?.size ?? 100; 29 | 30 | return fake(() => `https://i.pravatar.cc/${size}`, options); 31 | } 32 | -------------------------------------------------------------------------------- /packages/falso/src/lib/aws-region.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "us-east-2", 4 | "us-east-1", 5 | "us-west-1", 6 | "us-west-2", 7 | "af-south-1", 8 | "ap-east-1", 9 | "ap-southeast-3", 10 | "ap-south-1", 11 | "ap-northeast-3", 12 | "ap-northeast-2", 13 | "ap-southeast-1", 14 | "ap-southeast-2", 15 | "ap-northeast-1", 16 | "ca-central-1", 17 | "eu-central-1", 18 | "eu-west-1", 19 | "eu-west-2", 20 | "eu-south-1", 21 | "eu-west-3", 22 | "eu-north-1", 23 | "me-south-1", 24 | "sa-east-1", 25 | "us-gov-east-1", 26 | "us-gov-west-1" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /packages/falso/src/lib/aws-region.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { data } from './aws-region.json'; 3 | 4 | /** 5 | * Generate a random AWS region. 6 | * 7 | * @category AWS 8 | * 9 | * @example 10 | * 11 | * randAwsRegion() 12 | * 13 | * @example 14 | * 15 | * randAwsRegion({ length: 10 }) 16 | * 17 | */ 18 | export function randAwsRegion( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/aws-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "EC2", 4 | "RDS", 5 | "S3", 6 | "Lambda", 7 | "CloudFront", 8 | "Glacier", 9 | "SNS", 10 | "SQS", 11 | "EBS", 12 | "VPC", 13 | "Kinesis", 14 | "Kinesis Data Firehose", 15 | "Dynamo DB", 16 | "ElastiCache", 17 | "CloudWatch", 18 | "Cognito", 19 | "API Gateway", 20 | "AppSync", 21 | "Athena" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /packages/falso/src/lib/aws-service.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { data } from './aws-service.json'; 3 | 4 | /** 5 | * Generate a random AWS service name. 6 | * 7 | * @category AWS 8 | * 9 | * @example 10 | * 11 | * randAwsService() 12 | * 13 | * @example 14 | * 15 | * randAwsService({ length: 10 }) 16 | * 17 | */ 18 | export function randAwsService( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/baseball-team.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './baseball-team.json'; 3 | 4 | /** 5 | * Generate a random baseball team. 6 | * 7 | * @category sports 8 | * 9 | * @example 10 | * 11 | * randBaseballTeam() 12 | * 13 | * @example 14 | * 15 | * randBaseballTeam({ length: 10 }) 16 | * 17 | */ 18 | export function randBaseballTeam( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/basketball-team.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './basketball-team.json'; 3 | 4 | /** 5 | * Generate a random basketball team. 6 | * 7 | * @category sports 8 | * 9 | * @example 10 | * 11 | * randBasketballTeam() 12 | * 13 | * @example 14 | * 15 | * randBasketballTeam({ length: 10 }) 16 | * 17 | */ 18 | export function randBasketballTeam( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/bear.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Spectacled bear", 4 | "Brown bear", 5 | "Asian black bear", 6 | "Sun bear", 7 | "Polar bear", 8 | "Giant panda", 9 | "Sloth bear", 10 | "American black bear" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /packages/falso/src/lib/bear.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './bear.json'; 3 | 4 | /** 5 | * Generate a random bear. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBear() 12 | * 13 | * @example 14 | * 15 | * randBear({ length: 10 }) 16 | * 17 | */ 18 | export function randBear( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/binary.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake, getRandomInRange } from './core/core'; 2 | 3 | /** 4 | * Generate a random binary. 5 | * 6 | * @category Math 7 | * 8 | * @example 9 | * 10 | * randBinary() 11 | * 12 | * @example 13 | * 14 | * randBinary({ length: 10 }) 15 | * 16 | */ 17 | export function randBinary( 18 | options?: Options 19 | ) { 20 | return fake(() => { 21 | const RADIX = 2; 22 | 23 | const randomNumber = getRandomInRange({ 24 | min: 0, 25 | max: Number.MAX_SAFE_INTEGER, 26 | fraction: 0, 27 | }); 28 | 29 | return BigInt(randomNumber.toString(RADIX)).toString(); 30 | }, options); 31 | } 32 | -------------------------------------------------------------------------------- /packages/falso/src/lib/bird.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Red-necked Phalarope", 4 | "Cliff Swallow", 5 | "Loggerhead Kingbird", 6 | "Aztec Thrush", 7 | "Hooded Warbler", 8 | "Common Pochard", 9 | "Scotts Oriole", 10 | "Black-browed Albatross", 11 | "Monk Parakeet", 12 | "Magnificent Hummingbird", 13 | "Broad-billed Sandpiper", 14 | "Bushtit", 15 | "Mexican Jay", 16 | "Hooded Merganser", 17 | "Wood Stork", 18 | "Rosss Gull", 19 | "Green Sandpiper", 20 | "Whooping Crane" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/bird.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './bird.i18n.json'; 3 | 4 | /** 5 | * Generate a random bird. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBird() 12 | * 13 | * @example 14 | * 15 | * randBird({ length: 10 }) 16 | * 17 | */ 18 | export function randBird( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/bitcoin-address.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randSequence } from './sequence'; 3 | 4 | /** 5 | * Generate a random bitcoin-address. 6 | * 7 | * @category finance 8 | * 9 | * @example 10 | * 11 | * randBitcoinAddress() 12 | * 13 | * @example 14 | * 15 | * randBitcoinAddress({ length: 10 }) 16 | * 17 | */ 18 | export function randBitcoinAddress( 19 | options?: Options 20 | ) { 21 | return fake(() => randSequence({ size: 33 }), options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/boolean.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions, randElement } from './core/core'; 2 | 3 | /** 4 | * Generate a random boolean. 5 | * 6 | * @category general 7 | * 8 | * @example 9 | * 10 | * randBoolean() 11 | * 12 | * @example 13 | * 14 | * randBoolean({ length: 10 }) 15 | * 16 | */ 17 | export function randBoolean( 18 | options?: Options 19 | ) { 20 | return fake(() => randElement([true, false]), options); 21 | } 22 | -------------------------------------------------------------------------------- /packages/falso/src/lib/brand.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './brand.json'; 3 | 4 | /** 5 | * Generate a random brand. 6 | * 7 | * @category company 8 | * 9 | * @example 10 | * 11 | * randBrand() 12 | * 13 | * @example 14 | * 15 | * randBrand({ length: 10 }) 16 | * 17 | */ 18 | export function randBrand( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/browser.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Chrome", 4 | "Edge", 5 | "Firefox", 6 | "Internet Explorer", 7 | "Safari", 8 | "Opera", 9 | "Yandex", 10 | "Chromium", 11 | "Vivaldi", 12 | "Baidu", 13 | "Brave" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /packages/falso/src/lib/browser.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './browser.json'; 3 | 4 | /** 5 | * Generate a random browser. 6 | * 7 | * @category internet 8 | * 9 | * @example 10 | * 11 | * randBrowser() 12 | * 13 | * @example 14 | * 15 | * randBrowser({ length: 10 }) 16 | * 17 | */ 18 | export function randBrowser( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/cardinal-direction.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["East", "South", "West", "North"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/cardinal-direction.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './cardinal-direction.json'; 3 | 4 | /** 5 | * Generate a random cardinal direction. 6 | * 7 | * @category address 8 | * 9 | * @example 10 | * 11 | * randCardinalDirection() 12 | * 13 | * @example 14 | * 15 | * randCardinalDirection({ length: 10 }) 16 | * 17 | */ 18 | export function randCardinalDirection( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/cat.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Japanese Bobtail", 4 | "Savannah", 5 | "LaPerm", 6 | "Siberian", 7 | "Ocicat", 8 | "Birman", 9 | "Devon Rex", 10 | "Minskin", 11 | "Serengeti", 12 | "Bombay", 13 | "Himalayan", 14 | "American Curl", 15 | "Thai", 16 | "Balinese", 17 | "Singapura", 18 | "American Shorthair", 19 | "Ojos Azules", 20 | "Burmese" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/cat.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { data } from './cat.json'; 3 | 4 | /** 5 | * Generate a random cat. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randCat() 12 | * 13 | * @example 14 | * 15 | * randCat({ length: 10 }) 16 | * 17 | */ 18 | export function randCat( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/catch-phrase.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './catch-phrase.json'; 3 | 4 | /** 5 | * Generate a random catch phrase. 6 | * 7 | * @category text 8 | * 9 | * @example 10 | * 11 | * randCatchPhrase() 12 | * 13 | * @example 14 | * 15 | * randCatchPhrase({ length: 10 }) 16 | * 17 | */ 18 | export function randCatchPhrase( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/cetacean.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Clymene Dolphin", 4 | "Bottlenose Dolphin", 5 | "Costero", 6 | "Chilean Dolphin", 7 | "Heaviside’s Dolphin", 8 | "Pantropical Spotted Dolphin", 9 | "Sperm Whale", 10 | "Burrunan Dolphin", 11 | "Bryde’s whale", 12 | "Atlantic White-Sided Dolphin", 13 | "Northern Rightwhale Dolphin", 14 | "Killer Whale (Orca)", 15 | "False Killer Whale", 16 | "Ganges River Dolphin", 17 | "Pacific White-Sided Dolphin", 18 | "Blue Whale", 19 | "Southern Bottlenose Whale", 20 | "Peale’s Dolphin" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/cetacean.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './cetacean.json'; 3 | 4 | /** 5 | * Generate a random cetacean. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randCetacean() 12 | * 13 | * @example 14 | * 15 | * randCetacean({ length: 10 }) 16 | * 17 | */ 18 | export function randCetacean( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/city.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './city.i18n.json'; 3 | 4 | /** 5 | * Generate a random city. 6 | * 7 | * @category Address 8 | * 9 | * @example 10 | * 11 | * randCity() 12 | * 13 | * @example 14 | * 15 | * randCity({ length: 10 }) 16 | * 17 | */ 18 | export function randCity( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/clothing-size.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["XXS", "XS", "S", "M", "L", "XL", "XXL"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/clothing-size.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './clothing-size.json'; 3 | 4 | /** 5 | * Generate a random clothing size. 6 | * 7 | * @category Commerce 8 | * 9 | * @example 10 | * 11 | * randClothingSize() 12 | * 13 | * @example 14 | * 15 | * randClothingSize({ length: 10 }) 16 | * 17 | */ 18 | export function randClothingSize( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/collection.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | 3 | /** 4 | * Generate a collection from a custom generators functions 5 | * 6 | * @category util 7 | * 8 | * @example 9 | * 10 | * toCollection(() => { 11 | * return { data: randNumber(); } 12 | * }) 13 | * 14 | * @example 15 | * 16 | * toCollection(() => { 17 | * return { data: randNumber(); } 18 | * }, { length: 10 }) // default is no length. 19 | * 20 | */ 21 | export function toCollection< 22 | Collection = never, 23 | Options extends FakeOptions = never 24 | >( 25 | generateCollection: (options?: Options) => Collection, 26 | options?: Options 27 | ): Collection | Collection[] { 28 | return fake( 29 | () => generateCollection(options), 30 | options 31 | ) as Collection | Collection[]; 32 | } 33 | -------------------------------------------------------------------------------- /packages/falso/src/lib/color.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './color.json'; 3 | 4 | /** 5 | * Generate a random color. 6 | * 7 | * @category colors 8 | * 9 | * @example 10 | * 11 | * randColor() 12 | * 13 | * @example 14 | * 15 | * randColor({ length: 10 }) 16 | * 17 | */ 18 | export function randColor( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/company-name.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './company-name.json'; 3 | 4 | /** 5 | * Generate a random company name. 6 | * 7 | * @category Company 8 | * 9 | * @example 10 | * 11 | * randCompanyName() 12 | * 13 | * @example 14 | * 15 | * randCompanyName({ length: 10 }) 16 | * 17 | */ 18 | export function randCompanyName( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/core/types.ts: -------------------------------------------------------------------------------- 1 | export type AZ = 2 | | 'A' 3 | | 'B' 4 | | 'C' 5 | | 'D' 6 | | 'E' 7 | | 'F' 8 | | 'G' 9 | | 'H' 10 | | 'I' 11 | | 'J' 12 | | 'K' 13 | | 'L' 14 | | 'M' 15 | | 'N' 16 | | 'O' 17 | | 'P' 18 | | 'Q' 19 | | 'R' 20 | | 'S' 21 | | 'T' 22 | | 'U' 23 | | 'V' 24 | | 'W' 25 | | 'X' 26 | | 'Y' 27 | | 'Z'; 28 | export type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'; 29 | export type AZ09 = AZ | Digit; 30 | -------------------------------------------------------------------------------- /packages/falso/src/lib/core/validators.ts: -------------------------------------------------------------------------------- 1 | export function isNil( 2 | value: T | null | undefined 3 | ): value is null | undefined { 4 | return value === null || typeof value === 'undefined'; 5 | } 6 | 7 | /** 8 | * Validates the Australian Business Number (ABN) 9 | * https://abr.business.gov.au/Help/AbnFormat 10 | * @param abnNumber the abn number to verify 11 | * @returns true if the abn is valid otherwise false 12 | */ 13 | export const isValidAbn = (abnNumber: string) => { 14 | const abn = abnNumber.replace(/ /g, ''); 15 | if (abn.length !== 11) return false; 16 | 17 | const weights = [10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19]; 18 | let weightedSum = 0; 19 | 20 | for (let i = 0; i < weights.length; i++) { 21 | weightedSum += (Number(String(abn[i])) - (i == 0 ? 1 : 0)) * weights[i]; 22 | } 23 | return weightedSum % 89 == 0; 24 | }; 25 | -------------------------------------------------------------------------------- /packages/falso/src/lib/country.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './country.json'; 3 | 4 | /** 5 | * Generate a random country. 6 | * 7 | * @category address 8 | * 9 | * @example 10 | * 11 | * randCountry() 12 | * 13 | * @example 14 | * 15 | * randCountry({ length: 10 }) 16 | * 17 | */ 18 | export function randCountry( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/county.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './county.json'; 3 | 4 | /** 5 | * Generate a random county. 6 | * 7 | * @category Address 8 | * 9 | * @example 10 | * 11 | * randCounty() 12 | * 13 | * @example 14 | * 15 | * randCounty({ length: 10 }) 16 | * 17 | */ 18 | export function randCounty( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/cow.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Hartón del Valle", 4 | "Pedit", 5 | "German Black Pied cattle", 6 | "Parda Alpina", 7 | "Dajal", 8 | "Raya", 9 | "Adamawa", 10 | "Blaarkop", 11 | "Doayo cattle", 12 | "Aulie-Ata", 13 | "North Bengal Grey", 14 | "Nguni", 15 | "Canaria", 16 | "Siri", 17 | "Breed", 18 | "Hallikar4", 19 | "Simmental", 20 | "Pie Rouge des Plaines" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/cow.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './cow.json'; 3 | 4 | /** 5 | * Generate a random cow. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randCow() 12 | * 13 | * @example 14 | * 15 | * randCow({ length: 10 }) 16 | * 17 | */ 18 | export function randCow( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/credit-card-brand.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "American Express", 4 | "T-Union", 5 | "UnionPay", 6 | "Diners Club", 7 | "Discover Card", 8 | "UkrCard", 9 | "RuPay", 10 | "InterPayment", 11 | "InstaPayment", 12 | "JCB", 13 | "Maestro UK", 14 | "Maestro", 15 | "Dankort", 16 | "Mir", 17 | "NPS Pridnestrovie", 18 | "Mastercard", 19 | "51–55", 20 | "Troy", 21 | "Visa", 22 | "Visa Electron", 23 | "UATP", 24 | "Verve" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /packages/falso/src/lib/credit-card-brand.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { data } from './credit-card-brand.json'; 3 | 4 | /** 5 | * Generate a random credit card brand. 6 | * 7 | * @category Finance 8 | * 9 | * @example 10 | * 11 | * randCreditCardBrand() 12 | * 13 | * @example 14 | * 15 | * randCreditCardBrand({ length: 10 }) 16 | * 17 | */ 18 | export function randCreditCardBrand( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/credit-card-cvv.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions, getRandomInRange } from './core/core'; 2 | 3 | /** 4 | * Generate a random credit card CVV. 5 | * 6 | * @category Finance 7 | * 8 | * @example 9 | * 10 | * randCreditCardCVV() 11 | * 12 | * @example 13 | * 14 | * randCreditCardCVV({ length: 10 }) 15 | * 16 | */ 17 | export function randCreditCardCVV( 18 | options?: Options 19 | ) { 20 | return fake( 21 | () => getRandomInRange({ min: 100, max: 999 }).toString(), 22 | options 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /packages/falso/src/lib/crocodilia.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Orinoco Crocodile", 4 | "Gharial", 5 | "Broad-snouted Caiman", 6 | "Saltwater Crocodile", 7 | "Black Caiman", 8 | "West African Crocodile", 9 | "Tomistoma", 10 | "Siamese Crocodile", 11 | "Philippine Crocodile", 12 | "Schneider’s Smooth-fronted Caiman", 13 | "Cuban Crocodile", 14 | "New Guinea Freshwater Crocodile", 15 | "Nile Crocodile", 16 | "American Crocodile", 17 | "Chinese Alligator", 18 | "Dwarf Crocodile", 19 | "Yacare Caiman", 20 | "African Slender-snouted Crocodile" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/crocodilia.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './crocodilia.json'; 3 | 4 | /** 5 | * Generate a random crocodilia. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randCrocodilia() 12 | * 13 | * @example 14 | * 15 | * randCrocodilia({ length: 10 }) 16 | * 17 | */ 18 | export function randCrocodilia( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/currency-code.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './currency-code.json'; 3 | 4 | /** 5 | * Generate a random currency code. 6 | * 7 | * @category finance 8 | * 9 | * @example 10 | * 11 | * randCurrencyCode() 12 | * 13 | * @example 14 | * 15 | * randCurrencyCode({ length: 10 }) 16 | * 17 | */ 18 | export function randCurrencyCode( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/currency-name.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './currency-name.json'; 3 | 4 | /** 5 | * Generate a random currency name. 6 | * 7 | * @category Finance 8 | * 9 | * @example 10 | * 11 | * randCurrencyName() 12 | * 13 | * @example 14 | * 15 | * randCurrencyName({ length: 10 }) 16 | * 17 | */ 18 | export function randCurrencyName( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/currency-symbol.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "B/.", 4 | "£", 5 | "Ls", 6 | "₡", 7 | "NT$", 8 | "лв", 9 | "$", 10 | "R", 11 | "Lt", 12 | "﷼", 13 | "kr", 14 | "KM", 15 | "៛", 16 | "Bs", 17 | "₹", 18 | "Q", 19 | "ƒ", 20 | "R$", 21 | "₨", 22 | "ден", 23 | "p.", 24 | "₺", 25 | "Дин.", 26 | "P", 27 | "RD$", 28 | "L", 29 | "Ft", 30 | "CHF", 31 | "₩", 32 | "Php", 33 | "S/.", 34 | "₭", 35 | "RM", 36 | "€", 37 | "Lek", 38 | "¥", 39 | "؋", 40 | "₦" 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /packages/falso/src/lib/currency-symbol.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './currency-symbol.json'; 3 | 4 | /** 5 | * Generate a random currency symbol. 6 | * 7 | * @category finance 8 | * 9 | * @example 10 | * 11 | * randCurrencySymbol() 12 | * 13 | * @example 14 | * 15 | * randCurrencySymbol({ length: 10 }) 16 | * 17 | */ 18 | export function randCurrencySymbol( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/database-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "utf8_unicode_ci", 4 | "cp1250_general_ci", 5 | "cp1250_bin", 6 | "utf8_general_ci", 7 | "ascii_general_ci", 8 | "utf8_bin", 9 | "ascii_bin" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /packages/falso/src/lib/database-collation.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './database-collation.json'; 3 | 4 | /** 5 | * Generate a random database collation. 6 | * 7 | * @category database 8 | * 9 | * @example 10 | * 11 | * randDatabaseCollation() 12 | * 13 | * @example 14 | * 15 | * randDatabaseCollation({ length: 10 }) 16 | * 17 | */ 18 | export function randDatabaseCollation( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/database-column.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "comment", 4 | "group", 5 | "password", 6 | "token", 7 | "phone", 8 | "title", 9 | "status", 10 | "id", 11 | "name", 12 | "updatedAt", 13 | "category", 14 | "email", 15 | "avatar", 16 | "createdAt" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /packages/falso/src/lib/database-column.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './database-column.json'; 3 | 4 | /** 5 | * Generate a random database column. 6 | * 7 | * @category database 8 | * 9 | * @example 10 | * 11 | * randDatabaseColumn() 12 | * 13 | * @example 14 | * 15 | * randDatabaseColumn({ length: 10 }) 16 | * 17 | */ 18 | export function randDatabaseColumn( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/database-engine.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["CSV", "ARCHIVE", "MyISAM", "MEMORY", "InnoDB", "BLACKHOLE"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/database-engine.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './database-engine.json'; 3 | 4 | /** 5 | * Generate a random database engine. 6 | * 7 | * @category database 8 | * 9 | * @example 10 | * 11 | * randDatabaseEngine() 12 | * 13 | * @example 14 | * 15 | * randDatabaseEngine({ length: 10 }) 16 | * 17 | */ 18 | export function randDatabaseEngine( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/database-type.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "tinyint", 4 | "date", 5 | "timestamp", 6 | "set", 7 | "datetime", 8 | "enum", 9 | "binary", 10 | "bigint", 11 | "point", 12 | "smallint", 13 | "text", 14 | "bit", 15 | "decimal", 16 | "varchar", 17 | "mediumint", 18 | "double", 19 | "time", 20 | "blob", 21 | "geometry", 22 | "boolean", 23 | "serial", 24 | "real", 25 | "float" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /packages/falso/src/lib/database-type.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './database-type.json'; 3 | 4 | /** 5 | * Generate a random database type. 6 | * 7 | * @category database 8 | * 9 | * @example 10 | * 11 | * randDatabaseType() 12 | * 13 | * @example 14 | * 15 | * randDatabaseType({ length: 10 }) 16 | * 17 | */ 18 | export function randDatabaseType( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/database.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Oracle", 4 | "MySQL", 5 | "Microsoft SQL Server", 6 | "PostgreSQL", 7 | "MongoDB", 8 | "IBM Db2", 9 | "Redis", 10 | "Elasticsearch", 11 | "Microsoft Access", 12 | "SQLite", 13 | "Cassandra", 14 | "Splunk", 15 | "MariaDB", 16 | "Teradata", 17 | "Hive", 18 | "Solr", 19 | "HBase", 20 | "FileMaker", 21 | "SAP HANA", 22 | "Amazon DynamoDB", 23 | "SAP Adaptive Server", 24 | "Neo4j", 25 | "Couchbase", 26 | "Memcached", 27 | "Microsoft Azure SQL Database" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /packages/falso/src/lib/database.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './database.json'; 3 | 4 | /** 5 | * Generate a random database. 6 | * 7 | * @category database 8 | * 9 | * @example 10 | * 11 | * randDatabase() 12 | * 13 | * @example 14 | * 15 | * randDatabase({ length: 10 }) 16 | * 17 | */ 18 | export function randDatabase( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/department.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Games", 4 | "Automotive", 5 | "Music", 6 | "Home", 7 | "Movies", 8 | "Health", 9 | "Sports", 10 | "Garden", 11 | "Baby", 12 | "Kids", 13 | "Toys", 14 | "Computers", 15 | "Clothing", 16 | "Outdoors", 17 | "Shoes", 18 | "Jewelery", 19 | "Industrial", 20 | "Electronics", 21 | "Tools", 22 | "Grocery", 23 | "Beauty", 24 | "Books" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /packages/falso/src/lib/department.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './department.json'; 3 | 4 | /** 5 | * Generate a random department. 6 | * 7 | * @category commerce 8 | * 9 | * @example 10 | * 11 | * randDepartment() 12 | * 13 | * @example 14 | * 15 | * randDepartment({ length: 10 }) 16 | * 17 | */ 18 | export function randDepartment( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/direction.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Southwest", 4 | "North", 5 | "Northeast", 6 | "Northwest", 7 | "South", 8 | "West", 9 | "East", 10 | "Southeast" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /packages/falso/src/lib/direction.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './direction.json'; 3 | 4 | /** 5 | * Generate a random direction. 6 | * 7 | * @category address 8 | * 9 | * @example 10 | * 11 | * randDirection() 12 | * 13 | * @example 14 | * 15 | * randDirection({ length: 10 }) 16 | * 17 | */ 18 | export function randDirection( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/directory-path.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './directory-path.json'; 3 | 4 | /** 5 | * Generate a random directory path. 6 | * 7 | * @category system 8 | * 9 | * @example 10 | * 11 | * randDirectoryPath() 12 | * 13 | * @example 14 | * 15 | * randDirectoryPath({ length: 10 }) 16 | * 17 | */ 18 | export function randDirectoryPath( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/dog.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Jack Russell Terrier", 4 | "Beauceron", 5 | "Denmark Feist", 6 | "Affenpinscher", 7 | "Kishu", 8 | "Boykin Spaniel", 9 | "English Toy Terrier", 10 | "Alaskan Malamute", 11 | "English Mastiff", 12 | "Maltese", 13 | "Croatian Sheepdog", 14 | "Garafian Shepherd", 15 | "Giant Schnauzer", 16 | "Austrian Black and Tan Hound", 17 | "Basset Fauve de Bretagne", 18 | "Pomeranian", 19 | "Nova Scotia Duck Tolling Retriever", 20 | "Hygen Hound", 21 | "Golden Retriever", 22 | "Doberman Pinscher", 23 | "French Poodle", 24 | "Siberian Husky", 25 | "Cocker Spaniel" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /packages/falso/src/lib/dog.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './dog.json'; 3 | 4 | /** 5 | * Generate a random dog. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randDog() 12 | * 13 | * @example 14 | * 15 | * randDog({ length: 10 }) 16 | * 17 | */ 18 | export function randDog( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/domain-name.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randDomainSuffix } from './domain-suffix'; 3 | import { randWord } from './word'; 4 | 5 | /** 6 | * Generate a random domain name. 7 | * 8 | * @category Internet 9 | * 10 | * @example 11 | * 12 | * randDomainName() 13 | * 14 | * @example 15 | * 16 | * randDomainName({ length: 10 }) 17 | * 18 | */ 19 | export function randDomainName( 20 | options?: Options 21 | ) { 22 | return fake(() => `${randWord()}.${randDomainSuffix()}`, options); 23 | } 24 | -------------------------------------------------------------------------------- /packages/falso/src/lib/domain-suffix.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["org", "biz", "com", "net", "name", "info", "io", "dev"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/domain-suffix.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './domain-suffix.json'; 3 | 4 | /** 5 | * Generate a random domain suffix. 6 | * 7 | * @category Internet 8 | * 9 | * @example 10 | * 11 | * randDomainSuffix() 12 | * 13 | * @example 14 | * 15 | * randDomainSuffix({ length: 10 }) 16 | * 17 | */ 18 | export function randDomainSuffix( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/drinks.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './drinks.json'; 3 | 4 | /** 5 | * Generate a random drink. 6 | * 7 | * @category drinks 8 | * 9 | * @example 10 | * 11 | * randDrinks() 12 | * 13 | * @example 14 | * 15 | * randDrinks({ length: 10 }) 16 | * 17 | */ 18 | export function randDrinks( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/email-provider.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './email-provider.json'; 3 | 4 | /** 5 | * Generate a random email provider. 6 | * 7 | * @category Internet 8 | * 9 | * @example 10 | * 11 | * randEmailProvider() 12 | * 13 | * @example 14 | * 15 | * randEmailProvider({ length: 10 }) 16 | * 17 | */ 18 | export function randEmailProvider( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/emoji.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './emoji.json'; 3 | 4 | /** 5 | * Generate a random emoji. 6 | * 7 | * @category text 8 | * 9 | * @example 10 | * 11 | * randEmoji() 12 | * 13 | * @example 14 | * 15 | * randEmoji({ length: 10 }) 16 | * 17 | */ 18 | export function randEmoji( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/ethereum-address.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './ethereum-address.json'; 3 | 4 | /** 5 | * Generate a random ethereum address. 6 | * 7 | * @category Finance 8 | * 9 | * @example 10 | * 11 | * randEthereumAddress() 12 | * 13 | * @example 14 | * 15 | * randEthereumAddress({ length: 10 }) 16 | * 17 | */ 18 | export function randEthereumAddress( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/file-ext.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './file-ext.json'; 3 | 4 | /** 5 | * Generate a random file ext. 6 | * 7 | * @category system 8 | * 9 | * @example 10 | * 11 | * randFileExt() 12 | * 13 | * @example 14 | * 15 | * randFileExt({ length: 10 }) 16 | * 17 | */ 18 | export function randFileExt( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/file-name.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions, randElement } from './core/core'; 2 | import { data } from './file-name.json'; 3 | 4 | interface FileNameOptions extends FakeOptions { 5 | extension?: string; 6 | } 7 | 8 | /** 9 | * Generate a random file name. 10 | * 11 | * @category system 12 | * 13 | * @example 14 | * 15 | * randFileName() 16 | * 17 | * @example 18 | * 19 | * randFileName({ length: 10 }) 20 | * 21 | */ 22 | export function randFileName( 23 | options?: Options 24 | ) { 25 | const ext = options?.extension ?? 'pdf'; 26 | 27 | return fake(() => `${randElement(data)}.${ext}`, options); 28 | } 29 | -------------------------------------------------------------------------------- /packages/falso/src/lib/file-path.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './file-path.json'; 3 | 4 | /** 5 | * Generate a random file path. 6 | * 7 | * @category system 8 | * 9 | * @example 10 | * 11 | * randFilePath() 12 | * 13 | * @example 14 | * 15 | * randFilePath({ length: 10 }) 16 | * 17 | */ 18 | export function randFilePath( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/file-type.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "model", 4 | "x-conference", 5 | "x-shader", 6 | "video", 7 | "application", 8 | "message", 9 | "multipart", 10 | "font", 11 | "audio", 12 | "image", 13 | "chemical", 14 | "text" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/falso/src/lib/file-type.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './file-type.json'; 3 | 4 | /** 5 | * Generate a random file type. 6 | * 7 | * @category system 8 | * 9 | * @example 10 | * 11 | * randFileType() 12 | * 13 | * @example 14 | * 15 | * randFileType({ length: 10 }) 16 | * 17 | */ 18 | export function randFileType( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/fish.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Araucanian herring", 4 | "Pacific saury", 5 | "Indian oil sardine", 6 | "Nile tilapia", 7 | "Bombay-duck", 8 | "Japanese common catfish", 9 | "Whiteleg shrimp", 10 | "Haddock", 11 | "Chilean jack mackerel", 12 | "Pollock", 13 | "Southern rough shrimp", 14 | "Amur catfish", 15 | "Largehead hairtail", 16 | "Gazami crab", 17 | "Silver carp", 18 | "Blue whiting", 19 | "Pacific thread herring", 20 | "Pacific anchoveta" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/fish.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './fish.json'; 3 | 4 | /** 5 | * Generate a random fish. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randFish() 12 | * 13 | * @example 14 | * 15 | * randFish({ length: 10 }) 16 | * 17 | */ 18 | export function randFish( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/font-family.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './font-family.json'; 3 | 4 | /** 5 | * Generate a random font family. 6 | * 7 | * @category code 8 | * 9 | * @example 10 | * 11 | * randFontFamily() 12 | * 13 | * @example 14 | * 15 | * randFontFamily({ length: 10 }) 16 | * 17 | */ 18 | export function randFontFamily( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/football-team.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './football-team.json'; 3 | 4 | /** 5 | * Generate a random football team. 6 | * 7 | * @category sports 8 | * 9 | * @example 10 | * 11 | * randFootballTeam() 12 | * 13 | * @example 14 | * 15 | * randFootballTeam({ length: 10 }) 16 | * 17 | */ 18 | export function randFootballTeam( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/frequency.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "always", 4 | "constantly", 5 | "usually", 6 | "normally", 7 | "frequently", 8 | "regularly", 9 | "often", 10 | "sometimes", 11 | "occasionally", 12 | "rarely", 13 | "infrequently", 14 | "seldom", 15 | "hardly", 16 | "never", 17 | "hourly", 18 | "daily", 19 | "weekly", 20 | "monthly", 21 | "yearly", 22 | "once", 23 | "twice" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /packages/falso/src/lib/frequency.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './frequency.json'; 3 | 4 | /** 5 | * Generate a random adverb for definite or indefinite frequency. 6 | * 7 | * @category date 8 | * 9 | * @example 10 | * 11 | * randFrequency() 12 | * 13 | * @example 14 | * 15 | * randFrequency({ length: 10 }) 16 | * 17 | */ 18 | export function randFrequency( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/gender-code.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Andro", 4 | "Bi", 5 | "Pan", 6 | "F", 7 | "M", 8 | "Cis", 9 | "Cis M", 10 | "Cis W", 11 | "Cis F", 12 | "Demi", 13 | "T*", 14 | "T F", 15 | "GV", 16 | "T M", 17 | "T*M", 18 | "T*W", 19 | "Non-bi", 20 | "Poly", 21 | "M2F", 22 | "M2FT", 23 | "Ace", 24 | "W", 25 | "Other", 26 | "NC", 27 | "Q", 28 | "TC", 29 | "TGNC", 30 | "FTM", 31 | "GSM" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /packages/falso/src/lib/gender.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { data as gender } from './gender.json'; 3 | import { data as genderCode } from './gender-code.json'; 4 | 5 | interface GenderOptions extends FakeOptions { 6 | code?: boolean; 7 | } 8 | 9 | /** 10 | * Generate a random gender. 11 | * 12 | * @category person 13 | * 14 | * @example 15 | * 16 | * randGender() 17 | * 18 | * @example 19 | * 20 | * randGender({ length: 10 }) 21 | * 22 | * @example 23 | * 24 | * randGender({ code: true }) // default is false 25 | * 26 | */ 27 | export function randGender( 28 | options?: Options 29 | ) { 30 | return fake(options?.code ? genderCode : gender, options); 31 | } 32 | -------------------------------------------------------------------------------- /packages/falso/src/lib/git-branch.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "protocol-navigate", 4 | "array-quantify", 5 | "transmitter-override", 6 | "circuit-compress", 7 | "feed-program", 8 | "microchip-parse", 9 | "feed-quantify", 10 | "card-synthesize", 11 | "bus-reboot", 12 | "application-input", 13 | "firewall-generate", 14 | "monitor-transmit", 15 | "sensor-parse", 16 | "port-compress", 17 | "interface-reboot", 18 | "capacitor-program", 19 | "monitor-quantify", 20 | "transmitter-input" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/git-branch.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './git-branch.json'; 3 | 4 | /** 5 | * Generate a random git branch. 6 | * 7 | * @category git 8 | * 9 | * @example 10 | * 11 | * randGitBranch() 12 | * 13 | * @example 14 | * 15 | * randGitBranch({ length: 10 }) 16 | * 17 | */ 18 | export function randGitBranch( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/git-commit-entry.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randGitCommitSha } from './git-commit-sha'; 3 | import { randFullName } from './full-name'; 4 | import { randEmail } from './email'; 5 | import { randGitCommitMessage } from './git-commit-message'; 6 | 7 | /** 8 | * Generate a random git commit. 9 | * 10 | * @category git 11 | * 12 | * @example 13 | * 14 | * randGitCommitEntry() 15 | * 16 | * @example 17 | * 18 | * randGitCommitEntry({ length: 10 }) 19 | * 20 | */ 21 | export function randGitCommitEntry( 22 | options?: Options 23 | ) { 24 | return fake(() => { 25 | return `commit ${randGitCommitSha()}\\r\\nAuthor: ${randFullName()} <${randEmail()}>\\r\\nDate: ${new Date().toString()}\\r\\n\\r\\n${randGitCommitMessage()}`; 26 | }, options); 27 | } 28 | -------------------------------------------------------------------------------- /packages/falso/src/lib/git-commit-message.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randNumber } from './number'; 3 | import { randWord } from './word'; 4 | 5 | /** 6 | * Generate a random git message. 7 | * 8 | * @category git 9 | * 10 | * @example 11 | * 12 | * randGitCommitMessage() 13 | * 14 | * @example 15 | * 16 | * randGitCommitMessage({ length: 10 }) 17 | * 18 | */ 19 | export function randGitCommitMessage( 20 | options?: Options 21 | ) { 22 | return fake(() => { 23 | const words = []; 24 | 25 | for (let i = 0; i < randNumber({ min: 2, max: 5 }); i++) { 26 | words.push(randWord()); 27 | } 28 | 29 | return words.join(' '); 30 | }, options); 31 | } 32 | -------------------------------------------------------------------------------- /packages/falso/src/lib/git-commit-sha.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randHexaDecimal } from './hexa-decimal'; 3 | 4 | export function gitShaGenerator(len: number) { 5 | return () => { 6 | let sha = ''; 7 | 8 | for (let i = 0; i < len; i++) { 9 | sha += randHexaDecimal(); 10 | } 11 | 12 | return sha; 13 | }; 14 | } 15 | 16 | const commitShaLen = 40; 17 | 18 | /** 19 | * Generate a random git sha. 20 | * 21 | * @category git 22 | * 23 | * @example 24 | * 25 | * randGitCommitSha() 26 | * 27 | * @example 28 | * 29 | * randGitCommitSha({ length: 10 }) 30 | * 31 | */ 32 | export function randGitCommitSha( 33 | options?: Options 34 | ) { 35 | return fake(gitShaGenerator(commitShaLen), options); 36 | } 37 | -------------------------------------------------------------------------------- /packages/falso/src/lib/git-short-sha.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { gitShaGenerator } from './git-commit-sha'; 3 | 4 | const commitShortShaLen = 7; 5 | 6 | /** 7 | * Generate a random git short sha. 8 | * 9 | * @category git 10 | * 11 | * @example 12 | * 13 | * randGitShortSha() 14 | * 15 | * @example 16 | * 17 | * randGitShortSha({ length: 10 }) 18 | * 19 | */ 20 | export function randGitShortSha( 21 | options?: Options 22 | ) { 23 | return fake(gitShaGenerator(commitShortShaLen), options); 24 | } 25 | -------------------------------------------------------------------------------- /packages/falso/src/lib/hex.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { random } from './random'; 3 | 4 | /** 5 | * Generate a random hex. 6 | * 7 | * @category colors 8 | * 9 | * @example 10 | * 11 | * randHex() 12 | * 13 | * @example 14 | * 15 | * randHex({ length: 10 }) 16 | * 17 | */ 18 | export function randHex( 19 | options?: Options 20 | ) { 21 | return fake(() => `#${random().toString(16).substr(2, 6)}`, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/hexa-decimal.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randNumber } from './number'; 3 | 4 | function generator() { 5 | return randNumber({min:0, max:15}).toString(16); 6 | } 7 | 8 | /** 9 | * Generate a random hexa decimal. 10 | * 11 | * @category system 12 | * 13 | * @example 14 | * 15 | * randHexaDecimal() 16 | * 17 | * @example 18 | * 19 | * randHexaDecimal({ length: 10 }) 20 | * 21 | */ 22 | export function randHexaDecimal( 23 | options?: Options 24 | ) { 25 | return fake(generator, options); 26 | } 27 | -------------------------------------------------------------------------------- /packages/falso/src/lib/horse.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Pottok", 4 | "Dutch Heavy Draft", 5 | "Spanish Barb", 6 | "Russian Heavy Draft", 7 | "American Saddlebred", 8 | "Camarillo White Horse", 9 | "Karachai Horse", 10 | "Andalusian Horse", 11 | "Poitevin Horse", 12 | "Colorado Ranger", 13 | "Paso Fino", 14 | "Swiss Warmblood", 15 | "Murgese", 16 | "Selle Français", 17 | "Riwoche Horse", 18 | "French Trotter", 19 | "American Indian Horse", 20 | "Jeju Horse" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/horse.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './horse.json'; 3 | 4 | /** 5 | * Generate a random horse. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randHorse() 12 | * 13 | * @example 14 | * 15 | * randHorse({ length: 10 }) 16 | * 17 | */ 18 | export function randHorse( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/http-method.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["GET", "POST", "PUT", "PATCH", "DELETE"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/http-method.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './http-method.json'; 3 | 4 | /** 5 | * Generate a random http method. 6 | * 7 | * @category internet 8 | * 9 | * @example 10 | * 11 | * randHttpMethod() 12 | * 13 | * @example 14 | * 15 | * randHttpMethod({ length: 10 }) 16 | * 17 | */ 18 | export function randHttpMethod( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngneat/falso/449ee5470ae52c973f7e4b487620d23e5e38686d/packages/falso/src/lib/i18n/.gitkeep -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/ar/bird.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "الفالروب ذو العنق الأحمر", 4 | "كليف سوالو", 5 | "هازجة مقنع", 6 | "البوشارد المشترك", 7 | "سكوتس أوريول", 8 | "القطرس الأسود", 9 | "ببغاء الراهب", 10 | "الطائر الطنان الرائع", 11 | "ساندبيبر واسع الفاتورة", 12 | "بوشتيت", 13 | "المكسيكي جاي", 14 | "مرغانسر المقنع", 15 | "وود ستورك", 16 | "روس نورس", 17 | "جرين ساندبيبر", 18 | "الديكي رافعة" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/ar/bird.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './bird.i18n.json'; 3 | 4 | /** 5 | * Generate a random bird. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBird() 12 | * 13 | * @example 14 | * 15 | * randBird({ length: 10 }) 16 | * 17 | */ 18 | export function randBird( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/ar/index.ts: -------------------------------------------------------------------------------- 1 | export { randBird } from './bird'; 2 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/de/bird.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Rothals-Phalarope", 4 | "Klippenschwalbe", 5 | "Unechte Karett-Königsdrossel", 6 | "Aztekendrossel", 7 | "Kapuzenrohrsänger", 8 | "Gewöhnliche Tafelente", 9 | "Schottischer Pirol", 10 | "Schwarzbrauen-Albatros", 11 | "Mönchsittich", 12 | "Großartiger Kolibri", 13 | "Breitschnabelstrandläufer", 14 | "Bushtit", 15 | "Mexikanischer Jay", 16 | "Kapuzenmerganser", 17 | "Waldstorch", 18 | "Ross Möwe", 19 | "Grüner Flussuferläufer", 20 | "Schreikranich" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/de/bird.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './bird.i18n.json'; 3 | 4 | /** 5 | * Generate a random bird. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBird() 12 | * 13 | * @example 14 | * 15 | * randBird({ length: 10 }) 16 | * 17 | */ 18 | export function randBird( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/de/city.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './city.i18n.json'; 3 | 4 | /** 5 | * Generate a random city. 6 | * 7 | * @category Address 8 | * 9 | * @example 10 | * 11 | * randCity() 12 | * 13 | * @example 14 | * 15 | * randCity({ length: 10 }) 16 | * 17 | */ 18 | export function randCity( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/de/index.ts: -------------------------------------------------------------------------------- 1 | export { randBird } from './bird'; 2 | export { randState } from './state'; 3 | export { randStateAbbr } from './state-abbr'; 4 | export { randCity } from './city'; 5 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/de/state-abbr.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "BW", 4 | "BY", 5 | "BE", 6 | "BB", 7 | "HB", 8 | "HH", 9 | "HE", 10 | "NI", 11 | "MV", 12 | "NW", 13 | "RP", 14 | "SL", 15 | "SN", 16 | "ST", 17 | "SH", 18 | "TH" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/de/state-abbr.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './state-abbr.i18n.json'; 3 | 4 | /** 5 | * Generate a random state abbr. 6 | * 7 | * @category address 8 | * 9 | * @example 10 | * 11 | * randStateAbbr() 12 | * 13 | * @example 14 | * 15 | * randStateAbbr({ length: 10 }) 16 | * 17 | */ 18 | export function randStateAbbr( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/de/state.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Baden-Württemberg", 4 | "Bavaria", 5 | "Berlin", 6 | "Brandenburg", 7 | "Bremen", 8 | "Hamburg", 9 | "Hesse", 10 | "Mecklenburg-Vorpommern", 11 | "Lower Saxony", 12 | "North Rhine-Westphalia", 13 | "Rhineland-Palatinate", 14 | "Saarland", 15 | "Saxony-Anhalt", 16 | "Saxony", 17 | "Schleswig-Holstein", 18 | "Thuringia" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/de/state.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './state.i18n.json'; 3 | 4 | /** 5 | * Generate a random state. 6 | * 7 | * @category address 8 | * 9 | * @example 10 | * 11 | * randState() 12 | * 13 | * @example 14 | * 15 | * randState({ length: 10 }) 16 | * 17 | */ 18 | export function randState( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/es/bird.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Punakaelaline phalarope", 4 | "Kaljupääsuke", 5 | "Loggerhead Kingbird", 6 | "Asteekide rästas", 7 | "Kaupottsinn", 8 | "Tavaline Pochard", 9 | "Scotts Oriole", 10 | "Mustakulmuga Albatross", 11 | "Munk parakeet", 12 | "Suurepärane koolibri", 13 | "Broad-billed Sandpiper", 14 | "Bushtit", 15 | "Mehhiko Jay", 16 | "Kauutsiga merikann", 17 | "puu-toonekurg", 18 | "Rossi kajakas", 19 | "Roheline liivapiisk", 20 | "Kraana" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/es/bird.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './bird.i18n.json'; 3 | 4 | /** 5 | * Generate a random bird. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBird() 12 | * 13 | * @example 14 | * 15 | * randBird({ length: 10 }) 16 | * 17 | */ 18 | export function randBird( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/es/index.ts: -------------------------------------------------------------------------------- 1 | export { randBird } from './bird'; 2 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/fr/bird.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Phalarope à bec étroit", 4 | "Hirondelle des falaises", 5 | "Tyran caouanne", 6 | "Grive aztèque", 7 | "Paruline à capuchon", 8 | "Milouin commun", 9 | "L'Oriole de Scott", 10 | "Albatros à sourcils noirs", 11 | "Perruche Moine", 12 | "Magnifique Colibri", 13 | "Bécasseau à large bec", 14 | "Mésange buissonnière", 15 | "Geai mexicain", 16 | "Harle à capuchon", 17 | "Cigogne des bois", 18 | "Mouette rosée", 19 | "Bécasseau vert", 20 | "Grue blanche" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/fr/bird.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './bird.i18n.json'; 3 | 4 | /** 5 | * Generate a random bird. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBird() 12 | * 13 | * @example 14 | * 15 | * randBird({ length: 10 }) 16 | * 17 | */ 18 | export function randBird( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/fr/index.ts: -------------------------------------------------------------------------------- 1 | export { randBird } from './bird'; 2 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/accessory.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './accessory.i18n.json'; 3 | 4 | /** 5 | * Generate a random accessory. 6 | * 7 | * @category Commerce 8 | * 9 | * @example 10 | * 11 | * randAccessory() 12 | * 13 | * @example 14 | * 15 | * randAccessory({ length: 10 }) 16 | * 17 | */ 18 | export function randAccessory( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/airline.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './airline.i18n.json'; 3 | 4 | /** 5 | * Generate a random airline. 6 | * 7 | * @category flight 8 | * 9 | * @example 10 | * 11 | * randAirline() 12 | * 13 | * @example 14 | * 15 | * randAirline({ length: 10 }) 16 | * 17 | */ 18 | export function randAirline( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/airport.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './airport.i18n.json'; 3 | 4 | export interface Airport { 5 | name: string; 6 | code: string; 7 | city: string; 8 | country: string; 9 | } 10 | 11 | /** 12 | * Generate a random airport. 13 | * 14 | * @category flight 15 | * 16 | * @example 17 | * 18 | * randAirport() 19 | * 20 | * @example 21 | * 22 | * randAirport({ length: 10 }) 23 | * 24 | */ 25 | export function randAirport( 26 | options?: Options 27 | ) { 28 | return fake(data, options); 29 | } 30 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/american-football-team.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './american-football-team.i18n.json'; 3 | 4 | /** 5 | * Generate a random american football team. 6 | * 7 | * @category sports 8 | * 9 | * @example 10 | * 11 | * randAmericanFootballTeam() 12 | * 13 | * @example 14 | * 15 | * randAmericanFootballTeam({ length: 10 }) 16 | * 17 | */ 18 | export function randAmericanFootballTeam( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/animal-type.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "ציפור", 4 | "לווייתנאי", 5 | "ארנב", 6 | "דוב", 7 | "חתול", 8 | "נחש", 9 | "פרה", 10 | "חרק", 11 | "תנין", 12 | "סוס", 13 | "דג", 14 | "כלב", 15 | "אריה" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/animal-type.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './animal-type.i18n.json'; 3 | 4 | /** 5 | * Generate a random animal type. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randAnimalType() 12 | * 13 | * @example 14 | * 15 | * randAnimalType({ length: 10 }) 16 | * 17 | */ 18 | export function randAnimalType( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/animal.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './animal.i18n.json'; 3 | 4 | /** 5 | * Generate a random animal. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randAnimal() 12 | * 13 | * @example 14 | * 15 | * randAnimal({ length: 10 }) 16 | * 17 | */ 18 | export function randAnimal( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/baseball-team.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './baseball-team.18n.json'; 3 | 4 | /** 5 | * Generate a random baseball team. 6 | * 7 | * @category sports 8 | * 9 | * @example 10 | * 11 | * randBaseballTeam() 12 | * 13 | * @example 14 | * 15 | * randBaseballTeam({ length: 10 }) 16 | * 17 | */ 18 | export function randBaseballTeam( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/bear.18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "דוב משקפיים", 4 | "דוב חום", 5 | "דוב שחור אסייתי", 6 | "דוב שמש", 7 | "דוב קוטב", 8 | "פנדה ענק", 9 | "דוב עצלן", 10 | "דוב שחור אמריקאי" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/bear.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './bear.18n.json'; 3 | 4 | /** 5 | * Generate a random bear. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBear() 12 | * 13 | * @example 14 | * 15 | * randBear({ length: 10 }) 16 | * 17 | */ 18 | export function randBear( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/bird.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "פלרופוס צוואר-אדום", 4 | "סנונית מצוקים", 5 | "טירן ראש-גדול", 6 | "קיכלי אצטקית", 7 | "סבכי מצויץ", 8 | "צולל מצוי", 9 | "אוריול סקוט", 10 | "אלבטרוס גבה-שחור", 11 | "תוכי נזירי", 12 | "קוליברי מפואר", 13 | "חופמי מקור-רחב", 14 | "ירגזי שיחים", 15 | "עורבני מקסיקני", 16 | "מרגון מצויץ", 17 | "חסידה יערנית", 18 | "שחף רוס", 19 | "ביצנית ירוקת-רגל", 20 | "עגור צווח" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/bird.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './bird.i18n.json'; 3 | 4 | /** 5 | * Generate a random bird. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBird() 12 | * 13 | * @example 14 | * 15 | * randBird({ length: 10 }) 16 | * 17 | */ 18 | export function randBird( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/brand.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './brand.18n.json'; 3 | 4 | /** 5 | * Generate a random brand. 6 | * 7 | * @category company 8 | * 9 | * @example 10 | * 11 | * randBrand() 12 | * 13 | * @example 14 | * 15 | * randBrand({ length: 10 }) 16 | * 17 | */ 18 | export function randBrand( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/cardinal-direction.18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["מזרח", "דרום", "מערב", "צפון"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/cardinal-direction.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './cardinal-direction.18n.json'; 3 | 4 | /** 5 | * Generate a random cardinal direction. 6 | * 7 | * @category address 8 | * 9 | * @example 10 | * 11 | * randCardinalDirection() 12 | * 13 | * @example 14 | * 15 | * randCardinalDirection({ length: 10 }) 16 | * 17 | */ 18 | export function randCardinalDirection( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/clothing-size.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["קטן מאוד מאוד", "קטן מאוד", "קטן", "בינוני", "גדול", "גדול מאוד", "גדול מאוד מאוד"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/clothing-size.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './clothing-size.i18n.json'; 3 | 4 | /** 5 | * Generate a random clothing size. 6 | * 7 | * @category fashion 8 | * 9 | * @example 10 | * 11 | * randClothingSize() 12 | * 13 | * @example 14 | * 15 | * randClothingSize({ length: 10 }) 16 | * 17 | */ 18 | export function randClothingSize( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/first-name.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "אברהם", 4 | "יצחק", 5 | "יעקב", 6 | "שרה", 7 | "רבקה", 8 | "רחל", 9 | "משה", 10 | "דוד", 11 | "שלמה", 12 | "רות", 13 | "אסתר", 14 | "דניאל", 15 | "יוסף", 16 | "מרים", 17 | "חנה", 18 | "נעמי", 19 | "יהושע", 20 | "שמואל", 21 | "עמוס", 22 | "תמר" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/first-name.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './first-name.i18n.json'; 3 | 4 | /** 5 | * Generate a random first name. 6 | * 7 | * @category person 8 | * 9 | * @example 10 | * 11 | * randFirstName() 12 | * 13 | * @example 14 | * 15 | * randFirstName({ length: 10 }) 16 | * 17 | */ 18 | export function randFirstName( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/food.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "פלאפל", 4 | "חומוס", 5 | "שקשוקה", 6 | "מצות", 7 | "גפילטע פיש", 8 | "קוגל", 9 | "חלה", 10 | "בורקס", 11 | "סביח", 12 | "מלאווח", 13 | "ג'חנון", 14 | "קובה", 15 | "פסטל", 16 | "שניצל", 17 | "פיתה", 18 | "לאפה", 19 | "טחינה", 20 | "חציל", 21 | "סלט ירקות", 22 | "קוסקוס" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/food.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './food.i18n.json'; 3 | 4 | /** 5 | * Generate a random food item. 6 | * 7 | * @category food 8 | * 9 | * @example 10 | * 11 | * randFood() 12 | * 13 | * @example 14 | * 15 | * randFood({ length: 10 }) 16 | * 17 | */ 18 | export function randFood( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/gender.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "זכר", 4 | "נקבה", 5 | "לא בינארי", 6 | "ג'נדרקוויר", 7 | "טרנסג'נדר", 8 | "סיסג'נדר", 9 | "אגנדר", 10 | "ביג'נדר", 11 | "ג'נדרפלואיד", 12 | "אינטרסקס" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/gender.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './gender.i18n.json'; 3 | 4 | /** 5 | * Generate a random gender. 6 | * 7 | * @category person 8 | * 9 | * @example 10 | * 11 | * randGender() 12 | * 13 | * @example 14 | * 15 | * randGender({ length: 10 }) 16 | * 17 | */ 18 | export function randGender( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/horse.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "סוס ערבי", 4 | "סוס פוני", 5 | "סוס אפלוסה", 6 | "סוס פריזי", 7 | "סוס מוסטנג", 8 | "סוס קלידסדייל", 9 | "סוס שייר", 10 | "סוס אנדלוסי", 11 | "סוס טרוטר אמריקאי", 12 | "סוס קוורטר" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/horse.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './horse.i18n.json'; 3 | 4 | /** 5 | * Generate a random horse breed. 6 | * 7 | * @category animal 8 | * 9 | * @example 10 | * 11 | * randHorse() 12 | * 13 | * @example 14 | * 15 | * randHorse({ length: 10 }) 16 | * 17 | */ 18 | export function randHorse( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/language.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "עברית", 4 | "אנגלית", 5 | "ערבית", 6 | "רוסית", 7 | "צרפתית", 8 | "ספרדית", 9 | "גרמנית", 10 | "איטלקית", 11 | "יידיש", 12 | "אמהרית" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/language.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './language.i18n.json'; 3 | 4 | /** 5 | * Generate a random language. 6 | * 7 | * @category address 8 | * 9 | * @example 10 | * 11 | * randLanguage() 12 | * 13 | * @example 14 | * 15 | * randLanguage({ length: 10 }) 16 | * 17 | */ 18 | export function randLanguage( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/last-name.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "כהן", 4 | "לוי", 5 | "מזרחי", 6 | "פרץ", 7 | "ביטון", 8 | "אברהם", 9 | "פרידמן", 10 | "אגבאריה", 11 | "מלכה", 12 | "אזולאי", 13 | "דהן", 14 | "אוחיון", 15 | "חדד", 16 | "עמר", 17 | "אלון", 18 | "לביא", 19 | "שלום", 20 | "גבאי", 21 | "יוסף", 22 | "שמעון" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/last-name.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './last-name.i18n.json'; 3 | 4 | /** 5 | * Generate a random last name. 6 | * 7 | * @category person 8 | * 9 | * @example 10 | * 11 | * randLastName() 12 | * 13 | * @example 14 | * 15 | * randLastName({ length: 10 }) 16 | * 17 | */ 18 | export function randLastName( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/person-title.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["מר", "גב'", "ד\"ר", "פרופ'", "עו\"ד", "רו\"ח", "הרב", "אדון", "גברת", "אינג'"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/person-title.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './person-title.i18n.json'; 3 | 4 | /** 5 | * Generate a random person title. 6 | * 7 | * @category person 8 | * 9 | * @example 10 | * 11 | * randPersonTitle() 12 | * 13 | * @example 14 | * 15 | * randPersonTitle({ length: 10 }) 16 | * 17 | */ 18 | export function randPersonTitle( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/pronoun.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["הוא/שלו", "היא/שלה", "הם/שלהם", "הן/שלהן", "זה/שלו", "זו/שלה"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/pronoun.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './pronoun.i18n.json'; 3 | 4 | /** 5 | * Generate a random pronoun. 6 | * 7 | * @category person 8 | * 9 | * @example 10 | * 11 | * randPronoun() 12 | * 13 | * @example 14 | * 15 | * randPronoun({ length: 10 }) 16 | * 17 | */ 18 | export function randPronoun( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/weekday.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "ראשון", 4 | "שני", 5 | "שלישי", 6 | "רביעי", 7 | "חמישי", 8 | "שישי", 9 | "שבת" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/he/weekday.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './weekday.i18n.json'; 3 | 4 | /** 5 | * Generate a random weekday. 6 | * 7 | * @category date 8 | * 9 | * @example 10 | * 11 | * randWeekday() 12 | * 13 | * @example 14 | * 15 | * randWeekday({ length: 10 }) 16 | * 17 | */ 18 | export function randWeekday( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/hi/bird.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "लाल गर्दन वाले फलारोप", 4 | "क्लिफ निगल", 5 | "लकड़हारा किंगबर्ड", 6 | "एज़्टेक थ्रश", 7 | "हुडेड वार्बलर", 8 | "आम पोचार्ड", 9 | "स्कॉट्स ओरिओल", 10 | "ब्लैक-ब्रोएड अल्बाट्रॉस", 11 | "भिक्षु तोता", 12 | "शानदार हमिंगबर्ड", 13 | "ब्रॉड-बिल सैंडपाइपर", 14 | "बुश्तिट", 15 | "मैक्सिकन जे", 16 | "हुडेड मर्जर", 17 | "लकड़ी सारस", 18 | "रॉस गल", 19 | "ग्रीन सैंडपाइपर", 20 | "काली क्रेन" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/hi/bird.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './bird.i18n.json'; 3 | 4 | /** 5 | * Generate a random bird. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBird() 12 | * 13 | * @example 14 | * 15 | * randBird({ length: 10 }) 16 | * 17 | */ 18 | export function randBird( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/hi/index.ts: -------------------------------------------------------------------------------- 1 | export { randBird } from './bird'; 2 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/ko/bird.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "지느러미발도요", 4 | "삼색제비", 5 | "때까치", 6 | "아즈텍 개똥지빠귀", 7 | "미국솔새", 8 | "붉은머리검은가슴", 9 | "꾀꼬리", 10 | "검은눈썹 알바트로스", 11 | "몽크 잉꼬", 12 | "웅장한 벌새", 13 | "송곳부리도요", 14 | "곤줄박이", 15 | "멕시코 어치", 16 | "관머리비오리", 17 | "우드스토크", 18 | "쇠목테갈매기", 19 | "삑삑도요", 20 | "미국흰두루미" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/ko/bird.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './bird.i18n.json'; 3 | 4 | /** 5 | * Generate a random bird. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBird() 12 | * 13 | * @example 14 | * 15 | * randBird({ length: 10 }) 16 | * 17 | */ 18 | export function randBird( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/ko/index.ts: -------------------------------------------------------------------------------- 1 | export { randBird } from './bird'; 2 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/pt-br/bird.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Arara Azul", 4 | "Arara-vermelha", 5 | "Ararinha-azul", 6 | "Calopsita", 7 | "Canário", 8 | "Beija-flor", 9 | "Bem-te-vi", 10 | "Coruja", 11 | "Corrupião", 12 | "Curió", 13 | "Ema", 14 | "Falcão", 15 | "Garça", 16 | "João-de-barro", 17 | "Papagaio", 18 | "Pardal", 19 | "Periquito", 20 | "Pomba", 21 | "Quero-quero", 22 | "Rolinha", 23 | "Sabiá", 24 | "Tucano", 25 | "Tuiuiú", 26 | "Urubu" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/pt-br/bird.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './bird.i18n.json'; 3 | 4 | /** 5 | * Generate a random bird. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBird() 12 | * 13 | * @example 14 | * 15 | * randBird({ length: 10 }) 16 | * 17 | */ 18 | export function randBird( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/pt-br/index.ts: -------------------------------------------------------------------------------- 1 | export { randBird } from './bird'; 2 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/ru/bird.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Красношейный плавунчик", 4 | "Клифф Ласточка", 5 | "Логгерхед Кингбёрд", 6 | "Ацтекский дрозд", 7 | "Сырковая камышевка", 8 | "Обыкновенный нырок", 9 | "Скоттс Ориол", 10 | "Чернобровый альбатрос", 11 | "Монах-попугай", 12 | "Великолепный колибри", 13 | "Кулик ширококлювый", 14 | "Буштит", 15 | "Мексиканская сойка", 16 | "Крылья с капюшоном", 17 | "Лесной аист", 18 | "Росс Чайка", 19 | "Зеленый кулик", 20 | "Американский журавль" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/ru/bird.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './bird.i18n.json'; 3 | 4 | /** 5 | * Generate a random bird. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBird() 12 | * 13 | * @example 14 | * 15 | * randBird({ length: 10 }) 16 | * 17 | */ 18 | export function randBird( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/ru/index.ts: -------------------------------------------------------------------------------- 1 | export { randBird } from './bird'; 2 | export { data as randFirstNameLocale } from './first-name.i18n.json'; 3 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/se/bird.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Falaropo de cuello rojo", 4 | "Golondrina de acantilado", 5 | "Tirador boba", 6 | "Zordo Azteca", 7 | "Reinita encapuchada", 8 | "Porrón Común", 9 | "Oriol escocés", 10 | "Albatros de ceja negra", 11 | "Perico monje", 12 | "Magnífico Colibrí", 13 | "Lavandera pico ancho", 14 | "Bushtit", 15 | "Jay mexicano", 16 | "Pollo de agua encapuchado", 17 | "cigüeña de madera", 18 | "gaviota rosss", 19 | "Lavandera verde", 20 | "Grulla blanca" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/se/bird.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './bird.i18n.json'; 3 | 4 | /** 5 | * Generate a random bird. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBird() 12 | * 13 | * @example 14 | * 15 | * randBird({ length: 10 }) 16 | * 17 | */ 18 | export function randBird( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/se/index.ts: -------------------------------------------------------------------------------- 1 | export { randBird } from './bird'; 2 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/zh/bird.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "红颈蝴蝶结", 4 | "悬崖燕子", 5 | "赤蠵王鸟", 6 | "阿兹特克画眉", 7 | "头巾莺", 8 | "普通潜鸭", 9 | "斯科特金莺", 10 | "黑眉信天翁", 11 | "和尚鹦鹉", 12 | "壮丽的蜂鸟", 13 | "大嘴鹬", 14 | "布什蒂特", 15 | "墨西哥杰", 16 | "蒙面秋沙鸭", 17 | "木鹳", 18 | "罗斯海鸥", 19 | "绿鹬", 20 | "鸣鹤" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/zh/bird.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from '../../core/core'; 2 | import { data } from './bird.i18n.json'; 3 | 4 | /** 5 | * Generate a random bird. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randBird() 12 | * 13 | * @example 14 | * 15 | * randBird({ length: 10 }) 16 | * 17 | */ 18 | export function randBird( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/i18n/zh/index.ts: -------------------------------------------------------------------------------- 1 | export { randBird } from './bird'; 2 | -------------------------------------------------------------------------------- /packages/falso/src/lib/ice-hockey-team.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './ice-hockey-team.json'; 3 | 4 | /** 5 | * Generate a random ice hockey team. 6 | * 7 | * @category sports 8 | * 9 | * @example 10 | * 11 | * randIceHockeyTeam() 12 | * 13 | * @example 14 | * 15 | * randIceHockeyTeam({ length: 10 }) 16 | * 17 | */ 18 | export function randIceHockeyTeam( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/integration.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { data } from './integration.json'; 3 | 4 | /** 5 | * Generate a random integration. 6 | * 7 | * @category internet 8 | * 9 | * @example 10 | * 11 | * randIntegrations() 12 | * 13 | * @example 14 | * 15 | * randIntegrations({ length: 10 }) 16 | * 17 | */ 18 | export function randIntegration( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/ip.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { randNumber } from './number'; 3 | 4 | const ipRange = { min: 0, max: 255 }; 5 | 6 | /** 7 | * Generate a random ip. 8 | * 9 | * @category internet 10 | * 11 | * @example 12 | * 13 | * randIp() 14 | * 15 | * @example 16 | * 17 | * randIp({ length: 10 }) 18 | * 19 | */ 20 | export function randIp(options?: Options) { 21 | return fake( 22 | () => Array.from({ length: 4 }, () => randNumber(ipRange)).join('.'), 23 | options 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /packages/falso/src/lib/ipv6.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randHexaDecimal } from './hexa-decimal'; 3 | 4 | /** 5 | * Generate a random ipv6. 6 | * 7 | * @category internet 8 | * 9 | * @example 10 | * 11 | * randIpv6() 12 | * 13 | * @example 14 | * 15 | * randIpv6({ length: 10 }) 16 | * 17 | */ 18 | export function randIpv6( 19 | options?: Options 20 | ) { 21 | return fake(() => { 22 | return Array.from({ length: 8 }, () => { 23 | return Array.from({ length: 4 }, () => randHexaDecimal()).join(''); 24 | }).join(':'); 25 | }, options); 26 | } 27 | -------------------------------------------------------------------------------- /packages/falso/src/lib/job-area.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Brand", 4 | "Tactics", 5 | "Markets", 6 | "Usability", 7 | "Operations", 8 | "Integration", 9 | "Identity", 10 | "Marketing", 11 | "Creative", 12 | "Response", 13 | "Branding", 14 | "Quality", 15 | "Program", 16 | "Accounts", 17 | "Accountability", 18 | "Interactions", 19 | "Security", 20 | "Applications", 21 | "Configuration", 22 | "Factors", 23 | "Paradigm", 24 | "Division", 25 | "Group", 26 | "Data", 27 | "Directives", 28 | "Optimization", 29 | "Web", 30 | "Functionality", 31 | "Research", 32 | "Intranet", 33 | "Solutions", 34 | "Mobility", 35 | "Communications", 36 | "Metrics", 37 | "Assurance" 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /packages/falso/src/lib/job-area.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './job-area.json'; 3 | 4 | /** 5 | * Generate a random job area. 6 | * 7 | * @category Jobs 8 | * 9 | * @example 10 | * 11 | * randJobArea() 12 | * 13 | * @example 14 | * 15 | * randJobArea({ length: 10 }) 16 | * 17 | */ 18 | export function randJobArea( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/job-descriptor.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Senior", 4 | "Corporate", 5 | "Future", 6 | "International", 7 | "Global", 8 | "Central", 9 | "Product", 10 | "Internal", 11 | "National", 12 | "Direct", 13 | "Customer", 14 | "Human", 15 | "Lead", 16 | "District", 17 | "Chief", 18 | "Dynamic", 19 | "Principal", 20 | "Forward", 21 | "Legacy", 22 | "Regional", 23 | "Investor" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /packages/falso/src/lib/job-descriptor.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './job-descriptor.json'; 3 | 4 | /** 5 | * Generate a random job descriptor. 6 | * 7 | * @category jobs 8 | * 9 | * @example 10 | * 11 | * randJobDescriptor() 12 | * 13 | * @example 14 | * 15 | * randJobDescriptor({ length: 10 }) 16 | * 17 | */ 18 | export function randJobDescriptor( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/job-title.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './job-title.json'; 3 | 4 | /** 5 | * Generate a random job title. 6 | * 7 | * @category Jobs 8 | * 9 | * @example 10 | * 11 | * randJobTitle() 12 | * 13 | * @example 14 | * 15 | * randJobTitle({ length: 10 }) 16 | * 17 | */ 18 | export function randJobTitle( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/job-type.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Director", 4 | "Representative", 5 | "Officer", 6 | "Coordinator", 7 | "Engineer", 8 | "Designer", 9 | "Developer", 10 | "Specialist", 11 | "Analyst", 12 | "Orchestrator", 13 | "Technician", 14 | "Executive", 15 | "Assistant", 16 | "Producer", 17 | "Liaison", 18 | "Consultant", 19 | "Architect", 20 | "Associate", 21 | "Manager", 22 | "Agent", 23 | "Facilitator", 24 | "Planner", 25 | "Administrator", 26 | "Supervisor" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /packages/falso/src/lib/job-type.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './job-type.json'; 3 | 4 | /** 5 | * Generate a random job type. 6 | * 7 | * @category jobs 8 | * 9 | * @example 10 | * 11 | * randJobType() 12 | * 13 | * @example 14 | * 15 | * randJobType({ length: 10 }) 16 | * 17 | */ 18 | export function randJobType( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/language.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { data as languages } from './language.json'; 3 | import { data as languageCodes } from './language-code.json'; 4 | 5 | interface LanguageOptions extends FakeOptions { 6 | code?: boolean; 7 | } 8 | 9 | /** 10 | * Generate a random language. 11 | * 12 | * @category person 13 | * 14 | * @example 15 | * 16 | * randLanguage() 17 | * 18 | * @example 19 | * 20 | * randLanguage({ length: 10 }) 21 | * 22 | * @example 23 | * 24 | * randLanguage({ code: true }) // default is false 25 | * 26 | */ 27 | export function randLanguage( 28 | options?: Options 29 | ) { 30 | return fake(options?.code ? languageCodes : languages, options); 31 | } 32 | -------------------------------------------------------------------------------- /packages/falso/src/lib/latitude.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake, getRandomInRange } from './core/core'; 2 | 3 | /** 4 | * Generate a random latitude. 5 | * 6 | * @category address 7 | * 8 | * @example 9 | * 10 | * randLatitude() 11 | * 12 | * @example 13 | * 14 | * randLatitude({ length: 10 }) 15 | * 16 | */ 17 | export function randLatitude( 18 | options?: Options 19 | ) { 20 | return fake( 21 | () => 22 | getRandomInRange({ 23 | min: -90, 24 | max: 90, 25 | fraction: 3, 26 | }), 27 | options 28 | ); 29 | } 30 | -------------------------------------------------------------------------------- /packages/falso/src/lib/lines.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './lines.json'; 3 | 4 | /** 5 | * Generate a random lines. 6 | * 7 | * @category text 8 | * 9 | * @example 10 | * 11 | * randLines() 12 | * 13 | * @example 14 | * 15 | * randLines({ length: 10 }) 16 | * 17 | */ 18 | export function randLines( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/lion.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Cape lion", 4 | "Transvaal lion", 5 | "Masai Lion", 6 | "Barbary Lion", 7 | "West African Lion", 8 | "Northeast Congo Lion", 9 | "Asiatic Lion" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /packages/falso/src/lib/lion.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './lion.json'; 3 | 4 | /** 5 | * Generate a random lion. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randLion() 12 | * 13 | * @example 14 | * 15 | * randLion({ length: 10 }) 16 | * 17 | */ 18 | export function randLion( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/locale.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "cz", 4 | "ge", 5 | "ne", 6 | "it", 7 | "de_CH", 8 | "en_AU_ocker", 9 | "ja", 10 | "ar", 11 | "en_CA", 12 | "pt_BR", 13 | "de", 14 | "es", 15 | "vi", 16 | "hr", 17 | "en_ZA", 18 | "fr", 19 | "id_ID", 20 | "nb_NO", 21 | "zh_TW", 22 | "ro", 23 | "pl", 24 | "en_GB", 25 | "en_AU", 26 | "fr_CA", 27 | "hy", 28 | "ko", 29 | "en_BORK", 30 | "es_MX", 31 | "en_IE", 32 | "az", 33 | "nl_BE", 34 | "en_US", 35 | "sk", 36 | "fr_CH", 37 | "en_IND", 38 | "sv", 39 | "fi", 40 | "en", 41 | "zh_CN", 42 | "he", 43 | "pt_PT", 44 | "de_AT" 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /packages/falso/src/lib/locale.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './locale.json'; 3 | 4 | /** 5 | * Generate a random locale. 6 | * 7 | * @category address 8 | * 9 | * @example 10 | * 11 | * randLocale() 12 | * 13 | * @example 14 | * 15 | * randLocale({ length: 10 }) 16 | * 17 | */ 18 | export function randLocale( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/longitude.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake, getRandomInRange } from './core/core'; 2 | 3 | /** 4 | * Generate a random longitude. 5 | * 6 | * @category address 7 | * 8 | * @example 9 | * 10 | * randLongitude() 11 | * 12 | * @example 13 | * 14 | * randLongitude({ length: 10 }) 15 | * 16 | */ 17 | export function randLongitude( 18 | options?: Options 19 | ) { 20 | return fake( 21 | () => 22 | getRandomInRange({ 23 | min: -180, 24 | max: 180, 25 | fraction: 3, 26 | }), 27 | options 28 | ); 29 | } 30 | -------------------------------------------------------------------------------- /packages/falso/src/lib/mac.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randHexaDecimal } from './hexa-decimal'; 3 | 4 | /** 5 | * Generate a random mac address. 6 | * 7 | * @category system 8 | * 9 | * @example 10 | * 11 | * randMac() 12 | * 13 | * @example 14 | * 15 | * randMac({ length: 10 }) 16 | * 17 | */ 18 | export function randMac( 19 | options?: Options 20 | ) { 21 | return fake( 22 | () => 23 | Array.from( 24 | { length: 6 }, 25 | () => randHexaDecimal() + randHexaDecimal() 26 | ).join('-'), 27 | options 28 | ); 29 | } 30 | -------------------------------------------------------------------------------- /packages/falso/src/lib/mime-type.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './mime-type.json'; 3 | 4 | /** 5 | * Generate a random mime type. 6 | * 7 | * @category system 8 | * 9 | * @example 10 | * 11 | * randMimeType() 12 | * 13 | * @example 14 | * 15 | * randMimeType({ length: 10 }) 16 | * 17 | */ 18 | export function randMimeType( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/month.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "January", 4 | "February", 5 | "March", 6 | "April", 7 | "May", 8 | "June", 9 | "July", 10 | "August", 11 | "September", 12 | "October", 13 | "November", 14 | "December" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/falso/src/lib/motorcycle-manufacturer.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Aprilia", 4 | "Benelli", 5 | "BMW Motorrad", 6 | "Bultaco", 7 | "Cagiva", 8 | "Daelim", 9 | "Derbi", 10 | "Ducati", 11 | "Gas Gas", 12 | "Gilera", 13 | "Harley-Davidson", 14 | "Honda", 15 | "Husqvarna", 16 | "Hyosung", 17 | "Indian Motorcycle", 18 | "Kawasaki", 19 | "Keeway", 20 | "KTM", 21 | "Moto Guzzi", 22 | "MV Agusta", 23 | "Piaggio", 24 | "Rieju", 25 | "Royal Enfield", 26 | "Suzuki", 27 | "SYM", 28 | "Triumph", 29 | "Vespa", 30 | "Yamaha", 31 | "Zero Motorcycles" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /packages/falso/src/lib/movie-character.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './movie-character.json'; 3 | /** 4 | * Generate a random movie character. 5 | * 6 | * @category movie 7 | * 8 | * @example 9 | * 10 | * randMovieCharacter() 11 | * 12 | * @example 13 | * 14 | * randMovieCharacter({ length: 10 }) 15 | * 16 | */ 17 | export function randMovieCharacter( 18 | options?: Options 19 | ) { 20 | return fake(data, options); 21 | } 22 | -------------------------------------------------------------------------------- /packages/falso/src/lib/movie.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './movie.json'; 3 | /** 4 | * Generate a random movie. 5 | * 6 | * @category Movie 7 | * 8 | * @example 9 | * 10 | * randMovie() 11 | * 12 | * @example 13 | * 14 | * randMovie({ length: 10 }) 15 | * 16 | */ 17 | export function randMovie( 18 | options?: Options 19 | ) { 20 | return fake(data, options); 21 | } 22 | -------------------------------------------------------------------------------- /packages/falso/src/lib/music-genre.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Classical", 4 | "Reggae", 5 | "Blues", 6 | "Country", 7 | "Latin", 8 | "Funk", 9 | "Rap", 10 | "Folk", 11 | "Electronic", 12 | "World", 13 | "Hip Hop", 14 | "Pop", 15 | "Stage And Screen", 16 | "Soul", 17 | "Non Music", 18 | "Jazz", 19 | "Rock", 20 | "Metal" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/music-genre.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './music-genre.json'; 3 | 4 | /** 5 | * Generate a random genre. 6 | * 7 | * @category music 8 | * 9 | * @example 10 | * 11 | * randMusicGenre() 12 | * 13 | * @example 14 | * 15 | * randMusicGenre({ length: 10 }) 16 | * 17 | */ 18 | export function randMusicGenre( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/nearby-gpscoordinate.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randLatitude } from './latitude'; 3 | import { randLongitude } from './longitude'; 4 | 5 | /** 6 | * Generate a random GPS coordinate. 7 | * 8 | * @category address 9 | * 10 | * @example 11 | * 12 | * randNearbyGPSCoordinate() 13 | * 14 | * @example 15 | * 16 | * randNearbyGPSCoordinate({ length: 10 }) 17 | * 18 | */ 19 | export function randNearbyGPSCoordinate( 20 | options?: Options 21 | ) { 22 | return fake(() => [randLatitude(), randLongitude()], options); 23 | } 24 | -------------------------------------------------------------------------------- /packages/falso/src/lib/noun.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './noun.json'; 3 | 4 | /** 5 | * Generate a random noun. 6 | * 7 | * @category text 8 | * 9 | * @example 10 | * 11 | * randNoun() 12 | * 13 | * @example 14 | * 15 | * randNoun({ length: 10 }) 16 | * 17 | */ 18 | export function randNoun( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/oauth-provider.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './oauth-provider.json'; 3 | 4 | /** 5 | * Generate a random OAuth provider. 6 | * 7 | * @category Internet 8 | * 9 | * @example 10 | * 11 | * randOAuthProvider() 12 | * 13 | * @example 14 | * 15 | * randOAuthProvider({ length: 10 }) 16 | * 17 | */ 18 | export function randOAuthProvider( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/octal.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | 3 | /** 4 | * Generate a random octal. 5 | * 6 | * @category Math 7 | * 8 | * @example 9 | * 10 | * randOctal() 11 | * 12 | * @example 13 | * 14 | * randOctal({ length: 10 }) 15 | * 16 | */ 17 | export function randOctal( 18 | options?: Options 19 | ) { 20 | const RADIX = 8; 21 | 22 | return fake(() => { 23 | const randomNumber = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER); 24 | 25 | return BigInt(randomNumber.toString(RADIX)); 26 | }, options); 27 | } 28 | -------------------------------------------------------------------------------- /packages/falso/src/lib/ordinal-direction.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["Southwest", "Northwest", "Southeast", "Northeast"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/ordinal-direction.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './ordinal-direction.json'; 3 | 4 | /** 5 | * Generate a random ordinal direction. 6 | * 7 | * @category address 8 | * 9 | * @example 10 | * 11 | * randOrdinalDirection() 12 | * 13 | * @example 14 | * 15 | * randOrdinalDirection({ length: 10 }) 16 | * 17 | */ 18 | export function randOrdinalDirection( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/paragraph.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './paragraph.json'; 3 | 4 | /** 5 | * Generate a random paragraph. 6 | * 7 | * @category text 8 | * 9 | * @example 10 | * 11 | * randParagraph() 12 | * 13 | * @example 14 | * 15 | * randParagraph({ length: 10 }) 16 | * 17 | */ 18 | export function randParagraph( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/password.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randSequence } from './sequence'; 3 | 4 | export interface PasswordOptions extends FakeOptions { 5 | size?: number; 6 | } 7 | 8 | /** 9 | * Generate a random password. 10 | * 11 | * @category person 12 | * 13 | * @example 14 | * 15 | * randPassword() 16 | * 17 | * @example 18 | * 19 | * randPassword({ length: 10 }) 20 | * 21 | * @example 22 | * 23 | * randPassword({ size: 10 }) // default is 15 24 | * 25 | */ 26 | export function randPassword( 27 | options?: Options 28 | ) { 29 | const size = options?.size || 15; 30 | 31 | return fake(() => randSequence({ size }), options); 32 | } 33 | -------------------------------------------------------------------------------- /packages/falso/src/lib/permission.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["read", "write", "execute", "no permission"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/permission.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './permission.json'; 3 | 4 | interface PermissionOptions extends FakeOptions { 5 | numeric?: boolean; 6 | } 7 | 8 | /** 9 | * Generate a random permission. 10 | * 11 | * @category system 12 | * 13 | * @example 14 | * 15 | * randPermission() 16 | * 17 | * @example 18 | * 19 | * randPermission({ length: 10 }) 20 | * 21 | * @example 22 | * 23 | * randPermission({ numeric: true }) 24 | * 25 | */ 26 | export function randPermission( 27 | options?: Options 28 | ) { 29 | if (options?.numeric) { 30 | return fake([0, 1, 2, 4], options); 31 | } 32 | 33 | return fake(data, options); 34 | } 35 | -------------------------------------------------------------------------------- /packages/falso/src/lib/person-title.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["Dr.", "Miss", "Mr.", "Mrs.", "Ms."] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/person-title.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './person-title.json'; 3 | 4 | /** 5 | * Generate a random person title. 6 | * 7 | * @category person 8 | * 9 | * @example 10 | * 11 | * randPersonTitle() 12 | * 13 | * @example 14 | * 15 | * randPersonTitle({ length: 10 }) 16 | * 17 | */ 18 | export function randPersonTitle( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/phrase.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './phrase.json'; 3 | 4 | /** 5 | * Generate a random phrase. 6 | * 7 | * @category text 8 | * 9 | * @example 10 | * 11 | * randPhrase() 12 | * 13 | * @example 14 | * 15 | * randPhrase({ length: 10 }) 16 | * 17 | */ 18 | export function randPhrase( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/port.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { randNumber } from './number'; 3 | 4 | /** 5 | * Generate a random port. 6 | * 7 | * @category internet 8 | * 9 | * @example 10 | * 11 | * randPort() 12 | * 13 | * @example 14 | * 15 | * randPort({ length: 10 }) 16 | * 17 | */ 18 | export function randPort( 19 | options?: Options 20 | ) { 21 | return fake(() => randNumber({ min: 0, max: 65_535 }), options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/priority.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "low", 4 | "medium", 5 | "high", 6 | "critical", 7 | "urgent", 8 | "major", 9 | "moderate", 10 | "minor" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /packages/falso/src/lib/priority.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './priority.json'; 3 | 4 | /** 5 | * Generate a random priority. 6 | * 7 | * @category general 8 | * 9 | * @example 10 | * 11 | * randPriority() 12 | * 13 | * @example 14 | * 15 | * randPriority({ length: 10 }) 16 | * 17 | */ 18 | export function randPriority( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/product-adjective.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Awesome", 4 | "Rustic", 5 | "Small", 6 | "Gorgeous", 7 | "Fantastic", 8 | "Sleek", 9 | "Intelligent", 10 | "Unbranded", 11 | "Refined", 12 | "Licensed", 13 | "Generic", 14 | "Practical", 15 | "Ergonomic", 16 | "Handcrafted", 17 | "Tasty", 18 | "Handmade", 19 | "Incredible" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /packages/falso/src/lib/product-adjective.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './product-adjective.json'; 3 | 4 | /** 5 | * Generate a random product adjective. 6 | * 7 | * @category commerce 8 | * 9 | * @example 10 | * 11 | * randProductAdjective() 12 | * 13 | * @example 14 | * 15 | * randProductAdjective({ length: 10 }) 16 | * 17 | */ 18 | export function randProductAdjective( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/product-category.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Antiques", 4 | "Appliances", 5 | "Automotive Parts & Accessories", 6 | "Automotive Parts", 7 | "Baby & Personal Care", 8 | "Books", 9 | "CDs & Vinyl", 10 | "Clothing", 11 | "Collectibles", 12 | "Computers & Tablets", 13 | "Crafts", 14 | "Electronics", 15 | "Garden", 16 | "Grocery", 17 | "Health & Beauty", 18 | "Kindle", 19 | "Movies & TV", 20 | "Musical Instruments", 21 | "Smartphones & Accessories", 22 | "Sporting Goods", 23 | "Toys", 24 | "Video Games" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /packages/falso/src/lib/product-category.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './product-category.json'; 3 | 4 | /** 5 | * Generate a random product category. 6 | * 7 | * @category Commerce 8 | * 9 | * @example 10 | * 11 | * randProductCategory() 12 | * 13 | * @example 14 | * 15 | * randProductCategory({ length: 10 }) 16 | * 17 | */ 18 | export function randProductCategory( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/product-description.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './product-description.json'; 3 | 4 | /** 5 | * Generate a random product description. 6 | * 7 | * @category Commerce 8 | * 9 | * @example 10 | * 11 | * randProductDescription() 12 | * 13 | * @example 14 | * 15 | * randProductDescription({ length: 10 }) 16 | * 17 | */ 18 | export function randProductDescription( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/product-material.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Metal", 4 | "Plastic", 5 | "Rubber", 6 | "Frozen", 7 | "Soft", 8 | "Concrete", 9 | "Granite", 10 | "Fresh", 11 | "Steel", 12 | "Cotton", 13 | "Wooden" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /packages/falso/src/lib/product-material.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './product-material.json'; 3 | 4 | /** 5 | * Generate a random product material. 6 | * 7 | * @category commerce 8 | * 9 | * @example 10 | * 11 | * randProductMaterial() 12 | * 13 | * @example 14 | * 15 | * randProductMaterial({ length: 10 }) 16 | * 17 | */ 18 | export function randProductMaterial( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/product-name.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './product-name.json'; 3 | 4 | /** 5 | * Generate a random product name. 6 | * 7 | * @category commerce 8 | * 9 | * @example 10 | * 11 | * randProductName() 12 | * 13 | * @example 14 | * 15 | * randProductName({ length: 10 }) 16 | * 17 | */ 18 | export function randProductName( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/product.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Chair", 4 | "Soap", 5 | "Sausages", 6 | "Computer", 7 | "Hat", 8 | "Car", 9 | "Shirt", 10 | "Mouse", 11 | "Keyboard", 12 | "Fish", 13 | "Bike", 14 | "Table", 15 | "Pants", 16 | "Gloves", 17 | "Tuna", 18 | "Towels", 19 | "Shoes", 20 | "Salad", 21 | "Cheese", 22 | "Chips", 23 | "Pizza", 24 | "Bacon", 25 | "Ball" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /packages/falso/src/lib/programming-language.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Python", 4 | "Java", 5 | "JavaScript", 6 | "C", 7 | "C++", 8 | "C#", 9 | "PHP", 10 | "Kotlin", 11 | "R", 12 | "TypeScript", 13 | "Abap", 14 | "Swift", 15 | "Objective-C", 16 | "VBA", 17 | "Matlab", 18 | "Go", 19 | "Scala", 20 | "Ruby", 21 | "Groovy", 22 | "Dart", 23 | "Cobol", 24 | "Visual Basic", 25 | "Perl", 26 | "Julia", 27 | "Rust", 28 | "Lua", 29 | "Lisp", 30 | "Haskell", 31 | "Delphi" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /packages/falso/src/lib/programming-language.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './programming-language.json'; 3 | 4 | /** 5 | * Generate a random programming language. 6 | * 7 | * @category code 8 | * 9 | * @example 10 | * 11 | * randProgrammingLanguage() 12 | * 13 | * @example 14 | * 15 | * randProgrammingLanguage({ length: 10 }) 16 | * 17 | */ 18 | export function randProgrammingLanguage( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/pronoun.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["They/Them", "She/Her", "He/Him", "Ze/Hir"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/pronoun.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './pronoun.json'; 3 | 4 | /** 5 | * Generate a random pronoun. 6 | * 7 | * @category person 8 | * 9 | * @example 10 | * 11 | * randPronoun() 12 | * 13 | */ 14 | export function randPronoun( 15 | options?: Options 16 | ) { 17 | return fake(data, options); 18 | } 19 | -------------------------------------------------------------------------------- /packages/falso/src/lib/protocol-full.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Hyper Text Transfer Protocol Secure", 4 | "Hyper Text Transfer Protocol", 5 | "Transmission Control Protocol", 6 | "User Datagram Protocol", 7 | "Internet Protocol", 8 | "Post office Protocol", 9 | "Simple mail transport Protocol", 10 | "Dynamic Host Configuration Protoco", 11 | "Layer Two Tunnelling Protocol", 12 | "File Transfer Protocol", 13 | "Internet Message Access Protocol" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /packages/falso/src/lib/protocol.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "https", 4 | "http", 5 | "tcp", 6 | "udp", 7 | "ip", 8 | "pop", 9 | "smtp", 10 | "dhcp", 11 | "l2tp", 12 | "ftp", 13 | "imap" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /packages/falso/src/lib/protocol.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data as protocol } from './protocol.json'; 3 | import { data as protocolFull } from './protocol-full.json'; 4 | 5 | interface ProtocolOptions extends FakeOptions { 6 | fullName?: boolean; 7 | } 8 | 9 | /** 10 | * Generate a random protocol. 11 | * 12 | * @category internet 13 | * 14 | * @example 15 | * 16 | * randProtocol() 17 | * 18 | * @example 19 | * 20 | * randProtocol({ length: 10 }) 21 | * 22 | * @example 23 | * 24 | * randProtocol({ fullName: true }) 25 | * 26 | */ 27 | export function randProtocol( 28 | options?: Options 29 | ) { 30 | return fake(options?.fullName ? protocolFull : protocol, options); 31 | } 32 | -------------------------------------------------------------------------------- /packages/falso/src/lib/quote.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './quote.json'; 3 | 4 | /** 5 | * Generate a random quote. 6 | * 7 | * @category text 8 | * 9 | * @example 10 | * 11 | * randQuote() 12 | * 13 | * @example 14 | * 15 | * randQuote({ length: 10 }) 16 | * 17 | */ 18 | export function randQuote( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/rabbit.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Satin", 4 | "Giant Angora", 5 | "Tan", 6 | "Havana", 7 | "Harlequin", 8 | "Rhinelander", 9 | "Cinnamon", 10 | "American", 11 | "Florida White", 12 | "Checkered Giant", 13 | "English Lop", 14 | "Polish", 15 | "English Angora", 16 | "Belgian Hare", 17 | "Standard Chinchilla", 18 | "Giant Chinchilla", 19 | "English Spot", 20 | "Dutch" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/rabbit.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './rabbit.json'; 3 | 4 | /** 5 | * Generate a random rabbit. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randRabbit() 12 | * 13 | * @example 14 | * 15 | * randRabbit({ length: 10 }) 16 | * 17 | */ 18 | export function randRabbit( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/rand.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | 3 | /** 4 | * Get a random item from array. 5 | * 6 | * @category general 7 | * 8 | * @example 9 | * 10 | * rand([ 1, 2, 3 ]) 11 | * 12 | * @example 13 | * 14 | * rand([ 1, 2, 3 ], { length: 10 }) 15 | * 16 | */ 17 | export function rand( 18 | arr: Readonly, 19 | options?: Options 20 | ) { 21 | return fake(arr, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/random.ts: -------------------------------------------------------------------------------- 1 | import seedRandom from 'seedrandom'; 2 | 3 | let prng = seedRandom(); 4 | 5 | /** 6 | * Create a seed. 7 | * 8 | * @category general 9 | * 10 | * @example 11 | * 12 | * random() 13 | * 14 | */ 15 | export function random() { 16 | return prng(); 17 | } 18 | 19 | /** 20 | * Sets and Resets random seed. 21 | * 22 | * @category general 23 | * 24 | * @example 25 | * 26 | * seed() 27 | * 28 | * @example 29 | * 30 | * seed('some-constant-seed') 31 | */ 32 | export function seed(value?: string) { 33 | prng = seedRandom(value); 34 | } 35 | -------------------------------------------------------------------------------- /packages/falso/src/lib/resolution.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './resolution.json'; 3 | 4 | /** 5 | * Generate random screen resolution 6 | * 7 | * @category internet 8 | * 9 | * @example 10 | * 11 | * randResolution() 12 | * 13 | * @example 14 | * 15 | * randResolution() 16 | * 17 | * 18 | */ 19 | 20 | export function randResolution( 21 | options?: Options 22 | ) { 23 | return fake(data, options); 24 | } 25 | -------------------------------------------------------------------------------- /packages/falso/src/lib/role.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["Admin", "Editor", "Owner", "Contributor", "Viewer", "Developer"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/role.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { data } from './role.json'; 3 | 4 | /** 5 | * Generate a random user role 6 | * 7 | * @category user 8 | * 9 | * @example 10 | * 11 | * randRole() 12 | * 13 | * @example 14 | * 15 | * randRole({ length: 10 }) 16 | * 17 | */ 18 | export function randRole( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/routing-number.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { randNumber } from './number'; 3 | 4 | /** 5 | * Generate a random routing number. 6 | * 7 | * @category finance 8 | * 9 | * @example 10 | * 11 | * randRoutingNumber() 12 | * 13 | * @example 14 | * 15 | * randRoutingNumber({ length: 10 }) 16 | * 17 | */ 18 | export function randRoutingNumber( 19 | options?: Options 20 | ) { 21 | return fake(() => randNumber({ min: 10_000_000, max: 99_999_999 }), options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/seat-number.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake, getRandomInRange } from './core/core'; 2 | import { rand } from './rand'; 3 | 4 | /** 5 | * Generate a random seat number. 6 | * 7 | * @category flight 8 | * 9 | * @example 10 | * 11 | * randSeatNumber() 12 | * 13 | * @example 14 | * 15 | * randSeatNumber({ length: 10 }) 16 | * 17 | */ 18 | export function randSeatNumber( 19 | options?: Options 20 | ) { 21 | const factory = () => { 22 | return `${getRandomInRange({ min: 1, max: 33 })}${rand([ 23 | 'A', 24 | 'B', 25 | 'C', 26 | 'D', 27 | 'E', 28 | 'F', 29 | ])}`; 30 | }; 31 | 32 | return fake(factory, options); 33 | } 34 | -------------------------------------------------------------------------------- /packages/falso/src/lib/semver.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { randNumber } from './number'; 3 | 4 | export interface SemverOptions extends FakeOptions { 5 | prefix?: string; 6 | } 7 | 8 | /** 9 | * Generate a random semantic version. 10 | * 11 | * @category internet 12 | * 13 | * @example 14 | * 15 | * randSemver() 16 | * 17 | * @example 18 | * 19 | * randSemver({ length: 10 }) 20 | * 21 | * @example 22 | * 23 | * randSemver({ prefix: 'v' }) 24 | * 25 | */ 26 | export function randSemver( 27 | options?: Options 28 | ) { 29 | return fake(() => { 30 | const version = Array.from({ length: 3 }, () => 31 | randNumber({ min: 0, max: 20 }) 32 | ).join('.'); 33 | 34 | return `${options?.prefix || ''}${version}`; 35 | }, options); 36 | } 37 | -------------------------------------------------------------------------------- /packages/falso/src/lib/shape.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Triangle", 4 | "Circle", 5 | "Square", 6 | "Rectangle", 7 | "Parallelogram", 8 | "Rhombus", 9 | "Trapezium", 10 | "Kite", 11 | "Polygons", 12 | "Sphere", 13 | "Cube", 14 | "Cuboid", 15 | "Cone", 16 | "Cylinder" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /packages/falso/src/lib/shape.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './shape.json'; 3 | 4 | /** 5 | * Generate a random shape. 6 | * 7 | * @category general 8 | * 9 | * @example 10 | * 11 | * randShape() 12 | * 13 | * @example 14 | * 15 | * randShape({ length: 10 }) 16 | * 17 | */ 18 | export function randShape( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/singer.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './singer.json'; 3 | /** 4 | * Generate a random singer. 5 | * 6 | * @category music 7 | * 8 | * @example 9 | * 10 | * randSinger() 11 | * 12 | * @example 13 | * 14 | * randSinger({ length: 10 }) 15 | * 16 | */ 17 | export function randSinger( 18 | options?: Options 19 | ) { 20 | return fake(data, options); 21 | } 22 | -------------------------------------------------------------------------------- /packages/falso/src/lib/skill.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './skill.json'; 3 | 4 | /** 5 | * Generate a random skill. 6 | * 7 | * @category Person 8 | * 9 | * @example 10 | * 11 | * randSkill() 12 | * 13 | * @example 14 | * 15 | * randSkill({ length: 10 }) 16 | * 17 | */ 18 | export function randSkill( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/slug.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake, getRandomInRange } from './core/core'; 2 | import { randWord } from './word'; 3 | 4 | /** 5 | * Generate a random slug. 6 | * 7 | * @category Internet 8 | * 9 | * @example 10 | * 11 | * randSlug() 12 | * 13 | * @example 14 | * 15 | * randSlug({ length: 10 }) 16 | * 17 | */ 18 | export function randSlug( 19 | options?: Options 20 | ) { 21 | return fake(() => { 22 | const numberOfWordsInSlug = getRandomInRange({ min: 3, max: 10 }); 23 | const randomWords = randWord({ length: numberOfWordsInSlug }); 24 | return randomWords.join('-'); 25 | }, options); 26 | } 27 | -------------------------------------------------------------------------------- /packages/falso/src/lib/snake.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Bluntnose viper", 4 | "Yunnan keelback", 5 | "Eastern hognose snake", 6 | "Southwestern black spitting cobra", 7 | "Machete savane", 8 | "Angolan python", 9 | "Huttons tree viper", 10 | "Eastern tiger snake", 11 | "Central ranges taipan", 12 | "Schultzes pitviper", 13 | "Mexican west coast rattlesnake", 14 | "Indigo snake", 15 | "Dog-toothed cat snake", 16 | "Bismarck ringed python", 17 | "Boomslang", 18 | "Mangshan pitviper", 19 | "Whip snake", 20 | "Mountain adder" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/snake.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './snake.json'; 3 | 4 | /** 5 | * Generate a random snake. 6 | * 7 | * @category animals 8 | * 9 | * @example 10 | * 11 | * randSnake() 12 | * 13 | * @example 14 | * 15 | * randSnake({ length: 10 }) 16 | * 17 | */ 18 | export function randSnake( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/social.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './social.json'; 3 | 4 | /** 5 | * Generate random social network 6 | * 7 | * @category internet 8 | * 9 | * @example 10 | * 11 | * randSocial() 12 | * 13 | * @example 14 | * 15 | * randSocial({ length: 2 }) 16 | * 17 | * 18 | */ 19 | 20 | export function randSocial( 21 | options?: Options 22 | ) { 23 | return fake(data, options); 24 | } 25 | -------------------------------------------------------------------------------- /packages/falso/src/lib/song.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './song.json'; 3 | /** 4 | * Generate a random song. 5 | * 6 | * @category Music 7 | * 8 | * @example 9 | * 10 | * randSong() 11 | * 12 | * @example 13 | * 14 | * randSong({ length: 10 }) 15 | * 16 | */ 17 | export function randSong( 18 | options?: Options 19 | ) { 20 | return fake(data, options); 21 | } 22 | -------------------------------------------------------------------------------- /packages/falso/src/lib/state-abbr.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "OR", 4 | "FL", 5 | "NM", 6 | "AK", 7 | "MO", 8 | "NE", 9 | "RI", 10 | "MI", 11 | "PA", 12 | "WI", 13 | "AL", 14 | "MA", 15 | "MN", 16 | "TN", 17 | "ND", 18 | "MS", 19 | "AR", 20 | "HI", 21 | "UT", 22 | "ID", 23 | "SC", 24 | "CA", 25 | "NJ", 26 | "CT", 27 | "OK", 28 | "AZ", 29 | "IA", 30 | "SD", 31 | "MT", 32 | "MD", 33 | "WY", 34 | "KS", 35 | "WV", 36 | "CO", 37 | "TX", 38 | "VT", 39 | "NV", 40 | "DE", 41 | "ME", 42 | "GA", 43 | "LA", 44 | "IN", 45 | "VA" 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /packages/falso/src/lib/state-abbr.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './state-abbr.i18n.json'; 3 | 4 | /** 5 | * Generate a random state abbr. 6 | * 7 | * @category address 8 | * 9 | * @example 10 | * 11 | * randStateAbbr() 12 | * 13 | * @example 14 | * 15 | * randStateAbbr({ length: 10 }) 16 | * 17 | */ 18 | export function randStateAbbr( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/state.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './state.i18n.json'; 3 | 4 | /** 5 | * Generate a random state. 6 | * 7 | * @category address 8 | * 9 | * @example 10 | * 11 | * randState() 12 | * 13 | * @example 14 | * 15 | * randState({ length: 10 }) 16 | * 17 | */ 18 | export function randState( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/street-address.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randNumber } from './number'; 3 | import { randStreetName } from './street-name'; 4 | 5 | /** 6 | * Generate a random street address. 7 | * 8 | * @category address 9 | * 10 | * @example 11 | * 12 | * randStreetAddress() 13 | * 14 | * @example 15 | * 16 | * randStreetAddress({ length: 10 }) 17 | * 18 | */ 19 | export function randStreetAddress( 20 | options?: Options 21 | ) { 22 | return fake( 23 | () => `${randNumber({ min: 0, max: 1_500 })} ${randStreetName()}`, 24 | options 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /packages/falso/src/lib/street-name.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './street-name.json'; 3 | 4 | /** 5 | * Generate a random street name. 6 | * 7 | * @category address 8 | * 9 | * @example 10 | * 11 | * randStreetName() 12 | * 13 | * @example 14 | * 15 | * randStreetName({ length: 10 }) 16 | * 17 | */ 18 | export function randStreetName( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/subscription-plan.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Basic", 4 | "Premium", 5 | "Free", 6 | "Gold", 7 | "Unlimited", 8 | "Starter", 9 | "Business", 10 | "Professional", 11 | "Advanced", 12 | "Silver", 13 | "Bronze", 14 | "Standard", 15 | "Pro", 16 | "Enterprise", 17 | "Platinum" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /packages/falso/src/lib/subscription-plan.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { data } from './subscription-plan.json'; 3 | 4 | /** 5 | * Generate a random subscription plan. 6 | * 7 | * @category company 8 | * 9 | * @example 10 | * 11 | * randSubscriptionPlan() 12 | * 13 | * @example 14 | * 15 | * randSubscriptionPlan({ length: 10 }) 16 | * 17 | */ 18 | export function randSubscriptionPlan( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/svg.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './svg.json'; 3 | 4 | /** 5 | * Generate a random svg. 6 | * 7 | * @category general 8 | * 9 | * @example 10 | * 11 | * randSvg() 12 | * 13 | * @example 14 | * 15 | * randSvg({ length: 10 }) 16 | * 17 | */ 18 | export function randSvg( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/time-zone.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './time-zone.json'; 3 | 4 | /** 5 | * Generate a random time zone. 6 | * 7 | * @category address 8 | * 9 | * @example 10 | * 11 | * randTimeZone() 12 | * 13 | * @example 14 | * 15 | * randTimeZone({ length: 10 }) 16 | * 17 | */ 18 | export function randTimeZone( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/todo.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randUuid } from './uuid'; 3 | import { randBoolean } from './boolean'; 4 | import { randText } from './text'; 5 | 6 | export interface Todo { 7 | id: string; 8 | title: string; 9 | completed: boolean; 10 | } 11 | 12 | /** 13 | * Generate a random todo. 14 | * 15 | * @category entities 16 | * 17 | * @example 18 | * 19 | * randTodo() 20 | * 21 | * @example 22 | * 23 | * randTodo({ length: 10 }) 24 | * 25 | */ 26 | export function randTodo( 27 | options?: Options 28 | ) { 29 | return fake(() => { 30 | return { 31 | id: randUuid(), 32 | title: randText({ charCount: 40 }), 33 | completed: randBoolean(), 34 | } as Todo; 35 | }, options); 36 | } 37 | -------------------------------------------------------------------------------- /packages/falso/src/lib/transaction-type.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["deposit", "withdrawal", "payment", "invoice"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/transaction-type.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './transaction-type.json'; 3 | 4 | /** 5 | * Generate a random transaction type. 6 | * 7 | * @category Finance 8 | * 9 | * @example 10 | * 11 | * randTransactionType() 12 | * 13 | * @example 14 | * 15 | * randTransactionType({ length: 10 }) 16 | * 17 | */ 18 | export function randTransactionType( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/url.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randDomainSuffix } from './domain-suffix'; 3 | import { randWord } from './word'; 4 | 5 | /** 6 | * Generate a random url. 7 | * 8 | * @category internet 9 | * 10 | * @example 11 | * 12 | * randUrl() 13 | * 14 | * @example 15 | * 16 | * randUrl({ length: 10 }) 17 | * 18 | */ 19 | export function randUrl( 20 | options?: Options 21 | ) { 22 | return fake(() => { 23 | return `${fake(['http', 'https'])}://${randWord()}.${randDomainSuffix()}`; 24 | }, options); 25 | } 26 | -------------------------------------------------------------------------------- /packages/falso/src/lib/user-agent.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './user-agent.json'; 3 | 4 | /** 5 | * Generate a random user agent. 6 | * 7 | * @category internet 8 | * 9 | * @example 10 | * 11 | * randUserAgent() 12 | * 13 | * @example 14 | * 15 | * randUserAgent({ length: 10 }) 16 | * 17 | */ 18 | export function randUserAgent( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/utils/objectKeys.ts: -------------------------------------------------------------------------------- 1 | export type ObjectKeys> = Exclude< 2 | keyof T, 3 | symbol 4 | >; 5 | 6 | /** 7 | * A utility function which behaves identical to 8 | * [Object.keys()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys). 9 | * It preserves type strictly 10 | */ 11 | export const objectKeys = >( 12 | obj: Type 13 | ): Array> => { 14 | return Object.keys(obj) as Array>; 15 | }; 16 | -------------------------------------------------------------------------------- /packages/falso/src/lib/utils/validators.utils.ts: -------------------------------------------------------------------------------- 1 | export function isString(value: any): value is string { 2 | return typeof value === 'string'; 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/uuid.ts: -------------------------------------------------------------------------------- 1 | import { v4 as uuidv4 } from 'uuid'; 2 | import { fake, FakeOptions } from './core/core'; 3 | import { randNumber } from './number'; 4 | 5 | /** 6 | * Generate a random uuid. 7 | * 8 | * @category general, database 9 | * 10 | * @example 11 | * 12 | * randUuid() 13 | * 14 | * @example 15 | * 16 | * randUuid({ length: 10 }) 17 | * 18 | */ 19 | export function randUuid( 20 | options?: Options 21 | ) { 22 | return fake( 23 | () => 24 | uuidv4({ 25 | random: randNumber({ min: 0, max: 255, length: 16 }), 26 | }), 27 | options 28 | ); 29 | } 30 | -------------------------------------------------------------------------------- /packages/falso/src/lib/vehicle-fuel.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": ["Gasoline", "Hybrid", "Electric", "Diesel"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/falso/src/lib/vehicle-fuel.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './vehicle-fuel.json'; 3 | 4 | /** 5 | * Generate a random vehicle fuel. 6 | * 7 | * @category vehicle 8 | * 9 | * @example 10 | * 11 | * randVehicleFuel() 12 | * 13 | * @example 14 | * 15 | * randVehicleFuel({ length: 10 }) 16 | * 17 | */ 18 | export function randVehicleFuel( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/vehicle-manufacturer.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './vehicle-manufacturer.json'; 3 | 4 | /** 5 | * Generate a random vehicle manufacturer. 6 | * 7 | * @category vehicle 8 | * 9 | * @example 10 | * 11 | * randVehicleManufacturer() 12 | * 13 | * @example 14 | * 15 | * randVehicleManufacturer({ length: 10 }) 16 | * 17 | */ 18 | export function randVehicleManufacturer( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/vehicle-model.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './vehicle-model.json'; 3 | 4 | /** 5 | * Generate a random vehicle model. 6 | * 7 | * @category vehicle 8 | * 9 | * @example 10 | * 11 | * randVehicleModel() 12 | * 13 | * @example 14 | * 15 | * randVehicleModel({ length: 10 }) 16 | * 17 | */ 18 | export function randVehicleModel( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/vehicle-type.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Sedan", 4 | "Crew Cab Pickup", 5 | "Minivan", 6 | "Extended Cab Pickup", 7 | "Wagon", 8 | "SUV", 9 | "Cargo Van", 10 | "Coupe", 11 | "Hatchback", 12 | "Convertible", 13 | "Passenger Van" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /packages/falso/src/lib/vehicle-type.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './vehicle-type.json'; 3 | 4 | /** 5 | * Generate a random vehicle type. 6 | * 7 | * @category vehicle 8 | * 9 | * @example 10 | * 11 | * randVehicleType() 12 | * 13 | * @example 14 | * 15 | * randVehicleType({ length: 10 }) 16 | * 17 | */ 18 | export function randVehicleType( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/vehicle.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Toyota Volt", 4 | "Rolls Royce XC90", 5 | "Nissan Fiesta", 6 | "Mercedes Benz A4", 7 | "Bugatti 1", 8 | "Mini Explorer", 9 | "Nissan Spyder", 10 | "Kia Spyder", 11 | "Ford Camry", 12 | "Bugatti Corvette", 13 | "Toyota A4", 14 | "Toyota Challenger", 15 | "Smart Focus", 16 | "Mazda Challenger", 17 | "Lamborghini F-150", 18 | "Lamborghini Prius", 19 | "Hyundai Roadster", 20 | "Chevrolet Malibu" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/vehicle.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './vehicle.json'; 3 | 4 | /** 5 | * Generate a random vehicle. 6 | * 7 | * @category vehicle 8 | * 9 | * @example 10 | * 11 | * randVehicle() 12 | * 13 | * @example 14 | * 15 | * randVehicle({ length: 10 }) 16 | * 17 | */ 18 | export function randVehicle( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/verb.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "bypass", 4 | "index", 5 | "transmit", 6 | "parse", 7 | "synthesize", 8 | "compress", 9 | "reboot", 10 | "quantify", 11 | "hack", 12 | "back up", 13 | "program", 14 | "generate", 15 | "override", 16 | "input", 17 | "connect", 18 | "copy", 19 | "calculate", 20 | "navigate" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/verb.ts: -------------------------------------------------------------------------------- 1 | import { FakeOptions, fake } from './core/core'; 2 | import { data } from './verb.json'; 3 | 4 | /** 5 | * Generate a random verb. 6 | * 7 | * @category text 8 | * 9 | * @example 10 | * 11 | * randVerb() 12 | * 13 | * @example 14 | * 15 | * randVerb({ length: 10 }) 16 | * 17 | */ 18 | export function randVerb( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/weekday.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | "Monday", 4 | "Tuesday", 5 | "Wedneday", 6 | "Thursday", 7 | "Friday", 8 | "Saturday", 9 | "Sunday" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /packages/falso/src/lib/weekday.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { data } from './weekday.json'; 3 | 4 | /** 5 | * Generate a random weekday. 6 | * 7 | * @category date 8 | * 9 | * @example 10 | * 11 | * randWeekday() 12 | * 13 | * @example 14 | * 15 | * randWeekday({ length: 10 }) 16 | * 17 | */ 18 | export function randWeekday( 19 | options?: Options 20 | ) { 21 | return fake(data, options); 22 | } 23 | -------------------------------------------------------------------------------- /packages/falso/src/lib/zip-code.ts: -------------------------------------------------------------------------------- 1 | import { fake, FakeOptions } from './core/core'; 2 | import { randNumber } from './number'; 3 | import { randBoolean } from './boolean'; 4 | 5 | /** 6 | * Generate a random zip code. 7 | * 8 | * @category address 9 | * 10 | * @example 11 | * 12 | * randZipCode() 13 | * 14 | * @example 15 | * 16 | * randZipCode({ length: 10 }) 17 | * 18 | */ 19 | export function randZipCode( 20 | options?: Options 21 | ) { 22 | return fake(() => { 23 | let zipCode = '' + randNumber({ min: 10_000, max: 99_999 }); 24 | 25 | if (randBoolean()) { 26 | zipCode += '-' + randNumber({ min: 1_000, max: 9_999 }); 27 | } 28 | 29 | return zipCode; 30 | }, options); 31 | } 32 | -------------------------------------------------------------------------------- /packages/falso/src/tests/accessory.spec.ts: -------------------------------------------------------------------------------- 1 | import { randAccessory } from '../lib/accessory'; 2 | 3 | describe('accessory', () => { 4 | it('should create', () => { 5 | const accessory = randAccessory(); 6 | 7 | expect(accessory).toBeTruthy(); 8 | expect(typeof accessory).toEqual('string'); 9 | expect(accessory.length).toBeGreaterThan(0); 10 | }); 11 | 12 | it('should create with fixed length', () => { 13 | const givenLength = 8; 14 | const accessory = randAccessory({ length: givenLength }); 15 | 16 | expect(accessory?.length).toEqual(givenLength); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /packages/falso/src/tests/adjective.spec.ts: -------------------------------------------------------------------------------- 1 | import { randAdjective } from '../lib/adjective'; 2 | 3 | describe(' adjective', () => { 4 | it('should return a random adjective (type string)', () => { 5 | expect(typeof randAdjective()).toEqual('string'); 6 | }); 7 | 8 | it('should return a list of adjectives', () => { 9 | const adjectives = randAdjective({ length: 4 }); 10 | 11 | expect(adjectives.length).toEqual(4); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/falso/src/tests/airport-code.spec.ts: -------------------------------------------------------------------------------- 1 | import { randAirportCode } from '../lib/airport-code'; 2 | import { data } from '../lib/airport.json'; 3 | 4 | describe('airportCode', () => { 5 | it('should return an airport code', () => { 6 | const airportCodes = data.map(({ code }) => code); 7 | 8 | const result = randAirportCode(); 9 | 10 | expect(airportCodes).toContain(result); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/falso/src/tests/airport-name.spec.ts: -------------------------------------------------------------------------------- 1 | import { data } from '../lib/airport.json'; 2 | import { randAirportName } from '../lib/airport-name'; 3 | 4 | describe('airportName', () => { 5 | it('should return an airport name', () => { 6 | const airportNames = data.map(({ name }) => name); 7 | 8 | const result = randAirportName(); 9 | 10 | expect(airportNames).toContain(result); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/falso/src/tests/alpha-numeric.spec.ts: -------------------------------------------------------------------------------- 1 | import { randAlphaNumeric } from '../lib/alpha-numeric'; 2 | 3 | describe('randAlphaNumeric', () => { 4 | it('should return an alpha-numeric character', () => { 5 | const result: number | string = randAlphaNumeric(); 6 | 7 | const toBeAlpha = 8 | typeof result === 'string' && 9 | result.length === 1 && 10 | result.match(/^[a-z]*$/); 11 | const toBeNumeric = 12 | typeof result === 'number' && result >= 0 && result < 10; 13 | 14 | expect(toBeAlpha || toBeNumeric).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/falso/src/tests/aws-request-id.spec.ts: -------------------------------------------------------------------------------- 1 | import { randAwsRequestId } from '../lib/aws-request-id'; 2 | 3 | describe('aws request id', () => { 4 | it('should create one random request id', () => { 5 | const randomRequestId = randAwsRequestId(); 6 | 7 | const requestIdRegex = /^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/; 8 | 9 | expect(randomRequestId).toBeTruthy(); 10 | expect(typeof randomRequestId).toEqual('string'); 11 | expect(requestIdRegex.test(randomRequestId)).toBeTruthy(); 12 | }); 13 | 14 | it('should create multiple random binary numbers', () => { 15 | const RESULT_LENGTH = 10; 16 | const randomIds = randAwsRequestId({ length: RESULT_LENGTH }); 17 | 18 | expect(randomIds).toBeTruthy(); 19 | expect(Array.isArray(randomIds)).toBeTruthy(); 20 | expect(randomIds.length).toEqual(RESULT_LENGTH); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /packages/falso/src/tests/aws-service.spec.ts: -------------------------------------------------------------------------------- 1 | import { randAwsService } from '../lib/aws-service'; 2 | 3 | describe('randAwsService', () => { 4 | it('should create a service', () => { 5 | const service = randAwsService(); 6 | 7 | expect(service).toBeTruthy(); 8 | expect(typeof service).toEqual('string'); 9 | expect(service.length).toBeGreaterThan(0); 10 | }); 11 | 12 | it('should create a service with length', () => { 13 | const RESULT_LENGTH = 5; 14 | const services = randAwsService({ length: RESULT_LENGTH }); 15 | 16 | expect(services).toBeTruthy(); 17 | expect(typeof services).toEqual('object'); 18 | expect(services.length).toEqual(RESULT_LENGTH); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/falso/src/tests/book.spec.ts: -------------------------------------------------------------------------------- 1 | import { randBook } from '../lib/book'; 2 | 3 | describe('book', () => { 4 | it('should retrieve a book', () => { 5 | const book = randBook(); 6 | 7 | expect(typeof book.title).toEqual('string'); 8 | expect(typeof book.author).toEqual('string'); 9 | expect(typeof book.category).toEqual('string'); 10 | }); 11 | 12 | it('should retrieve a book from a specific category', () => { 13 | const category = 'Science Fiction and Fantasy'; 14 | const book = randBook({ category }); 15 | 16 | expect(book.category).toEqual(category); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /packages/falso/src/tests/brand.spec.ts: -------------------------------------------------------------------------------- 1 | import { randBrand } from '../lib/brand'; 2 | 3 | describe('brand', () => { 4 | it('should create one brand', () => { 5 | expect(typeof randBrand()).toBe('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/browser.spec.ts: -------------------------------------------------------------------------------- 1 | import { randBrowser } from '../lib/browser'; 2 | 3 | describe('browser', () => { 4 | it('should create one browser', () => { 5 | expect(typeof randBrowser()).toBe('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/clothing-size.spec.ts: -------------------------------------------------------------------------------- 1 | import { randClothingSize } from '../lib/clothing-size'; 2 | 3 | describe('clothingSize', () => { 4 | it('should create one clothing size', () => { 5 | expect(typeof randClothingSize()).toBe('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/code-snippet.spec.ts: -------------------------------------------------------------------------------- 1 | import { CODE_SNIPPET_LANGUAGES, randCodeSnippet } from '../lib/code-snippet'; 2 | 3 | describe('code-snippet', () => { 4 | it('should create one code snippet', () => { 5 | expect(typeof randCodeSnippet()).toBe('string'); 6 | }); 7 | 8 | it('should have a code snippet for all CodeSnippetLang literals', () => { 9 | CODE_SNIPPET_LANGUAGES.forEach((CODE_SNIPPET_LANGUAGE) => { 10 | expect(typeof randCodeSnippet({ lang: CODE_SNIPPET_LANGUAGE })).toBe( 11 | 'string' 12 | ); 13 | }); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /packages/falso/src/tests/credit-card-number.spec.ts: -------------------------------------------------------------------------------- 1 | import { randCreditCardNumber } from '../lib/credit-card-number'; 2 | 3 | describe('randCreditCardNumber', () => { 4 | it('should return a credit card number', () => { 5 | expect(randCreditCardNumber()).toMatch(/^[\d\s]+$/); 6 | }); 7 | 8 | it('should return a Maestro credit card number', () => { 9 | expect( 10 | randCreditCardNumber({ 11 | brand: 'Maestro', 12 | }) 13 | ).toMatch( 14 | /^(5018|5020|5038|5893|6304|6759|6761|6762|6763)\s[0-9\s]{8,18}$/ 15 | ); 16 | }); 17 | 18 | it('should return 10 credit card number', () => { 19 | const cards = randCreditCardNumber({ 20 | length: 10, 21 | brand: 'Maestro', 22 | }); 23 | expect(cards?.length).toEqual(10); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /packages/falso/src/tests/database.spec.ts: -------------------------------------------------------------------------------- 1 | import { randDatabase } from '../lib/database'; 2 | 3 | describe('randDatabase', () => { 4 | it('should create a database', () => { 5 | const database = randDatabase(); 6 | 7 | expect(database).toBeTruthy(); 8 | expect(typeof database).toEqual('string'); 9 | expect(database.length).toBeGreaterThan(0); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/falso/src/tests/drinks.spec.ts: -------------------------------------------------------------------------------- 1 | import { randDrinks } from '../lib/drinks'; 2 | 3 | describe('drinks', () => { 4 | it('should create a drink', () => { 5 | const drink = randDrinks(); 6 | 7 | expect(drink).toBeTruthy(); 8 | expect(typeof drink).toEqual('string'); 9 | expect(drink.length).toBeGreaterThan(0); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/falso/src/tests/emoji.spec.ts: -------------------------------------------------------------------------------- 1 | import { randEmoji } from '../lib/emoji'; 2 | 3 | describe('emoji', () => { 4 | it('should create random emoji', () => { 5 | expect(randEmoji).toBeTruthy(); 6 | }); 7 | 8 | it('should create 20 random emoji', () => { 9 | expect(randEmoji({ length: 20 }).length).toEqual(20); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/falso/src/tests/font-family.spec.ts: -------------------------------------------------------------------------------- 1 | import { randFontFamily } from '../lib/font-family'; 2 | 3 | describe('fontFamily', () => { 4 | it('should create a random font family', () => { 5 | expect(typeof randFontFamily()).toEqual('string'); 6 | 7 | const RESULT_LENGTH = 10; 8 | const multipleRandomFontFamily = randFontFamily({ length: RESULT_LENGTH }); 9 | 10 | expect(typeof multipleRandomFontFamily).toEqual('object'); 11 | expect(multipleRandomFontFamily.length).toEqual(RESULT_LENGTH); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/falso/src/tests/frequency.spec.ts: -------------------------------------------------------------------------------- 1 | import { randFrequency } from '../lib/frequency'; 2 | 3 | describe('frequency', () => { 4 | it('should create one frequency', () => { 5 | expect(typeof randFrequency()).toBe('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/gender.spec.ts: -------------------------------------------------------------------------------- 1 | import { randGender } from '../lib/gender'; 2 | 3 | describe('quote', () => { 4 | it('should return a random gender (type string)', () => { 5 | expect(typeof randGender()).toEqual('string'); 6 | }); 7 | it('should return a random gender code (type string)', () => { 8 | expect(typeof randGender({ code: true })).toEqual('string'); 9 | }); 10 | it('should return a random gender of length 10', () => { 11 | expect(randGender({ length: 10 }).length).toEqual(10); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/falso/src/tests/get-random-in-range.spec.ts: -------------------------------------------------------------------------------- 1 | import { getRandomInRange } from '../lib/core/core'; 2 | 3 | describe('getRandomInRange', () => { 4 | it('should throw error when max is smaller than min', () => { 5 | expect(() => getRandomInRange({ min: 10, max: 1 })).toThrowError( 6 | 'Max must be bigger than min' 7 | ); 8 | }); 9 | 10 | it('should return number in range', () => { 11 | expect(getRandomInRange({ min: 1, max: 10 })).toBeGreaterThanOrEqual(1); 12 | expect(getRandomInRange({ min: 1, max: 10 })).toBeLessThan(11); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /packages/falso/src/tests/hex.spec.ts: -------------------------------------------------------------------------------- 1 | import { randHex } from '../lib/hex'; 2 | 3 | describe('hex', () => { 4 | it('should return a hex string in the correct format', () => { 5 | const expected = /[#]([\dA-F]{6}|[\dA-F]{3})/gi; 6 | expect(randHex()).toEqual(expect.stringMatching(expected)); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /packages/falso/src/tests/integrations.spec.ts: -------------------------------------------------------------------------------- 1 | import { randIntegration } from '../lib/integration'; 2 | 3 | describe('integrations', () => { 4 | it('should create one integration', () => { 5 | expect(typeof randIntegration()).toBe('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/language.spec.ts: -------------------------------------------------------------------------------- 1 | import { randLanguage } from '../lib/language'; 2 | 3 | describe('language', () => { 4 | it('should create one language', () => { 5 | expect(typeof randLanguage()).toBe('string'); 6 | }); 7 | it('should create ISO 639-1 compliant language codes', () => { 8 | expect(randLanguage({ code: true })).toHaveLength(2); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/falso/src/tests/mask.spec.ts: -------------------------------------------------------------------------------- 1 | import { randMask } from '../lib/mask'; 2 | 3 | describe('mask', () => { 4 | it('should return a random string', () => { 5 | expect(typeof randMask()).toEqual('string'); 6 | }); 7 | 8 | it('should return a random string from mask', () => { 9 | expect( 10 | randMask({ 11 | mask: '#@#@###@#@#@##@#@#@@#@#@#@@@@#@#', 12 | }) 13 | ).toMatch(/^[a-z0-9]{32}$/gi); 14 | }); 15 | 16 | it('should return 20 random string', () => { 17 | const masks = randMask({ 18 | length: 20, 19 | }); 20 | expect(masks.length).toEqual(20); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /packages/falso/src/tests/motorcycle-manufacturer.spec.ts: -------------------------------------------------------------------------------- 1 | import { randMotorcycleManufacturer } from '../lib/motorcycle-manufacturer'; 2 | 3 | describe('motorcycleManufacturer', () => { 4 | it('should retrieve one motorcycle manufacturer', () => { 5 | expect(typeof randMotorcycleManufacturer()).toBe('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/movie-character.spec.ts: -------------------------------------------------------------------------------- 1 | import { randMovieCharacter } from '../lib/movie-character'; 2 | 3 | describe('movieCharacter', () => { 4 | it('should create', () => { 5 | expect(typeof randMovieCharacter()).toBe('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/movie.spec.ts: -------------------------------------------------------------------------------- 1 | import { randMovie } from '../lib/movie'; 2 | 3 | describe('movie', () => { 4 | it('should return a random movie (type string)', () => { 5 | expect(typeof randMovie()).toEqual('string'); 6 | }); 7 | 8 | it('should return 10 random movies', () => { 9 | expect(randMovie({ length: 10 })).toHaveLength(10); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/falso/src/tests/noun.spec.ts: -------------------------------------------------------------------------------- 1 | import { randNoun } from '../lib/noun'; 2 | 3 | describe(' noun', () => { 4 | it('should return a random noun (type string)', () => { 5 | expect(typeof randNoun()).toEqual('string'); 6 | }); 7 | 8 | it('should return a list of nouns', () => { 9 | const adjectives = randNoun({ length: 4 }); 10 | 11 | expect(adjectives.length).toEqual(4); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/falso/src/tests/octal.spec.ts: -------------------------------------------------------------------------------- 1 | import { randOctal } from '../lib/octal'; 2 | 3 | describe('octal', () => { 4 | it('should create', () => { 5 | const octNumber = randOctal(); 6 | 7 | expect(octNumber).toBeTruthy(); 8 | expect(octNumber).toBeGreaterThanOrEqual(0); 9 | 10 | const octRegex = /[0-7]+/; 11 | expect(octRegex.test(octNumber.toString())).toBeTruthy(); 12 | }); 13 | 14 | it('should return an octa array', () => { 15 | const length = 5; 16 | const octNumbers = randOctal({ length }); 17 | 18 | expect(Array.isArray(octNumbers)).toBe(true); 19 | expect(octNumbers.length).toEqual(length); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/falso/src/tests/permission.spec.ts: -------------------------------------------------------------------------------- 1 | import { randPermission } from '../lib/permission'; 2 | 3 | describe('permission', () => { 4 | it('should create', () => { 5 | expect(randPermission).toBeTruthy(); 6 | }); 7 | 8 | it('should create one permission', () => { 9 | expect(typeof randPermission()).toBe('string'); 10 | }); 11 | 12 | it('should create one numeric permissions', () => { 13 | expect(typeof randPermission({ numeric: true })).toBe('number'); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /packages/falso/src/tests/post.spec.ts: -------------------------------------------------------------------------------- 1 | import { randPost } from '../lib/post'; 2 | 3 | describe('post', () => { 4 | it('should create one post', () => { 5 | expect(typeof randPost()).toBe('object'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/priority.spec.ts: -------------------------------------------------------------------------------- 1 | import { randPriority } from '../lib/priority'; 2 | 3 | describe('priority', () => { 4 | it('should create one priority', () => { 5 | expect(typeof randPriority()).toBe('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/product-category.spec.ts: -------------------------------------------------------------------------------- 1 | import { randProductCategory } from '../lib/product-category'; 2 | 3 | describe('productCategory', () => { 4 | it('should return a category of product (type string)', () => { 5 | expect(typeof randProductCategory()).toEqual('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/protocol.spec.ts: -------------------------------------------------------------------------------- 1 | import { randProtocol } from '../lib/protocol'; 2 | 3 | describe('protocol', () => { 4 | it('should create a protocol', () => { 5 | const protocol = randProtocol(); 6 | 7 | expect(typeof protocol).toEqual('string'); 8 | }); 9 | it('should create a protocol with its full name', () => { 10 | const protocol = randProtocol({ fullName: true }); 11 | 12 | expect(typeof protocol).toEqual('string'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /packages/falso/src/tests/quote.spec.ts: -------------------------------------------------------------------------------- 1 | import { randQuote } from '../lib/quote'; 2 | 3 | describe('quote', () => { 4 | it('should return a random quote (type string)', () => { 5 | expect(typeof randQuote()).toEqual('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/resolution.spec.ts: -------------------------------------------------------------------------------- 1 | import { randResolution } from '../lib/resolution'; 2 | 3 | describe('randResolution', () => { 4 | it('should return an object with properties width and height', () => { 5 | const resolution = randResolution(); 6 | const width = parseInt(resolution.width); 7 | const height = parseInt(resolution.height); 8 | 9 | expect(resolution).toBeTruthy(); 10 | expect(typeof resolution).toBe('object'); 11 | expect(resolution).toHaveProperty('width'); 12 | expect(resolution).toHaveProperty('height'); 13 | expect(Number.isInteger(width)).toBe(true); 14 | expect(Number.isInteger(height)).toBe(true); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/falso/src/tests/seat-number.spec.ts: -------------------------------------------------------------------------------- 1 | import { randSeatNumber } from '../lib/seat-number'; 2 | 3 | describe('seatNumber', () => { 4 | it('should return a seat in the correct format', () => { 5 | const result = randSeatNumber(); 6 | 7 | expect(result).toMatch(/^(?:[1-9]|[1-2][0-9]|3[0-3])[A-Z]$/); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/falso/src/tests/shape.spec.ts: -------------------------------------------------------------------------------- 1 | import { randShape } from '../lib/shape'; 2 | 3 | describe('shapes', () => { 4 | it('should create', () => { 5 | expect(typeof randShape()).toBe('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/singer.spec.ts: -------------------------------------------------------------------------------- 1 | import { randSinger } from '../lib/singer'; 2 | 3 | describe('singer', () => { 4 | it('should return a random singer (type string)', () => { 5 | expect(typeof randSinger()).toEqual('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/slug.spec.ts: -------------------------------------------------------------------------------- 1 | import { randSlug } from '../lib/slug'; 2 | 3 | describe('slug', () => { 4 | it('should create', () => { 5 | expect(typeof randSlug()).toBe('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/song.spec.ts: -------------------------------------------------------------------------------- 1 | import { randSong } from '../lib/song'; 2 | 3 | describe('song', () => { 4 | it('should return a random song (type string)', () => { 5 | expect(typeof randSong()).toBe('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/status.spec.ts: -------------------------------------------------------------------------------- 1 | import { randStatus } from '../lib/status'; 2 | 3 | describe('status', () => { 4 | it('should create', () => { 5 | expect(randStatus).toBeTruthy(); 6 | }); 7 | 8 | it('should create random status', () => { 9 | expect(randStatus()).toBeTruthy(); 10 | }); 11 | 12 | it('should create random user story status', () => { 13 | expect( 14 | randStatus({ 15 | type: 'User Story', 16 | }) 17 | ).toBeTruthy(); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/falso/src/tests/subscription-plan.spec.ts: -------------------------------------------------------------------------------- 1 | import { randSubscriptionPlan } from '../lib/subscription-plan'; 2 | 3 | describe('subscriptionPlan', () => { 4 | it('should create', () => { 5 | expect(typeof randSubscriptionPlan()).toBe('string'); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/falso/src/tests/svg.spec.ts: -------------------------------------------------------------------------------- 1 | import { randSvg } from '../lib/svg'; 2 | 3 | describe('svg', () => { 4 | it('should create', () => { 5 | const svg = randSvg(); 6 | 7 | expect(svg).toBeTruthy(); 8 | expect(typeof svg).toEqual('string'); 9 | expect(svg.length).toBeGreaterThan(0); 10 | 11 | const svgRegex = /^]*?(?:viewBox="(\b[^"]*)")?>([\s\S]*?)<\/svg>$/; 12 | 13 | expect(svgRegex.test(svg)).toBeTruthy(); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /packages/falso/src/tests/todo.spec.ts: -------------------------------------------------------------------------------- 1 | import { randTodo } from '../lib/todo'; 2 | 3 | describe('todo', () => { 4 | it('should create a todo', () => { 5 | const todo = randTodo(); 6 | 7 | expect(typeof todo.title).toEqual('string'); 8 | expect(typeof todo.id).toEqual('string'); 9 | expect(typeof todo.completed).toEqual('boolean'); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/falso/src/tests/uuid.spec.ts: -------------------------------------------------------------------------------- 1 | import { randUuid } from '../lib/uuid'; 2 | import { seed } from '../lib/random'; 3 | 4 | describe('uuid', () => { 5 | afterAll(() => { 6 | seed(); 7 | }); 8 | 9 | it('should generate different uuids when length option is passed', () => { 10 | const arr = randUuid({ length: 2 }); 11 | expect(arr[0]).not.toEqual(arr[1]); 12 | }); 13 | 14 | it('should generate uuid from seed', () => { 15 | seed('🙃🔥😊'); 16 | expect(randUuid()).toEqual('02c11a83-1678-4638-9e55-39d543c31599'); 17 | seed('🚀🚀🚀'); 18 | expect(randUuid()).toEqual('b9b0b6f3-8e6d-4853-b562-e726ee32fec2'); 19 | seed('🙃🔥😊'); 20 | expect(randUuid()).toEqual('02c11a83-1678-4638-9e55-39d543c31599'); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /packages/falso/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.lib.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | } 12 | ], 13 | "compilerOptions": { 14 | "forceConsistentCasingInFileNames": true, 15 | "strict": true, 16 | "noImplicitReturns": true, 17 | "noFallthroughCasesInSwitch": true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/falso/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": [] 7 | }, 8 | "include": ["**/*.ts"], 9 | "exclude": ["**/*.spec.ts", "jest.config.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/falso/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "**/*.test.ts", 10 | "**/*.spec.ts", 11 | "**/*.test.tsx", 12 | "**/*.spec.tsx", 13 | "**/*.test.js", 14 | "**/*.spec.js", 15 | "**/*.test.jsx", 16 | "**/*.spec.jsx", 17 | "**/*.d.ts", 18 | "jest.config.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /scripts/update-functions-count.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const {execSync} = require('child_process'); 3 | 4 | function readFile(path) { 5 | return fs.readFileSync(path).toString('utf8'); 6 | } 7 | 8 | const exportedFunctions = readFile('packages/falso/src/index.ts'); 9 | const functionsCount = exportedFunctions.match(/rand\w+/g).length; 10 | 11 | for (const path of ['README.md', 'docs/docs/getting-started.mdx']) { 12 | const file = readFile(path); 13 | const updated = file.replace(/\d+ Functions/, `${functionsCount} Functions`); 14 | if (updated !== file) { 15 | fs.writeFileSync(path, updated); 16 | execSync(`git add ${path}`); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tools/executors/build-locales/executor.json: -------------------------------------------------------------------------------- 1 | { 2 | "executors": { 3 | "build-locales": { 4 | "implementation": "./index", 5 | "schema": "./schema.json" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tools/executors/build-locales/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "executors": "./executor.json" 3 | } 4 | -------------------------------------------------------------------------------- /tools/executors/build-locales/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "type": "object", 4 | "cli": "nx", 5 | "properties": { 6 | "localesOutputPath": { 7 | "type": "string", 8 | "description": "Locales output path" 9 | }, 10 | "localesSourcePath": { 11 | "type": "string", 12 | "description": "Locales src path" 13 | }, 14 | "falsoSourcePath": { 15 | "type": "string", 16 | "description": "Falso src path" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tools/executors/manipulator/executor.json: -------------------------------------------------------------------------------- 1 | { 2 | "executors": { 3 | "manipulator": { 4 | "implementation": "./index", 5 | "schema": "./schema.json" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tools/executors/manipulator/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "executors": "./executor.json" 3 | } 4 | -------------------------------------------------------------------------------- /tools/executors/manipulator/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "type": "object", 4 | "cli": "nx", 5 | "properties": {} 6 | } 7 | -------------------------------------------------------------------------------- /tools/executors/translate/.gitignore: -------------------------------------------------------------------------------- 1 | *.js -------------------------------------------------------------------------------- /tools/executors/translate/constants.ts: -------------------------------------------------------------------------------- 1 | export const UNICODE_REGEXP = /\\u([\d\w]{4})/gi; 2 | export const COMMENT = `// THIS FILE IS AUTO-GENERATED THROUGH \`npm run translate\``; 3 | export const TYPE_SCRIPT_FILE_EXTENSION = '.ts'; 4 | -------------------------------------------------------------------------------- /tools/executors/translate/executor.json: -------------------------------------------------------------------------------- 1 | { 2 | "executors": { 3 | "translate": { 4 | "implementation": "./index", 5 | "schema": "./schema.json", 6 | "description": "Generates translation file" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tools/executors/translate/files/.gitignore: -------------------------------------------------------------------------------- 1 | google-cloud-secret.json -------------------------------------------------------------------------------- /tools/executors/translate/files/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngneat/falso/449ee5470ae52c973f7e4b487620d23e5e38686d/tools/executors/translate/files/.gitkeep -------------------------------------------------------------------------------- /tools/executors/translate/files/google-cloud-secret.example.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "service_account", 3 | "project_id": "ngneat-falso", 4 | "private_key_id": "XXXX", 5 | "private_key": "-----BEGIN PRIVATE KEY-----\nXXXX\n-----END PRIVATE KEY-----\n", 6 | "client_email": "XXXX@YYYY.iam.gserviceaccount.com", 7 | "client_id": "XXXX", 8 | "auth_uri": "https://accounts.google.com/o/oauth2/auth", 9 | "token_uri": "https://oauth2.googleapis.com/token", 10 | "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", 11 | "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/XXXX" 12 | } 13 | -------------------------------------------------------------------------------- /tools/executors/translate/options.ts: -------------------------------------------------------------------------------- 1 | export interface EchoExecutorOptions { 2 | path: string[]; 3 | languages: string[]; 4 | output: string; 5 | } 6 | -------------------------------------------------------------------------------- /tools/executors/translate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "executors": "./executor.json" 3 | } 4 | -------------------------------------------------------------------------------- /tools/executors/translate/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "type": "object", 4 | "cli": "nx", 5 | "properties": { 6 | "path": { 7 | "type": "array", 8 | "description": "Files to translate", 9 | "items": { 10 | "type": "string" 11 | } 12 | }, 13 | "languages": { 14 | "type": "array", 15 | "description": "Languages", 16 | "items": { 17 | "type": "string" 18 | }, 19 | "minItems": 1 20 | }, 21 | "output": { 22 | "type": "string", 23 | "description": "The output dir path" 24 | } 25 | }, 26 | "required": ["path", "languages", "output"] 27 | } 28 | -------------------------------------------------------------------------------- /tools/tsconfig.tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc/tools", 5 | "rootDir": ".", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": ["node"], 9 | "importHelpers": false 10 | }, 11 | "include": ["**/*.ts"] 12 | } 13 | -------------------------------------------------------------------------------- /tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "rootDir": ".", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "importHelpers": true, 11 | "target": "ES2020", 12 | "module": "esnext", 13 | "lib": ["ES2020", "dom"], 14 | "skipLibCheck": true, 15 | "skipDefaultLibCheck": true, 16 | "allowSyntheticDefaultImports": true, 17 | "esModuleInterop": true, 18 | "baseUrl": ".", 19 | "paths": { 20 | "@ngneat/falso": ["packages/falso/src/index.ts"] 21 | }, 22 | "resolveJsonModule": true 23 | }, 24 | "exclude": ["node_modules", "tmp"] 25 | } 26 | --------------------------------------------------------------------------------