How to use the reach function from joi
Find comprehensive JavaScript joi.reach code examples handpicked from public code repositorys.
GitHub: muraljs/joiql
69 70 71 72 73 74 75 76 77 78
}) } else { type = new GraphQLObjectType({ name: typeName, description: desc.description, fields: () => descsToFields(mapValues(desc.children, (child, k) => Joi.reach(schema, k))) }) } cachedTypes[typeName] = type return type
9
69
0
GitHub: flyingluscas/joi
139 140 141 142 143 144 145 146 147 148
Get a sub-schema of an existing schema based on a `path` that can be either a string or an array of strings For string values path separator is a dot (`.`). ```js const schema = Joi.object({ foo: Joi.object({ bar: Joi.number() }) }); const number = Joi.reach(schema, 'foo.bar'); //or const result = Joi.reach(schema, ['foo', 'bar']); //same as number ```
0
0
0
+ 3 other calls in file
joi.string is the most popular function in joi (40578 examples)