inibase 1.0.0-rc.93 → 1.0.0-rc.95

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -332,7 +332,7 @@ export default class Inibase {
332
332
  fieldType[0]);
333
333
  if (!value)
334
334
  return null;
335
- if (fieldType !== "array" && Array.isArray(value))
335
+ if (fieldType !== "array" && fieldType !== "json" && Array.isArray(value))
336
336
  value = value[0];
337
337
  switch (fieldType) {
338
338
  case "array":
@@ -382,9 +382,13 @@ export default class Inibase {
382
382
  case "json": {
383
383
  if (typeof value === "string" && Utils.isStringified(value))
384
384
  return value;
385
- const cleanedObject = this.cleanObject(value);
386
- if (cleanedObject)
387
- return Inison.stringify(cleanedObject);
385
+ if (Utils.isObject(value)) {
386
+ const cleanedObject = this.cleanObject(value);
387
+ if (cleanedObject)
388
+ return Inison.stringify(cleanedObject);
389
+ }
390
+ else
391
+ return Inison.stringify(value);
388
392
  return null;
389
393
  }
390
394
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inibase",
3
- "version": "1.0.0-rc.93",
3
+ "version": "1.0.0-rc.95",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Karim Amahtil",