# custom-class-validator-tools

> | Decorator | Type | Description| | --- | --- | --- | | @IsNullableString | string | null | If want to ignore value ≠= ‘’, @IsNullableString({ blank: true }) | | @IsUndefinableString | string | undefined | If want to ignore value ≠= ‘’, @IsUn

Latest version **1.2.26** (published 2026-09-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install custom-class-validator-tools
pnpm add custom-class-validator-tools
yarn add custom-class-validator-tools
bun add custom-class-validator-tools
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.2.26 |
| Published | 2026-09-19 |
| First published | 2022-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 108.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | internalservererror |
| Maintainers | internalservererror, obtamanyikibwa |

## Links

- npm: https://www.npmjs.com/package/custom-class-validator-tools
- npm.io page: https://npm.io/package/custom-class-validator-tools

## Dependencies (4)

- [dayjs](https://npm.io/package/dayjs.md) ^1.11.21
- [fp-ts](https://npm.io/package/fp-ts.md) ^2.16.11
- [class-validator](https://npm.io/package/class-validator.md) ^0.15.1
- [class-transformer](https://npm.io/package/class-transformer.md) ^0.5.1

## Recent versions

- 1.2.26 (latest) — 2026-09-19
- 1.2.25 — 2026-09-02
- 1.2.24 — 2026-08-09
- 1.2.23 — 2026-07-15
- 1.2.22 — 2026-06-29
- 1.2.21 — 2026-06-06
- 1.2.20 — 2026-05-22
- 1.2.19 — 2026-04-24
- 1.2.18 — 2026-03-27
- 1.2.17 — 2026-02-28
- 1.2.16 — 2026-02-18
- 1.2.15 — 2026-01-31
- 1.2.14 — 2026-01-09
- 1.2.13 — 2025-12-27
- 1.2.12 — 2025-12-20
- … 103 more at https://npm.io/package/custom-class-validator-tools/versions

## README

## String type decorator


| Decorator            | Type   | Description|
| --- | --- | --- |
| @IsNullableString | string | null | If want to ignore value ≠= ‘’, @IsNullableString({ blank: true }) |
| @IsUndefinableString | string | undefined | If want to ignore value ≠= ‘’, @IsUndefinableString({ blank: true }) |
| @IsOptionalString | string | null | undefined | If want to ignore value ≠= ‘’, @IsOptionalString({ blank: true }) |
| @IsNotEmptyNumberString | string | Checks a string is a number |
| @IsNotEmptyBooleanString | string | Checks a string is a boolean |
| @IsNullableNumberString | string | null | Checks a string is a number or null |
| @IsNullableBooleanString | string | null | Checks a string is a boolean or null |
| @IsUndefinableNumberString | string | undefined | Checks a string is a number or undefined |
| @IsUndefinableBooleanString | string | undefined | Checks a string is a boolean or null |
| @IsOptionalNumberString | string | null | undefined | Checks a string is a number or  null or undefined |
| @IsOptionalBooleanString | string | null | undefined | Checks a string is a boolean or  null or undefined |

## Number type decorator


| Decorator            | Type   |
|----------------------|--------|
| @IsNotEmptyNumber    | number |
| @IsNullableNumber    | nubmer | null |
| @IsUndefinableNumber | number | undefined |
| @IsOptionalNumber    | number | null | undefined |
|                      |        |

## Boolean type decorator

| Decorator            | Type   |
| --- | --- |
| @IsNotEmptyBoolean | boolean |
| @IsNullableBoolean | boolean | null |
| @IsUndefinalbeBoolean | boolean | undefined |
| @IsOptionalBoolean | boolean | null | undefined |

## ValidateNested usage case

```ts
import { isNotEmptyString, IsNotEmptyBoolean, isNullable, IsUndefinable } from 'custom-class-validator-tools';
import { IsInstance, ArrayNotEmpty, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';

class Tag {
  @IsNotEmptyString()
  tag1: string;
  @IsNotEmptyString()
  tag2: string;
}

class Result {
  @IsNotEmptyBoolean()
  failed: boolean;
}

class Post {
  @IsNullable()
  @ArrayNotEmpty()
  @IsInstance(Tag, { each: true })
  @ValidateNested({ each: true })
  @Type(() => Tag)
  tags: Tag[] | null;

  @IsUndefinable()
  @IsInstance(Result)
  @ValidateNested()
  @Type(() => Result)
  result?: Result;
}
```

---
_Source: https://npm.io/package/custom-class-validator-tools · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
