joi 8.3.0 → 9.0.0-0
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/.eslintignore +2 -0
- package/.github/CONTRIBUTING.md +14 -0
- package/.github/ISSUE_TEMPLATE.md +19 -0
- package/.npmignore +21 -0
- package/.travis.yml +8 -0
- package/API.md +1690 -0
- package/README.md +1 -1
- package/examples/conditionalRequire.js +52 -0
- package/examples/customMessage.js +31 -0
- package/examples/multipleWhen.js +26 -0
- package/examples/timestamps.js +22 -0
- package/generate-readme-toc.js +49 -0
- package/images/joi.png +0 -0
- package/images/validation.png +0 -0
- package/lib/any.js +65 -45
- package/lib/array.js +2 -6
- package/lib/boolean.js +9 -2
- package/lib/errors.js +2 -13
- package/lib/index.js +142 -3
- package/lib/language.js +2 -5
- package/lib/object.js +15 -6
- package/lib/string.js +0 -17
- package/package.json +6 -7
- package/test/alternatives.js +490 -0
- package/test/any.js +1751 -0
- package/test/array.js +1049 -0
- package/test/binary.js +190 -0
- package/test/boolean.js +163 -0
- package/test/date.js +441 -0
- package/test/errors.js +512 -0
- package/test/function.js +224 -0
- package/test/helper.js +65 -0
- package/test/index.js +2450 -0
- package/test/number.js +836 -0
- package/test/object.js +1318 -0
- package/test/ref.js +470 -0
- package/test/string.js +3206 -0
- package/lib/lazy.js +0 -51
package/.eslintignore
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# How to contribute
|
|
2
|
+
We welcome contributions from the community and are pleased to have them. Please follow this guide when logging issues or making code changes.
|
|
3
|
+
|
|
4
|
+
## Logging Issues
|
|
5
|
+
All issues should be created using the [new issue form](https://github.com/hapijs/joi/issues/new). Clearly describe the issue including steps to reproduce if there are any. Also, make sure to indicate the earliest version that has the issue being reported.
|
|
6
|
+
|
|
7
|
+
## Patching Code
|
|
8
|
+
Code changes are welcome and should follow the guidelines below.
|
|
9
|
+
|
|
10
|
+
* Fork the repository on GitHub.
|
|
11
|
+
* Fix the issue ensuring that your code follows the [style guide](https://github.com/hapijs/contrib/blob/master/Style.md).
|
|
12
|
+
* Add tests for your new code ensuring that you have 100% code coverage (we can help you reach 100% but will not merge without it).
|
|
13
|
+
* Run `npm test` to generate a report of test coverage
|
|
14
|
+
* [Pull requests](http://help.github.com/send-pull-requests/) should be made to the [master branch](https://github.com/hapijs/joi/tree/master).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#### Context
|
|
2
|
+
|
|
3
|
+
* *node version*:
|
|
4
|
+
* *joi version*:
|
|
5
|
+
* *environment* (node, browser):
|
|
6
|
+
* *used with* (hapi, standalone, ...):
|
|
7
|
+
* *any other relevant information*:
|
|
8
|
+
|
|
9
|
+
#### What are you trying to achieve or the steps to reproduce ?
|
|
10
|
+
|
|
11
|
+
Describe your issue here, include schemas and inputs you are validating if needed.
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
const schema = Joi.any()
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
#### Which result you had ?
|
|
18
|
+
|
|
19
|
+
#### What did you expect ?
|
package/.npmignore
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.c9
|
|
2
|
+
.idea
|
|
3
|
+
.project
|
|
4
|
+
*.iml
|
|
5
|
+
npm-debug.log
|
|
6
|
+
dump.rdb
|
|
7
|
+
node_modules
|
|
8
|
+
results.tap
|
|
9
|
+
results.xml
|
|
10
|
+
npm-shrinkwrap.json
|
|
11
|
+
config.json
|
|
12
|
+
.DS_Store
|
|
13
|
+
*/.DS_Store
|
|
14
|
+
*/*/.DS_Store
|
|
15
|
+
._*
|
|
16
|
+
*/._*
|
|
17
|
+
*/*/._*
|
|
18
|
+
coverage.*
|
|
19
|
+
lib-cov
|
|
20
|
+
complexity.md
|
|
21
|
+
sandbox.js
|