inibase 1.5.0 → 1.5.1

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 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 == -1) {
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 == "true",
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",
@@ -198,6 +198,7 @@ export const isArrayEqual = (originalValue, comparedValue) => {
198
198
  return originalValue.includes(comparedValue);
199
199
  if (Array.isArray(comparedValue))
200
200
  return comparedValue.includes(originalValue);
201
+ // biome-ignore lint/suspicious/noDoubleEquals: intended loose comparison
201
202
  return originalValue == comparedValue;
202
203
  };
203
204
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inibase",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Karim Amahtil",