Skip to content

Commit

Permalink
v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed Oct 21, 2020
1 parent affb13e commit ca8c9e5
Show file tree
Hide file tree
Showing 9 changed files with 232 additions and 25 deletions.
16 changes: 15 additions & 1 deletion dist/joiprops.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,19 @@ declare function JoiProps(schema: object): {
declare namespace JoiProps {
var Joi: Joi.Root;
var Nua: typeof import("nua");
var JT: Joi.BooleanSchema;
var JF: Joi.BooleanSchema;
var JB: (b: boolean) => Joi.BooleanSchema;
var JS: (s: string) => Joi.StringSchema;
var JN: (n: number) => Joi.NumberSchema;
var JO: (o: any) => Joi.ObjectSchema<any>;
var JA: (a: any) => Joi.ArraySchema;
}
export { JoiProps, Joi, Nua };
declare const JT: Joi.BooleanSchema;
declare const JF: Joi.BooleanSchema;
declare const JB: (b: boolean) => Joi.BooleanSchema;
declare const JS: (s: string) => Joi.StringSchema;
declare const JN: (n: number) => Joi.NumberSchema;
declare const JO: (o: any) => Joi.ObjectSchema<any>;
declare const JA: (a: any) => Joi.ArraySchema;
export { JoiProps, Joi, Nua, JT, JF, JB, JS, JN, JO, JA };
16 changes: 15 additions & 1 deletion dist/joiprops.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/joiprops.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/joiprops.min.js

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion joiprops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,17 @@ function resolve_component_name(options: any) {

JoiProps.Joi = Joi
JoiProps.Nua = Nua
const JT = (JoiProps.JT = Joi.boolean().default(true))
const JF = (JoiProps.JF = Joi.boolean().default(false))
const JB = (JoiProps.JB = (b: boolean) =>
null == b ? Joi.boolean() : Joi.boolean().default(b))
const JS = (JoiProps.JS = (s: string) =>
null == s ? Joi.string() : Joi.string().default(s))
const JN = (JoiProps.JN = (n: number) =>
null == n ? Joi.number() : Joi.number().default(n))
const JO = (JoiProps.JO = (o: any) =>
null == o ? Joi.object() : Joi.object(o).default())
const JA = (JoiProps.JA = (a: any) =>
null == a ? Joi.array() : Joi.array().items(a).default([]))

export { JoiProps, Joi, Nua }
export { JoiProps, Joi, Nua, JT, JF, JB, JS, JN, JO, JA }
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "joiprops",
"version": "0.1.0",
"version": "0.2.0",
"description": "Use Joi Schemas for your Vue component prop validation (and deep structure defaults).",
"main": "dist/joiprops.js",
"browser": "dist/joiprops.min.js",
Expand Down
42 changes: 40 additions & 2 deletions test-web/test-web.js

Large diffs are not rendered by default.

Loading

0 comments on commit ca8c9e5

Please sign in to comment.