ic-operator-validation
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

IC-OPERATOR-VALIDATION

This lib compares and validates two values you provide.

After importing the lib, for the implementation we need to:

Instance class OperatorValidator with the following parameters

{
  type_of_value: string,
  value: unknown,
  value_to_compare: unknown,
  operator?: string // if empty it's going to consider 'EQUALS'
}

The values for type_of_value can be:

'string', 'boolean', 'number', 'date', 'datetime'

The values for operator can be:

'EQUALS', 'DIFF', 'STARTING', 'ENDING', 'BIGGER', 'MINOR', 'BIGGEREQ', 'MINOREQ', 'IN', 'NOT_IN', 'HAS_DAY', 'HAS_MONTH', 'HAS_YEAR', 'IN_WEEK'

Call OperatorValidator.compare()

It will return a boolean telling you if the values you are comparing match the operator you defined. True means it matches and false means it doesn't.

Package Sidebar

Install

npm i ic-operator-validation

Weekly Downloads

4

Version

2.0.0

License

MIT

Unpacked Size

100 kB

Total Files

67

Last publish

Collaborators

  • rafael.medeiros.iclubs
  • arthur_machado
  • danielgroh
  • rafael.moura1
  • rodrigovb
  • nicolasanaia