electrodb 2.10.0 → 2.10.2
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/.prettierignore +112 -0
- package/.prettierrc +11 -0
- package/README.md +55 -47
- package/index.d.ts +5288 -2409
- package/index.js +24 -12
- package/package.json +19 -11
- package/src/clauses.js +1557 -1310
- package/src/client.js +255 -235
- package/src/entity.js +4512 -3737
- package/src/errors.js +39 -28
- package/src/events.js +26 -16
- package/src/filterOperations.js +120 -122
- package/src/filters.js +99 -101
- package/src/operations.js +326 -263
- package/src/schema.js +1825 -1473
- package/src/service.js +1081 -852
- package/src/set.js +22 -26
- package/src/transaction.js +179 -153
- package/src/types.js +260 -264
- package/src/update.js +94 -90
- package/src/updateOperations.js +179 -160
- package/src/util.js +45 -32
- package/src/validations.js +337 -325
- package/src/where.js +146 -124
- package/tsconfig.json +12 -11
package/src/validations.js
CHANGED
|
@@ -1,267 +1,267 @@
|
|
|
1
1
|
const e = require("./errors");
|
|
2
|
-
const {KeyCasing} = require("./types")
|
|
2
|
+
const { KeyCasing } = require("./types");
|
|
3
3
|
|
|
4
4
|
const Validator = require("jsonschema").Validator;
|
|
5
5
|
Validator.prototype.customFormats.isFunction = function (input) {
|
|
6
|
-
|
|
6
|
+
return typeof input === "function";
|
|
7
7
|
};
|
|
8
8
|
Validator.prototype.customFormats.isFunctionOrString = function (input) {
|
|
9
|
-
|
|
9
|
+
return typeof input === "function" || typeof input === "string";
|
|
10
10
|
};
|
|
11
11
|
Validator.prototype.customFormats.isFunctionOrRegexp = function (input) {
|
|
12
|
-
|
|
12
|
+
return typeof input === "function" || input instanceof RegExp;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
let v = new Validator();
|
|
16
16
|
|
|
17
17
|
const Attribute = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
18
|
+
id: "/Attribute",
|
|
19
|
+
type: ["object", "string", "array"],
|
|
20
|
+
required: ["type"],
|
|
21
|
+
properties: {
|
|
22
|
+
type: {
|
|
23
|
+
// todo: only specific values
|
|
24
|
+
type: ["string", "array"],
|
|
25
|
+
// enum: ["string", "number", "boolean", "enum"],
|
|
26
|
+
},
|
|
27
|
+
field: {
|
|
28
|
+
type: "string",
|
|
29
|
+
},
|
|
30
|
+
hidden: {
|
|
31
|
+
type: "boolean",
|
|
32
|
+
},
|
|
33
|
+
watch: {
|
|
34
|
+
type: ["array", "string"],
|
|
35
|
+
items: {
|
|
36
|
+
type: "string",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
label: {
|
|
40
|
+
type: "string",
|
|
41
|
+
},
|
|
42
|
+
readOnly: {
|
|
43
|
+
type: "boolean",
|
|
44
|
+
},
|
|
45
|
+
required: {
|
|
46
|
+
type: "boolean",
|
|
47
|
+
},
|
|
48
|
+
cast: {
|
|
49
|
+
type: "string",
|
|
50
|
+
enum: ["string", "number"],
|
|
51
|
+
},
|
|
52
|
+
default: {
|
|
53
|
+
type: "any",
|
|
54
|
+
},
|
|
55
|
+
validate: {
|
|
56
|
+
type: "any",
|
|
57
|
+
format: "isFunctionOrRegexp",
|
|
58
|
+
},
|
|
59
|
+
get: {
|
|
60
|
+
type: "any",
|
|
61
|
+
format: "isFunction",
|
|
62
|
+
},
|
|
63
|
+
set: {
|
|
64
|
+
type: "any",
|
|
65
|
+
format: "isFunction",
|
|
66
|
+
},
|
|
67
|
+
padding: {
|
|
68
|
+
type: "object",
|
|
69
|
+
required: ["length", "char"],
|
|
70
|
+
properties: {
|
|
71
|
+
length: {
|
|
72
|
+
type: "number",
|
|
73
|
+
},
|
|
74
|
+
char: {
|
|
75
|
+
type: "string",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
const Index = {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
83
|
+
id: "/Index",
|
|
84
|
+
type: "object",
|
|
85
|
+
properties: {
|
|
86
|
+
pk: {
|
|
87
|
+
type: "object",
|
|
88
|
+
required: true,
|
|
89
|
+
properties: {
|
|
90
|
+
field: {
|
|
91
|
+
type: "string",
|
|
92
|
+
required: true,
|
|
93
|
+
},
|
|
94
|
+
facets: {
|
|
95
|
+
type: ["array", "string"],
|
|
96
|
+
items: {
|
|
97
|
+
type: "string",
|
|
98
|
+
},
|
|
99
|
+
required: false,
|
|
100
|
+
},
|
|
101
|
+
composite: {
|
|
102
|
+
type: ["array"],
|
|
103
|
+
items: {
|
|
104
|
+
type: "string",
|
|
105
|
+
},
|
|
106
|
+
required: false,
|
|
107
|
+
},
|
|
108
|
+
template: {
|
|
109
|
+
type: "string",
|
|
110
|
+
required: false,
|
|
111
|
+
},
|
|
112
|
+
casing: {
|
|
113
|
+
type: "string",
|
|
114
|
+
enum: ["upper", "lower", "none", "default"],
|
|
115
|
+
required: false,
|
|
116
|
+
},
|
|
117
|
+
cast: {
|
|
118
|
+
type: "string",
|
|
119
|
+
enum: ["string", "number"],
|
|
120
|
+
required: false,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
sk: {
|
|
125
|
+
type: "object",
|
|
126
|
+
required: ["field"],
|
|
127
|
+
properties: {
|
|
128
|
+
field: {
|
|
129
|
+
type: "string",
|
|
130
|
+
required: true,
|
|
131
|
+
},
|
|
132
|
+
facets: {
|
|
133
|
+
type: ["array", "string"],
|
|
134
|
+
required: false,
|
|
135
|
+
items: {
|
|
136
|
+
type: "string",
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
composite: {
|
|
140
|
+
type: ["array"],
|
|
141
|
+
required: false,
|
|
142
|
+
items: {
|
|
143
|
+
type: "string",
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
template: {
|
|
147
|
+
type: "string",
|
|
148
|
+
required: false,
|
|
149
|
+
},
|
|
150
|
+
casing: {
|
|
151
|
+
type: "string",
|
|
152
|
+
enum: ["upper", "lower", "none", "default"],
|
|
153
|
+
required: false,
|
|
154
|
+
},
|
|
155
|
+
cast: {
|
|
156
|
+
type: "string",
|
|
157
|
+
enum: ["string", "number"],
|
|
158
|
+
required: false,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
index: {
|
|
163
|
+
type: "string",
|
|
164
|
+
},
|
|
165
|
+
collection: {
|
|
166
|
+
type: ["array", "string"],
|
|
167
|
+
},
|
|
168
|
+
type: {
|
|
169
|
+
type: "string",
|
|
170
|
+
enum: ["clustered", "isolated"],
|
|
171
|
+
required: false,
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
174
|
};
|
|
175
175
|
|
|
176
|
-
const Modelv1= {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
176
|
+
const Modelv1 = {
|
|
177
|
+
type: "object",
|
|
178
|
+
required: true,
|
|
179
|
+
properties: {
|
|
180
|
+
model: {
|
|
181
|
+
type: "object",
|
|
182
|
+
required: true,
|
|
183
|
+
properties: {
|
|
184
|
+
entity: {
|
|
185
|
+
type: "string",
|
|
186
|
+
required: true,
|
|
187
|
+
},
|
|
188
|
+
version: {
|
|
189
|
+
type: "string",
|
|
190
|
+
required: true,
|
|
191
|
+
},
|
|
192
|
+
service: {
|
|
193
|
+
type: "string",
|
|
194
|
+
required: true,
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
table: {
|
|
199
|
+
type: "string",
|
|
200
|
+
},
|
|
201
|
+
attributes: {
|
|
202
|
+
type: "object",
|
|
203
|
+
patternProperties: {
|
|
204
|
+
["."]: { $ref: "/Attribute" },
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
indexes: {
|
|
208
|
+
type: "object",
|
|
209
|
+
minProperties: 1,
|
|
210
|
+
patternProperties: {
|
|
211
|
+
["."]: { $ref: "/Index" },
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
filters: { $ref: "/Filters" },
|
|
215
|
+
},
|
|
216
|
+
required: ["model", "attributes", "indexes"],
|
|
217
217
|
};
|
|
218
218
|
|
|
219
219
|
const ModelBeta = {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
220
|
+
type: "object",
|
|
221
|
+
required: true,
|
|
222
|
+
properties: {
|
|
223
|
+
service: {
|
|
224
|
+
type: "string",
|
|
225
|
+
required: true,
|
|
226
|
+
},
|
|
227
|
+
entity: {
|
|
228
|
+
type: "string",
|
|
229
|
+
required: true,
|
|
230
|
+
},
|
|
231
|
+
table: {
|
|
232
|
+
type: "string",
|
|
233
|
+
},
|
|
234
|
+
version: {
|
|
235
|
+
type: "string",
|
|
236
|
+
},
|
|
237
|
+
attributes: {
|
|
238
|
+
type: "object",
|
|
239
|
+
patternProperties: {
|
|
240
|
+
["."]: { $ref: "/Attribute" },
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
indexes: {
|
|
244
|
+
type: "object",
|
|
245
|
+
minProperties: 1,
|
|
246
|
+
patternProperties: {
|
|
247
|
+
["."]: { $ref: "/Index" },
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
filters: { $ref: "/Filters" },
|
|
251
|
+
},
|
|
252
|
+
required: ["attributes", "indexes"],
|
|
253
253
|
};
|
|
254
254
|
|
|
255
255
|
const Filters = {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
256
|
+
id: "/Filters",
|
|
257
|
+
type: "object",
|
|
258
|
+
patternProperties: {
|
|
259
|
+
["."]: {
|
|
260
|
+
type: "any",
|
|
261
|
+
format: "isFunction",
|
|
262
|
+
message: "Requires function",
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
265
|
};
|
|
266
266
|
|
|
267
267
|
v.addSchema(Attribute, "/Attribute");
|
|
@@ -271,122 +271,134 @@ v.addSchema(ModelBeta, "/ModelBeta");
|
|
|
271
271
|
v.addSchema(Modelv1, "/Modelv1");
|
|
272
272
|
|
|
273
273
|
function validateModel(model = {}) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
274
|
+
/** start beta/v1 condition **/
|
|
275
|
+
let betaErrors = v.validate(model, "/ModelBeta").errors;
|
|
276
|
+
if (betaErrors.length) {
|
|
277
|
+
/** end/v1 condition **/
|
|
278
|
+
let errors = v.validate(model, "/Modelv1").errors;
|
|
279
|
+
if (errors.length) {
|
|
280
|
+
throw new e.ElectroError(
|
|
281
|
+
e.ErrorCodes.InvalidModel,
|
|
282
|
+
errors
|
|
283
|
+
.map((err) => {
|
|
284
|
+
let message = `${err.property}`;
|
|
285
|
+
switch (err.argument) {
|
|
286
|
+
case "isFunction":
|
|
287
|
+
return `${message} must be a function`;
|
|
288
|
+
case "isFunctionOrString":
|
|
289
|
+
return `${message} must be either a function or string`;
|
|
290
|
+
case "isFunctionOrRegexp":
|
|
291
|
+
return `${message} must be either a function or Regexp`;
|
|
292
|
+
default:
|
|
293
|
+
return `${message} ${err.message}`;
|
|
294
|
+
}
|
|
295
|
+
})
|
|
296
|
+
.join(", "),
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
299
300
|
}
|
|
300
301
|
|
|
301
302
|
function testModel(model) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
303
|
+
let isModel = false;
|
|
304
|
+
let error = "";
|
|
305
|
+
try {
|
|
306
|
+
validateModel(model);
|
|
307
|
+
isModel = true;
|
|
308
|
+
} catch (err) {
|
|
309
|
+
error = err.message;
|
|
310
|
+
}
|
|
311
|
+
return [isModel, error];
|
|
311
312
|
}
|
|
312
313
|
|
|
313
314
|
function isStringHasLength(str) {
|
|
314
|
-
|
|
315
|
+
return typeof str === "string" && str.length > 0;
|
|
315
316
|
}
|
|
316
317
|
|
|
317
318
|
function isObjectHasLength(obj) {
|
|
318
|
-
|
|
319
|
+
return typeof obj === "object" && Object.keys(obj).length > 0;
|
|
319
320
|
}
|
|
320
321
|
|
|
321
322
|
function isArrayHasLength(arr) {
|
|
322
|
-
|
|
323
|
+
return Array.isArray(arr) && arr.length > 0;
|
|
323
324
|
}
|
|
324
325
|
|
|
325
326
|
function isNameEntityRecordType(entityRecord) {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
327
|
+
return (
|
|
328
|
+
isObjectHasLength(entityRecord) &&
|
|
329
|
+
Object.values(entityRecord).find((value) => {
|
|
330
|
+
return value._instance !== undefined;
|
|
331
|
+
})
|
|
332
|
+
);
|
|
329
333
|
}
|
|
330
334
|
|
|
331
335
|
function isNameModelRecordType(modelRecord) {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
336
|
+
return (
|
|
337
|
+
isObjectHasLength(modelRecord) &&
|
|
338
|
+
Object.values(modelRecord).find((value) => {
|
|
339
|
+
return (
|
|
340
|
+
value.model &&
|
|
341
|
+
isStringHasLength(value.model.entity) &&
|
|
342
|
+
isStringHasLength(value.model.version) &&
|
|
343
|
+
isStringHasLength(value.model.service)
|
|
344
|
+
);
|
|
345
|
+
})
|
|
346
|
+
);
|
|
338
347
|
}
|
|
339
348
|
|
|
340
349
|
function isBetaServiceConfig(serviceConfig) {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
350
|
+
return (
|
|
351
|
+
isObjectHasLength(serviceConfig) &&
|
|
352
|
+
(isStringHasLength(serviceConfig.service) ||
|
|
353
|
+
isStringHasLength(serviceConfig.name)) &&
|
|
354
|
+
isStringHasLength(serviceConfig.version)
|
|
355
|
+
);
|
|
344
356
|
}
|
|
345
357
|
|
|
346
358
|
function isFunction(value) {
|
|
347
|
-
|
|
359
|
+
return typeof value === "function";
|
|
348
360
|
}
|
|
349
361
|
|
|
350
362
|
function stringArrayMatch(arr1, arr2) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
363
|
+
let areArrays = Array.isArray(arr1) && Array.isArray(arr2);
|
|
364
|
+
let match = areArrays && arr1.length === arr2.length;
|
|
365
|
+
for (let i = 0; i < arr1.length; i++) {
|
|
366
|
+
if (!match) {
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
match = isStringHasLength(arr1[i]) && arr1[i] === arr2[i];
|
|
370
|
+
}
|
|
371
|
+
return match;
|
|
360
372
|
}
|
|
361
373
|
|
|
362
374
|
function isMatchingCasing(casing1, casing2) {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
375
|
+
const equivalentCasings = [KeyCasing.default, KeyCasing.lower];
|
|
376
|
+
if (isStringHasLength(casing1) && isStringHasLength(casing2)) {
|
|
377
|
+
let isRealCase = KeyCasing[casing1.toLowerCase()] !== undefined;
|
|
378
|
+
let casingsMatch = casing1 === casing2;
|
|
379
|
+
let casingsAreEquivalent = [casing1, casing2].every((casing) => {
|
|
380
|
+
return casing === KeyCasing.lower || casing === KeyCasing.default;
|
|
381
|
+
});
|
|
382
|
+
return isRealCase && (casingsMatch || casingsAreEquivalent);
|
|
383
|
+
} else if (isStringHasLength(casing1)) {
|
|
384
|
+
return equivalentCasings.includes(casing1.toLowerCase());
|
|
385
|
+
} else if (isStringHasLength(casing2)) {
|
|
386
|
+
return equivalentCasings.includes(casing2.toLowerCase());
|
|
387
|
+
} else {
|
|
388
|
+
return casing1 === undefined && casing2 === undefined;
|
|
389
|
+
}
|
|
378
390
|
}
|
|
379
391
|
|
|
380
392
|
module.exports = {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
393
|
+
testModel,
|
|
394
|
+
isFunction,
|
|
395
|
+
stringArrayMatch,
|
|
396
|
+
isMatchingCasing,
|
|
397
|
+
isArrayHasLength,
|
|
398
|
+
isStringHasLength,
|
|
399
|
+
isObjectHasLength,
|
|
400
|
+
isBetaServiceConfig,
|
|
401
|
+
isNameModelRecordType,
|
|
402
|
+
isNameEntityRecordType,
|
|
403
|
+
model: validateModel,
|
|
392
404
|
};
|