inibase 1.5.0 → 1.5.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/dist/cli.js +1 -1
- package/dist/file.js +4 -4
- package/dist/index.js +1 -1
- package/dist/utils.server.js +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -52,7 +52,7 @@ rl.on("line", async (input) => {
|
|
|
52
52
|
break;
|
|
53
53
|
case "exit":
|
|
54
54
|
return process.exit();
|
|
55
|
-
// biome-ignore format:
|
|
55
|
+
// biome-ignore format: keep help text aligned for readability
|
|
56
56
|
case "help": {
|
|
57
57
|
if (!table)
|
|
58
58
|
console.log(` ${textBlue("table")} | ${textBlue("t")} ${textRed("<")}tableName${textRed(">*")}`);
|
package/dist/file.js
CHANGED
|
@@ -179,14 +179,14 @@ export const decode = (input, field) => {
|
|
|
179
179
|
if (input === null || input === "")
|
|
180
180
|
return undefined;
|
|
181
181
|
// Detect the fieldType based on the input and the provided array of possible types.
|
|
182
|
-
if (Array.isArray(field.type))
|
|
183
|
-
field.type = detectFieldType(String(input), field.type);
|
|
184
182
|
// Decode the input using the decodeHelper function.
|
|
185
183
|
return decodeHelper(typeof input === "string"
|
|
186
184
|
? isStringified(input)
|
|
187
185
|
? Inison.unstringify(input)
|
|
188
186
|
: unSecureString(input)
|
|
189
|
-
: input, field)
|
|
187
|
+
: input, Array.isArray(field.type)
|
|
188
|
+
? { ...field, type: detectFieldType(String(input), field.type) }
|
|
189
|
+
: field);
|
|
190
190
|
};
|
|
191
191
|
function _groupIntoRanges(arr, action = "p") {
|
|
192
192
|
if (arr.length === 0)
|
|
@@ -224,7 +224,7 @@ export async function get(filePath, lineNumbers, field, readWholeFile = false) {
|
|
|
224
224
|
lines[linesCount] = decode(line, field);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
else if (lineNumbers
|
|
227
|
+
else if (lineNumbers === -1) {
|
|
228
228
|
const escapedFilePath = escapeShellPath(filePath);
|
|
229
229
|
const command = filePath.endsWith(".gz")
|
|
230
230
|
? `zcat ${escapedFilePath} | sed -n '$p'`
|
package/dist/index.js
CHANGED
|
@@ -171,7 +171,7 @@ export default class Inibase {
|
|
|
171
171
|
// if config not set => load default global env config
|
|
172
172
|
if (!config)
|
|
173
173
|
config = {
|
|
174
|
-
compression: process.env.INIBASE_COMPRESSION
|
|
174
|
+
compression: process.env.INIBASE_COMPRESSION === "true",
|
|
175
175
|
cache: process.env.INIBASE_CACHE === "true",
|
|
176
176
|
prepend: process.env.INIBASE_PREPEND === "true",
|
|
177
177
|
decodeID: process.env.INIBASE_ENCODEID === "true",
|
package/dist/utils.server.js
CHANGED
|
@@ -95,8 +95,7 @@ export const compare = (operator, originalValue, comparedValue, fieldType) => {
|
|
|
95
95
|
// Special handling when the original value is an array.
|
|
96
96
|
if (Array.isArray(originalValue) &&
|
|
97
97
|
!Array.isArray(comparedValue) &&
|
|
98
|
-
!["[]", "![]"].includes(operator)
|
|
99
|
-
fieldType !== "array")
|
|
98
|
+
!["[]", "![]"].includes(operator))
|
|
100
99
|
return originalValue.some((value) => compare(operator, value, comparedValue, fieldType));
|
|
101
100
|
// Switch statement for different comparison operators.
|
|
102
101
|
switch (operator) {
|
|
@@ -198,6 +197,7 @@ export const isArrayEqual = (originalValue, comparedValue) => {
|
|
|
198
197
|
return originalValue.includes(comparedValue);
|
|
199
198
|
if (Array.isArray(comparedValue))
|
|
200
199
|
return comparedValue.includes(originalValue);
|
|
200
|
+
// biome-ignore lint/suspicious/noDoubleEquals: intended loose comparison
|
|
201
201
|
return originalValue == comparedValue;
|
|
202
202
|
};
|
|
203
203
|
/**
|