@jdlien/validator 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Validator includes the following built-in validation types:
|
|
|
28
28
|
|
|
29
29
|
You can also add custom validation, and can customize error messages per field or for the whole form.
|
|
30
30
|
|
|
31
|
-
Validator has no dependencies
|
|
31
|
+
Validator is compatible with all modern browsers. It has no dependencies (other than its validator-utils package). It is written in TypeScript with 100% test coverage.
|
|
32
32
|
|
|
33
33
|
## Installation
|
|
34
34
|
|
|
@@ -89,7 +89,7 @@ You can also pass in a custom default error message for a field using `data-erro
|
|
|
89
89
|
|
|
90
90
|
## Demo
|
|
91
91
|
|
|
92
|
-
[Working demo](https://jdlien.com/validator/demo
|
|
92
|
+
[Working demo on jdlien.com](https://jdlien.com/validator/demo/).
|
|
93
93
|
|
|
94
94
|
## Supported Input Types and Atributes
|
|
95
95
|
|
|
@@ -243,13 +243,15 @@ const myValidator = new Validator(myForm, {
|
|
|
243
243
|
|
|
244
244
|
## Utility Functions
|
|
245
245
|
|
|
246
|
-
Validator
|
|
246
|
+
Validator uses its own `@jdlien/validator-utils` for several utility functions that may be useful in your own code. You may use this package directly if you need any of these functions without using the Validator class.
|
|
247
|
+
|
|
247
248
|
If you wish to use these, you may import the functions directly from the module as an object that contains all the functions:
|
|
248
249
|
|
|
249
250
|
```javascript
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
// Import all the functions into a validatorUtils object
|
|
252
|
+
import * as validatorUtils from '@jdlien/validator-utils'
|
|
253
|
+
// Or just import the functions you need
|
|
254
|
+
import { dateFormat, formatDateTime } from '@jdlien/validator-utils'
|
|
253
255
|
```
|
|
254
256
|
|
|
255
257
|
Here is a list of the utility functions:
|