inibase 1.2.2 → 1.2.4
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/dist/file.js +1 -1
- package/dist/utils.js +6 -5
- package/package.json +1 -1
package/dist/file.js
CHANGED
|
@@ -558,7 +558,7 @@ export const search = async (filePath, operator, comparedAtValue, logicalOperato
|
|
|
558
558
|
if (offset && linesNumbers.size < offset)
|
|
559
559
|
continue;
|
|
560
560
|
// Check if the limit has been reached.
|
|
561
|
-
if (limit && linesNumbers.size
|
|
561
|
+
if (limit && linesNumbers.size >= limit + (offset ?? 0)) {
|
|
562
562
|
if (readWholeFile)
|
|
563
563
|
continue;
|
|
564
564
|
break;
|
package/dist/utils.js
CHANGED
|
@@ -345,13 +345,14 @@ export const filterSchema = (schema, callback) => schema.filter((field) => {
|
|
|
345
345
|
export const validateFieldType = (value, field) => {
|
|
346
346
|
if (value === null)
|
|
347
347
|
return true;
|
|
348
|
-
|
|
349
|
-
|
|
348
|
+
let _fieldType = field.type;
|
|
349
|
+
if (Array.isArray(_fieldType)) {
|
|
350
|
+
const detectedFieldType = detectFieldType(value, _fieldType);
|
|
350
351
|
if (!detectedFieldType)
|
|
351
352
|
return false;
|
|
352
|
-
|
|
353
|
+
_fieldType = detectedFieldType;
|
|
353
354
|
}
|
|
354
|
-
if (
|
|
355
|
+
if (_fieldType === "array" && field.children)
|
|
355
356
|
return (Array.isArray(value) &&
|
|
356
357
|
(isArrayOfObjects(field.children) ||
|
|
357
358
|
value.every((v) => {
|
|
@@ -367,7 +368,7 @@ export const validateFieldType = (value, field) => {
|
|
|
367
368
|
type: _fieldChildrenType,
|
|
368
369
|
});
|
|
369
370
|
})));
|
|
370
|
-
switch (
|
|
371
|
+
switch (_fieldType) {
|
|
371
372
|
case "string":
|
|
372
373
|
return isString(value);
|
|
373
374
|
case "password":
|