@xube/kit-schema 0.0.91 → 0.0.93
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.
|
@@ -38,25 +38,18 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
38
38
|
}
|
|
39
39
|
for (const key0 in data) {
|
|
40
40
|
if (!((((key0 === "s") || (key0 === "us")) || (key0 === "type")) || (key0 === "id"))) {
|
|
41
|
-
|
|
42
|
-
if (vErrors === null) {
|
|
43
|
-
vErrors = [err3];
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
vErrors.push(err3);
|
|
47
|
-
}
|
|
48
|
-
errors++;
|
|
41
|
+
delete data[key0];
|
|
49
42
|
}
|
|
50
43
|
}
|
|
51
44
|
if (data.s !== undefined) {
|
|
52
45
|
let data0 = data.s;
|
|
53
46
|
if (!((typeof data0 == "number") && (isFinite(data0)))) {
|
|
54
|
-
const
|
|
47
|
+
const err3 = { instancePath: instancePath + "/s", schemaPath: "#/definitions/basedataJsonSchema/properties/s/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
55
48
|
if (vErrors === null) {
|
|
56
|
-
vErrors = [
|
|
49
|
+
vErrors = [err3];
|
|
57
50
|
}
|
|
58
51
|
else {
|
|
59
|
-
vErrors.push(
|
|
52
|
+
vErrors.push(err3);
|
|
60
53
|
}
|
|
61
54
|
errors++;
|
|
62
55
|
}
|
|
@@ -64,48 +57,48 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
64
57
|
if (data.us !== undefined) {
|
|
65
58
|
let data1 = data.us;
|
|
66
59
|
if (!((typeof data1 == "number") && (isFinite(data1)))) {
|
|
67
|
-
const
|
|
60
|
+
const err4 = { instancePath: instancePath + "/us", schemaPath: "#/definitions/basedataJsonSchema/properties/us/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
68
61
|
if (vErrors === null) {
|
|
69
|
-
vErrors = [
|
|
62
|
+
vErrors = [err4];
|
|
70
63
|
}
|
|
71
64
|
else {
|
|
72
|
-
vErrors.push(
|
|
65
|
+
vErrors.push(err4);
|
|
73
66
|
}
|
|
74
67
|
errors++;
|
|
75
68
|
}
|
|
76
69
|
}
|
|
77
70
|
if (data.type !== undefined) {
|
|
78
71
|
if (typeof data.type !== "string") {
|
|
79
|
-
const
|
|
72
|
+
const err5 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/basedataJsonSchema/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
80
73
|
if (vErrors === null) {
|
|
81
|
-
vErrors = [
|
|
74
|
+
vErrors = [err5];
|
|
82
75
|
}
|
|
83
76
|
else {
|
|
84
|
-
vErrors.push(
|
|
77
|
+
vErrors.push(err5);
|
|
85
78
|
}
|
|
86
79
|
errors++;
|
|
87
80
|
}
|
|
88
81
|
}
|
|
89
82
|
if (data.id !== undefined) {
|
|
90
83
|
if (typeof data.id !== "string") {
|
|
91
|
-
const
|
|
84
|
+
const err6 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/basedataJsonSchema/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
92
85
|
if (vErrors === null) {
|
|
93
|
-
vErrors = [
|
|
86
|
+
vErrors = [err6];
|
|
94
87
|
}
|
|
95
88
|
else {
|
|
96
|
-
vErrors.push(
|
|
89
|
+
vErrors.push(err6);
|
|
97
90
|
}
|
|
98
91
|
errors++;
|
|
99
92
|
}
|
|
100
93
|
}
|
|
101
94
|
}
|
|
102
95
|
else {
|
|
103
|
-
const
|
|
96
|
+
const err7 = { instancePath, schemaPath: "#/definitions/basedataJsonSchema/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
104
97
|
if (vErrors === null) {
|
|
105
|
-
vErrors = [
|
|
98
|
+
vErrors = [err7];
|
|
106
99
|
}
|
|
107
100
|
else {
|
|
108
|
-
vErrors.push(
|
|
101
|
+
vErrors.push(err7);
|
|
109
102
|
}
|
|
110
103
|
errors++;
|
|
111
104
|
} validate10.errors = vErrors; return errors === 0; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xube/kit-schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.93",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"homepage": "https://github.com/XubeLtd/data-logger#readme",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@anatine/zod-openapi": "^2.2.0",
|
|
22
|
-
"@xube/kit-constants": "^0.0.
|
|
23
|
-
"@xube/kit-generator": "^0.0.
|
|
24
|
-
"@xube/kit-log": "^0.0.
|
|
25
|
-
"zod": "^3.
|
|
22
|
+
"@xube/kit-constants": "^0.0.93",
|
|
23
|
+
"@xube/kit-generator": "^0.0.93",
|
|
24
|
+
"@xube/kit-log": "^0.0.93",
|
|
25
|
+
"zod": "^3.23.8"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@xube/kit-build": "^0.0.
|
|
28
|
+
"@xube/kit-build": "^0.0.93"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export const validate = validate10;export default validate10;const schema27 = {"$ref":"#/definitions/basedataJsonSchema","definitions":{"basedataJsonSchema":{"type":"object","properties":{"s":{"type":"number"},"us":{"type":"number"},"type":{"type":"string"},"id":{"type":"string"}},"required":["s","type","id"],"additionalProperties":false}},"$schema":"http://json-schema.org/draft-07/schema#"};const schema28 = {"type":"object","properties":{"s":{"type":"number"},"us":{"type":"number"},"type":{"type":"string"},"id":{"type":"string"}},"required":["s","type","id"],"additionalProperties":false};function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.s === undefined){const err0 = {instancePath,schemaPath:"#/definitions/basedataJsonSchema/required",keyword:"required",params:{missingProperty: "s"},message:"must have required property '"+"s"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.type === undefined){const err1 = {instancePath,schemaPath:"#/definitions/basedataJsonSchema/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.id === undefined){const err2 = {instancePath,schemaPath:"#/definitions/basedataJsonSchema/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!((((key0 === "s") || (key0 === "us")) || (key0 === "type")) || (key0 === "id"))){
|
|
1
|
+
"use strict";export const validate = validate10;export default validate10;const schema27 = {"$ref":"#/definitions/basedataJsonSchema","definitions":{"basedataJsonSchema":{"type":"object","properties":{"s":{"type":"number"},"us":{"type":"number"},"type":{"type":"string"},"id":{"type":"string"}},"required":["s","type","id"],"additionalProperties":false}},"$schema":"http://json-schema.org/draft-07/schema#"};const schema28 = {"type":"object","properties":{"s":{"type":"number"},"us":{"type":"number"},"type":{"type":"string"},"id":{"type":"string"}},"required":["s","type","id"],"additionalProperties":false};function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.s === undefined){const err0 = {instancePath,schemaPath:"#/definitions/basedataJsonSchema/required",keyword:"required",params:{missingProperty: "s"},message:"must have required property '"+"s"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.type === undefined){const err1 = {instancePath,schemaPath:"#/definitions/basedataJsonSchema/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.id === undefined){const err2 = {instancePath,schemaPath:"#/definitions/basedataJsonSchema/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!((((key0 === "s") || (key0 === "us")) || (key0 === "type")) || (key0 === "id"))){delete data[key0];}}if(data.s !== undefined){let data0 = data.s;if(!((typeof data0 == "number") && (isFinite(data0)))){const err3 = {instancePath:instancePath+"/s",schemaPath:"#/definitions/basedataJsonSchema/properties/s/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.us !== undefined){let data1 = data.us;if(!((typeof data1 == "number") && (isFinite(data1)))){const err4 = {instancePath:instancePath+"/us",schemaPath:"#/definitions/basedataJsonSchema/properties/us/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.type !== undefined){if(typeof data.type !== "string"){const err5 = {instancePath:instancePath+"/type",schemaPath:"#/definitions/basedataJsonSchema/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.id !== undefined){if(typeof data.id !== "string"){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/definitions/basedataJsonSchema/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:"#/definitions/basedataJsonSchema/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate10.errors = vErrors;return errors === 0;}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export function validate(data: any, { instancePath, parentData, parentDataProperty, rootData }?: {
|
|
2
|
-
instancePath?: string | undefined;
|
|
3
|
-
rootData?: any;
|
|
4
|
-
}): boolean;
|
|
5
|
-
export default validate10;
|
|
6
|
-
declare function validate10(data: any, { instancePath, parentData, parentDataProperty, rootData }?: {
|
|
7
|
-
instancePath?: string | undefined;
|
|
8
|
-
rootData?: any;
|
|
9
|
-
}): boolean;
|