@azteam/express 1.2.242 → 1.2.244

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/validate.js +9 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/express",
3
- "version": "1.2.242",
3
+ "version": "1.2.244",
4
4
  "main": "src/index.js",
5
5
  "engines": {
6
6
  "node": ">= 12.0.0",
package/src/validate.js CHANGED
@@ -99,8 +99,9 @@ export const schemaVersion = (optional = false) => ({
99
99
  max: 300,
100
100
  optional,
101
101
  });
102
- export const schemaArray = (optional = false) => ({
102
+ export const schemaArray = (items, optional = false) => ({
103
103
  type: 'array',
104
+ items,
104
105
  optional,
105
106
  });
106
107
  export const schemaJSON = (optional = false) => ({
@@ -121,8 +122,13 @@ export const schemaObject = (props = {}, optional = false) => ({
121
122
  optional,
122
123
  });
123
124
 
124
- /* rules */
125
+ export const schemaEnum = (values, optional = false) => ({
126
+ type: 'enum',
127
+ values,
128
+ optional,
129
+ });
125
130
 
131
+ /* rules */
126
132
  export const rulesId = {
127
133
  id: schemaId(),
128
134
  };
@@ -130,10 +136,7 @@ export const rulesSlug = {
130
136
  slug: schemaSlug(),
131
137
  };
132
138
  export const rulesPlatformType = {
133
- type: {
134
- type: 'enum',
135
- values: ['web', 'app'],
136
- },
139
+ type: schemaEnum(['web', 'app']),
137
140
  };
138
141
  export const rulesMetadata = {
139
142
  metadata_disable: schemaBoolean(true),