Closed Rober9614 closed 2 months ago
I would suggest you apply code formatting to your issue like this:
```ts
const myconst : number = 1234;
Which results in this:
```ts
const myconst : number = 1234;
Also, I suppose there is a discussion to be held whether or not this feature request belongs in https://github.com/validatorjs/validator.js, which powers the validation in this project
For anyone looking for a quick workaround right now, best is to define your custom decorator. Can refer to https://github.com/pigulla/class-validator-extended/blob/main/src/bigint/is-bigint/is-bigint.decorator.ts on how to make one.
Also, I suppose there is a discussion to be held whether or not this feature request belongs in https://github.com/validatorjs/validator.js, which powers the validation in this project
@braaar I was also curious whether you guys had the discussion?
@braaar I was also curious whether you guys had the discussion?
I have not brought it up in validator.js, and I haven't been paying special attention to whether or not @Rober9614 has done so either. Perhaps you could make an issue about it there, @rohanrajpal?
Without looking very much into it I suspect that this functionality could be implemented as an option in an existing validator in that project. Could the options in isInt
be of use? I'm not used to working with BigInts.
@braaar LTM like validator.js
is already good w/BigInt:
> const bi = BigInt(Number.MAX_SAFE_INTEGER) * 3n;
undefined
> validator.isInt(String(bi));
true
In-contrast, class-validator
's @IsInt
(as-well-as @IsNegative
, @IsPositive
, etc) all check for type number
.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Description
Its necessary create BingInt validator. This validator its necessary allow string or numbers, its necessary because its posible that existe BigInt type:
Only its required validate if input its number or string, but only if type is BigInt
Proposed solution
Code of solution: