inibase 1.2.3 → 1.2.5

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 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 > limit + (offset ?? 0)) {
561
+ if (limit && linesNumbers.size >= limit + (offset ?? 0)) {
562
562
  if (readWholeFile)
563
563
  continue;
564
564
  break;
package/dist/index.js CHANGED
@@ -907,20 +907,18 @@ export default class Inibase {
907
907
  .map((singleContent) => singleContent
908
908
  ? Array.isArray(singleContent)
909
909
  ? singleContent.map(formatLineContent)
910
- : items
911
- ? items.find(({ id }) => singleContent === id)
912
- : {
913
- id: singleContent,
914
- }
910
+ : items?.find(({ id }) => singleContent === id)
915
911
  : singleContent)
916
912
  .filter(Boolean)
917
- : (items?.find(({ id }) => lineContent === id) ?? {
918
- id: lineContent,
919
- });
913
+ : items?.find(({ id }) => lineContent === id);
920
914
  for (const [lineNumber, lineContent] of searchableIDs.entries()) {
921
915
  if (!lineContent)
922
916
  continue;
923
- RETURN[lineNumber][field.key] = formatLineContent(lineContent);
917
+ const formatedLineContent = formatLineContent(lineContent);
918
+ if (formatedLineContent &&
919
+ (!Array.isArray(formatedLineContent) ||
920
+ formatedLineContent.length > 0))
921
+ RETURN[lineNumber][field.key] = formatedLineContent;
924
922
  }
925
923
  }
926
924
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inibase",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Karim Amahtil",