yuppi 1.3.17 → 1.3.18
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 +3 -3
- package/dist/main.d.mts +2 -2
- package/dist/main.d.ts +2 -2
- package/dist/main.js +1 -1
- package/dist/main.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -159,7 +159,7 @@ Validate the properties with your Yuppi schema.
|
|
|
159
159
|
> | schema | [Schema] | | Yuppi schema. |
|
|
160
160
|
> | properties | [AnyObject] | | Properties to be validate. |
|
|
161
161
|
>
|
|
162
|
-
> returns [AnyObject]
|
|
162
|
+
> returns [Promise]<[AnyObject]>
|
|
163
163
|
>
|
|
164
164
|
> Example:
|
|
165
165
|
>
|
|
@@ -197,7 +197,7 @@ Validate the properties with your Yuppi schema.
|
|
|
197
197
|
> };
|
|
198
198
|
>
|
|
199
199
|
> try {
|
|
200
|
-
> Yupp.validate(schema, properties);
|
|
200
|
+
> await Yupp.validate(schema, properties);
|
|
201
201
|
> /*
|
|
202
202
|
> {
|
|
203
203
|
> display_name: "Fırat",
|
|
@@ -232,7 +232,7 @@ Declare your Yuppi schema for TypeScript.
|
|
|
232
232
|
>
|
|
233
233
|
> Yupp.declare(schema, 'User');
|
|
234
234
|
>
|
|
235
|
-
> const user = Yupp.validate(schema, properties) as User;
|
|
235
|
+
> const user = (await Yupp.validate(schema, properties)) as User;
|
|
236
236
|
> /*
|
|
237
237
|
> interface User {
|
|
238
238
|
> display_name: string;
|
package/dist/main.d.mts
CHANGED
|
@@ -111,10 +111,10 @@ type YuppiOptions = {
|
|
|
111
111
|
declare class Yuppi {
|
|
112
112
|
private readonly options;
|
|
113
113
|
constructor(options?: YuppiOptions);
|
|
114
|
-
validate(schema: Schema, properties: AnyObject): {
|
|
114
|
+
validate(schema: Schema, properties: AnyObject): Promise<{
|
|
115
115
|
[x: string]: any;
|
|
116
116
|
[x: number]: any;
|
|
117
|
-
}
|
|
117
|
+
}>;
|
|
118
118
|
declare(schema: Schema, name: string): void;
|
|
119
119
|
convertToYup(schema: Schema): yup.ObjectSchema<{
|
|
120
120
|
[x: string]: any;
|
package/dist/main.d.ts
CHANGED
|
@@ -111,10 +111,10 @@ type YuppiOptions = {
|
|
|
111
111
|
declare class Yuppi {
|
|
112
112
|
private readonly options;
|
|
113
113
|
constructor(options?: YuppiOptions);
|
|
114
|
-
validate(schema: Schema, properties: AnyObject): {
|
|
114
|
+
validate(schema: Schema, properties: AnyObject): Promise<{
|
|
115
115
|
[x: string]: any;
|
|
116
116
|
[x: number]: any;
|
|
117
|
-
}
|
|
117
|
+
}>;
|
|
118
118
|
declare(schema: Schema, name: string): void;
|
|
119
119
|
convertToYup(schema: Schema): yup.ObjectSchema<{
|
|
120
120
|
[x: string]: any;
|
package/dist/main.js
CHANGED
|
@@ -242,7 +242,7 @@ var Yuppi = class {
|
|
|
242
242
|
}
|
|
243
243
|
validate(schema, properties) {
|
|
244
244
|
const yup_schema = this.convertToYup(schema);
|
|
245
|
-
return yup_schema.
|
|
245
|
+
return yup_schema.validate(properties, this.options.validate_options);
|
|
246
246
|
}
|
|
247
247
|
declare(schema, name) {
|
|
248
248
|
name = pascalCase(name);
|
package/dist/main.mjs
CHANGED
|
@@ -211,7 +211,7 @@ var Yuppi = class {
|
|
|
211
211
|
}
|
|
212
212
|
validate(schema, properties) {
|
|
213
213
|
const yup_schema = this.convertToYup(schema);
|
|
214
|
-
return yup_schema.
|
|
214
|
+
return yup_schema.validate(properties, this.options.validate_options);
|
|
215
215
|
}
|
|
216
216
|
declare(schema, name) {
|
|
217
217
|
name = pascalCase(name);
|