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 +1 -1
- package/dist/index.js +7 -9
- 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/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
|
-
:
|
|
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
|
-
|
|
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
|
}
|