{"id":22186007,"url":"https://github.com/pigulla/class-validator-extended","last_synced_at":"2025-04-06T01:09:29.154Z","repository":{"id":37072473,"uuid":"368771826","full_name":"pigulla/class-validator-extended","owner":"pigulla","description":"Additional validators for class-validator.","archived":false,"fork":false,"pushed_at":"2025-03-28T18:31:01.000Z","size":10548,"stargazers_count":44,"open_issues_count":5,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T23:08:41.551Z","etag":null,"topics":["class-validator","typescript","validation"],"latest_commit_sha":null,"homepage":"https://pigulla.github.io/class-validator-extended/index.html","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pigulla.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-19T06:52:00.000Z","updated_at":"2025-03-28T17:53:38.000Z","dependencies_parsed_at":"2024-03-05T07:30:34.855Z","dependency_job_id":"f6783264-3690-49cd-a7a1-939a7914302e","html_url":"https://github.com/pigulla/class-validator-extended","commit_stats":{"total_commits":372,"total_committers":3,"mean_commits":124.0,"dds":"0.17204301075268813","last_synced_commit":"f00b947f26ecbd7346d0d39c987f3b684b657983"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pigulla%2Fclass-validator-extended","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pigulla%2Fclass-validator-extended/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pigulla%2Fclass-validator-extended/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pigulla%2Fclass-validator-extended/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pigulla","download_url":"https://codeload.github.com/pigulla/class-validator-extended/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419860,"owners_count":20936012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["class-validator","typescript","validation"],"created_at":"2024-12-02T10:19:42.334Z","updated_at":"2025-04-06T01:09:29.135Z","avatar_url":"https://github.com/pigulla.png","language":"TypeScript","readme":"![Typescript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg?style=flat-square)\n[![npm](https://img.shields.io/npm/v/class-validator-extended?style=flat-square\u0026cacheSeconds=3600)](https://www.npmjs.com/package/class-validator-extended)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/pigulla/class-validator-extended/build-and-test.yml?style=flat-square)\n[![GitHub Issues](https://img.shields.io/github/issues-raw/pigulla/class-validator-extended?style=flat-square\u0026cacheSeconds=3600)](https://github.com/pigulla/class-validator-extended/issues)\n[![libraries.io](https://img.shields.io/librariesio/release/npm/class-validator-extended?style=flat-square\u0026cacheSeconds=3600)](https://libraries.io/npm/class-validator-extended)\n[![Codecov](https://img.shields.io/codecov/c/github/pigulla/class-validator-extended?style=flat-square\u0026cacheSeconds=3600)](https://app.codecov.io/gh/pigulla/class-validator-extended)\n[![npm bundle size](https://img.shields.io/bundlephobia/min/class-validator-extended?style=flat-square\u0026cacheSeconds=3600)](https://bundlephobia.com/package/class-validator-extended)\n\n# class-validator-extended\n\n\u003e Additional validators for [class-validator](https://github.com/typestack/class-validator).\n\n#### Safe and simple to use\n\n- 🕵️‍♀️ [Thoroughly tested](https://app.codecov.io/gh/pigulla/class-validator-extended)\n- 📝 [Well documented](https://pigulla.github.io/class-validator-extended/index.html)\n- ✨ No additional dependencies ([Day.js](https://day.js.org/) is supported but optional)\n- 😊 Uses [Semantic Versioning](https://semver.org/) and keeps a [nice](https://keepachangelog.com/en/1.0.0/) [Changelog](https://github.com/pigulla/class-validator-extended/blob/main/CHANGELOG.md)\n\n## Installation\n\nUse your favorite package manager to install:\n\n```bash\nnpm install class-validator-extended\n```\n\nFor obvious reasons, [class-validator](https://github.com/typestack/class-validator) needs to be installed.\n\n## Usage\n\nJust use the decorators like any of the built-in ones:\n\n```typescript\nimport { ArrayMinSize } from 'class-validator'\nimport { ArrayMonotonic } from 'class-validator-extended'\n\nclass Foo {\n    @ArrayMinSize(2)\n    @ArrayMonotonic()\n    values: [1, 13, 42]\n}\n```\n\nIf you don't have [Dayjs](https://day.js.org/) installed you need to use the `minimal` export:\n\n```typescript\nimport { MaxBigInt } from 'class-validator-extended/dist/minimal'\n```\n\nPlease note that Dayjs is an [optional dependency](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#optionaldependencies) and will by default be installed by npm and yarn. To avoid this use `npm install --omit optional` or `yarn install --ignore-optional`, respectively.\n\n## Validation decorators\n\nFor detailed information please read the [API docs](https://pigulla.github.io/class-validator-extended/modules.html).\n\n| Decorator                                    | Description                                                                                                 |                                            API                                             |\n| :------------------------------------------- | :---------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------: |\n| **Type**                                     |                                                                                                             |                                                                                            |\n| `@IsBigInt(options?)`                        | Checks if the given value is a BigInt.                                                                      |      [🔗](https://pigulla.github.io/class-validator-extended/functions/IsBigInt.html)      |\n| `@IsDayjs(options?)`                         | Checks if the given value is a valid Dayjs object.                                                          |      [🔗](https://pigulla.github.io/class-validator-extended/functions/IsDayjs.html)       |\n| `@IsDuration(options?)`                      | Checks if the given value is a valid Dayjs duration.                                                        |     [🔗](https://pigulla.github.io/class-validator-extended/functions/IsDuration.html)     |\n| `@IsNull(options?)`                          | Checks if the given value is null.                                                                          |       [🔗](https://pigulla.github.io/class-validator-extended/functions/IsNull.html)       |\n| `@IsMap(options?)`                           | Checks if the given value is a Map.                                                                         |       [🔗](https://pigulla.github.io/class-validator-extended/functions/IsMap.html)        |\n| `@IsSet(options?)`                           | Checks if the given value is a Set.                                                                         |       [🔗](https://pigulla.github.io/class-validator-extended/functions/IsSet.html)        |\n| **Common**                                   |                                                                                                             |                                                                                            |\n| `@Nullable(options?)`                        | Only validates the given value if it is not `null`.                                                         |      [🔗](https://pigulla.github.io/class-validator-extended/functions/Nullable.html)      |\n| `@Optional(options?)`                        | Only validates the given value if it is not `undefined`.                                                    |      [🔗](https://pigulla.github.io/class-validator-extended/functions/Optional.html)      |\n| **Array**                                    |                                                                                                             |                                                                                            |\n| `@ArrayMonotonic(options?)`                  | Checks if the given value is an array sorted in either (strictly) ascending or (strictly) descending order. |   [🔗](https://pigulla.github.io/class-validator-extended/functions/ArrayMonotonic.html)   |\n| `@ArraySize(size, options?)`                 | Checks if the given value is an array with exactly `size` elements.                                         |     [🔗](https://pigulla.github.io/class-validator-extended/functions/ArraySize.html)      |\n| **BigInt**                                   |                                                                                                             |                                                                                            |\n| `@MaxBigInt(maximum, options?)`              | Checks if the given value is a BigInt not greater than `maximum`.                                           |     [🔗](https://pigulla.github.io/class-validator-extended/functions/MaxBigInt.html)      |\n| `@MinBigInt(minimum, options?)`              | Checks if the given value is a BigInt not less than `minimum`.                                              |     [🔗](https://pigulla.github.io/class-validator-extended/functions/MinBigInt.html)      |\n| `@NegativeBigInt(options?)`                  | Checks if the given value is a BigInt less than zero.                                                       |   [🔗](https://pigulla.github.io/class-validator-extended/functions/NegativeBigInt.html)   |\n| `@PositiveBigInt(options?)`                  | Checks if the given value is a BigInt greater than zero.                                                    |   [🔗](https://pigulla.github.io/class-validator-extended/functions/PositiveBigInt.html)   |\n| **Date**                                     |                                                                                                             |                                                                                            |\n| `@FutureDate(options?)`                      | Checks if the given value is a Date object in the future.                                                   |     [🔗](https://pigulla.github.io/class-validator-extended/functions/FutureDate.html)     |\n| `@PastDate(options?)`                        | Checks if the given value is a Date object in the past.                                                     |      [🔗](https://pigulla.github.io/class-validator-extended/functions/PastDate.html)      |\n| **Dayjs**                                    |                                                                                                             |                                                                                            |\n| `@FutureDayjs(options?)`                     | Checks if the given value is a valid Dayjs object in the future.                                            |    [🔗](https://pigulla.github.io/class-validator-extended/functions/FutureDayjs.html)     |\n| `@MaxDayjs(maximum, options?)`               | Checks if the given value is a valid Dayjs object not later than `maximum`.                                 |      [🔗](https://pigulla.github.io/class-validator-extended/functions/MaxDayjs.html)      |\n| `@MaxDuration(minimum, options?)`            | Checks if the given value is a valid Dayjs duration not longer than `maximum`.                              |    [🔗](https://pigulla.github.io/class-validator-extended/functions/MaxDuration.html)     |\n| `@MinDayjs(minimum, options?)`               | Checks if the given value is a valid Dayjs object not earlier than `minimum`.                               |      [🔗](https://pigulla.github.io/class-validator-extended/functions/MinDayjs.html)      |\n| `@MinDuration(minimum, options?)`            | Checks if the given value is a valid Dayjs duration not shorter than `minimum`.                             |    [🔗](https://pigulla.github.io/class-validator-extended/functions/MinDuration.html)     |\n| `@PastDayjs(options?)`                       | Checks if the given value is a valid Dayjs object in the past.                                              |     [🔗](https://pigulla.github.io/class-validator-extended/functions/PastDayjs.html)      |\n| **Map**                                      |                                                                                                             |                                                                                            |\n| `@MapContains(required, options?)`           | Checks if the given value is a Map and contains all `required` values.                                      |    [🔗](https://pigulla.github.io/class-validator-extended/functions/MapContains.html)     |\n| `@MapContainsKeys(required, options?)`       | Checks if the given value is a Map and contains all `required` keys.                                        |  [🔗](https://pigulla.github.io/class-validator-extended/functions/MapContainsKeys.html)   |\n| `@MapMaxSize(maximum, options?)`             | Checks if the given value is a Map with no more than `maximum` entries.                                     |     [🔗](https://pigulla.github.io/class-validator-extended/functions/MapMaxSize.html)     |\n| `@MapMinSize(minimum, options?)`             | Checks if the given value is a Map with no fewer than `minimum` entries.                                    |     [🔗](https://pigulla.github.io/class-validator-extended/functions/MapMinSize.html)     |\n| `@MapNotContains(forbidden, options?)`       | Checks if the given value is a Map which does not contain any of the `forbidden` values.                    |   [🔗](https://pigulla.github.io/class-validator-extended/functions/MapNotContains.html)   |\n| `@MapNotContainsKeys(forbidden, options?)`   | Checks if the given value is a Map which does not contain any of the `forbidden` keys.                      | [🔗](https://pigulla.github.io/class-validator-extended/functions/MapNotContainsKeys.html) |\n| `@MapNotEmpty(options?)`                     | Checks if the given value is a Map with at least one entry.                                                 |    [🔗](https://pigulla.github.io/class-validator-extended/functions/MapNotEmpty.html)     |\n| `@MapSize(size, options?)`                   | Checks if the given value is a Map with exactly `size` entries.                                             |      [🔗](https://pigulla.github.io/class-validator-extended/functions/MapSize.html)       |\n| `@MapUnique(projection, options?)`           | Checks if the given value is a Map without duplicates with regard to the given `projection`.                |     [🔗](https://pigulla.github.io/class-validator-extended/functions/MapUnique.html)      |\n| `@MapUniqueKeys(projection, options?)`       | Checks if the given value is a Map whose keys are all unique with regard to the given `projection`.         |   [🔗](https://pigulla.github.io/class-validator-extended/functions/MapUniqueKeys.html)    |\n| **Number**                                   |                                                                                                             |                                                                                            |\n| `@IsNetworkPort(options?)`                   | Checks if the given value is a valid port number.                                                           |   [🔗](https://pigulla.github.io/class-validator-extended/functions/IsNetworkPort.html)    |\n| **Set**                                      |                                                                                                             |                                                                                            |\n| `@SetContains(required, options?)`           | Checks if the given value is a Set and contains all required values.                                        |    [🔗](https://pigulla.github.io/class-validator-extended/functions/SetContains.html)     |\n| `@SetMaxSize(maximum, options?)`             | Checks if the given value is a Set with no more than `maximum` values.                                      |     [🔗](https://pigulla.github.io/class-validator-extended/functions/SetMaxSize.html)     |\n| `@SetMinSize(minimum, options?)`             | Checks if the given value is a Set with no fewer than `minimum` values.                                     |     [🔗](https://pigulla.github.io/class-validator-extended/functions/SetMinSize.html)     |\n| `@SetNotContains(forbidden, options?)`       | Checks if the given value is a Set which does not contain any of the `forbidden` values.                    |   [🔗](https://pigulla.github.io/class-validator-extended/functions/SetNotContains.html)   |\n| `@SetSize(size, options?)`                   | Checks if the given value is a Set with exactly `size` entries.                                             |      [🔗](https://pigulla.github.io/class-validator-extended/functions/SetSize.html)       |\n| `@SetNotEmpty(options?)`                     | Checks if the given value is a Set with at least one value.                                                 |    [🔗](https://pigulla.github.io/class-validator-extended/functions/SetNotEmpty.html)     |\n| `@SetUnique(projection, options?)`           | Checks if the given value is a Set without duplicate values with regard to the given `projection`.          |     [🔗](https://pigulla.github.io/class-validator-extended/functions/SetUnique.html)      |\n| **String**                                   |                                                                                                             |                                                                                            |\n| `@IsAwsRegion(options?)`                     | Checks if the given value is an AWS region string.                                                          |    [🔗](https://pigulla.github.io/class-validator-extended/functions/IsAwsRegion.html)     |\n| `@IsAwsARN(options?)`                        | Checks if the given value is an AWS ARN string.                                                             |      [🔗](https://pigulla.github.io/class-validator-extended/functions/IsAwsARN.html)      |\n| `@NotMatches(pattern, modifiers?, options?)` | Checks if the given value is an string that does not match the given regular expression.                    |     [🔗](https://pigulla.github.io/class-validator-extended/functions/NotMatches.html)     |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpigulla%2Fclass-validator-extended","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpigulla%2Fclass-validator-extended","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpigulla%2Fclass-validator-extended/lists"}