json-2-joi 2.4.0 → 2.5.1

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.
Files changed (5) hide show
  1. package/LICENSE.txt +203 -203
  2. package/README.md +361 -359
  3. package/index.js +14 -14
  4. package/lib/resolver.js +676 -669
  5. package/package.json +54 -54
package/index.js CHANGED
@@ -1,14 +1,14 @@
1
- const SchemaResolver = require('./lib/resolver');
2
-
3
- function resolver(options = {}, joiInstance) {
4
- return new SchemaResolver(options, joiInstance);
5
- }
6
-
7
- function schema(schema, options = { }, joiInstance) {
8
- const joiResolver = resolver(options, joiInstance);
9
- const joiSchema = joiResolver.convert(schema);
10
- return joiSchema;
11
- }
12
-
13
- exports.resolver = resolver;
14
- exports.schema = schema;
1
+ const SchemaResolver = require('./lib/resolver');
2
+
3
+ function resolver(options = {}, joiInstance) {
4
+ return new SchemaResolver(options, joiInstance);
5
+ }
6
+
7
+ function schema(schema, options = { }, joiInstance) {
8
+ const joiResolver = resolver(options, joiInstance);
9
+ const joiSchema = joiResolver.convert(schema);
10
+ return joiSchema;
11
+ }
12
+
13
+ exports.resolver = resolver;
14
+ exports.schema = schema;