inibase 1.2.1 → 1.2.3

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/index.js CHANGED
@@ -903,7 +903,8 @@ export default class Inibase {
903
903
  .map((column) => column.replace(`${field.key}.`, "")),
904
904
  });
905
905
  const formatLineContent = (lineContent) => Array.isArray(lineContent)
906
- ? lineContent.map((singleContent) => singleContent
906
+ ? lineContent
907
+ .map((singleContent) => singleContent
907
908
  ? Array.isArray(singleContent)
908
909
  ? singleContent.map(formatLineContent)
909
910
  : items
@@ -912,6 +913,7 @@ export default class Inibase {
912
913
  id: singleContent,
913
914
  }
914
915
  : singleContent)
916
+ .filter(Boolean)
915
917
  : (items?.find(({ id }) => lineContent === id) ?? {
916
918
  id: lineContent,
917
919
  });
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
- if (Array.isArray(field.type)) {
349
- const detectedFieldType = detectFieldType(value, field.type);
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
- field.type = detectedFieldType;
353
+ _fieldType = detectedFieldType;
353
354
  }
354
- if (field.type === "array" && field.children)
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 (field.type) {
371
+ switch (_fieldType) {
371
372
  case "string":
372
373
  return isString(value);
373
374
  case "password":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inibase",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Karim Amahtil",