inibase 1.0.0-rc.92 → 1.0.0-rc.94

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/index.d.ts CHANGED
@@ -148,7 +148,7 @@ export default class Inibase {
148
148
  * @param {false} [returnUpdatedData]
149
149
  * @return {*} {Promise<Data | Data[] | null | undefined | void>}
150
150
  */
151
- put(tableName: string, data: Data | Data[], where: number | string | (number | string)[] | Criteria | undefined, options: Options | undefined, returnUpdatedData: false): Promise<void>;
151
+ put(tableName: string, data: Data | Data[], where?: number | string | (number | string)[] | Criteria, options?: Options, returnUpdatedData?: false): Promise<void>;
152
152
  put(tableName: string, data: Data, where: number | string | (number | string)[] | Criteria | undefined, options: Options | undefined, returnUpdatedData: true): Promise<Data | null>;
153
153
  put(tableName: string, data: Data[], where: number | string | (number | string)[] | Criteria | undefined, options: Options | undefined, returnUpdatedData: true): Promise<Data[] | null>;
154
154
  /**
package/dist/index.js CHANGED
@@ -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:
@@ -1136,10 +1140,10 @@ export default class Inibase {
1136
1140
  if (returnPostedData)
1137
1141
  return this.get(tableName, this.tables[tableName].config.prepend
1138
1142
  ? Array.isArray(RETURN)
1139
- ? RETURN.map((_, index) => index + 1)
1143
+ ? RETURN.map((_, index) => index + 1).toReversed()
1140
1144
  : 1
1141
1145
  : Array.isArray(RETURN)
1142
- ? RETURN.map((_, index) => this.totalItems[`${tableName}-*`] - index)
1146
+ ? RETURN.map((_, index) => this.totalItems[`${tableName}-*`] - index).toReversed()
1143
1147
  : this.totalItems[`${tableName}-*`], options, !Utils.isArrayOfObjects(data));
1144
1148
  }
1145
1149
  finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inibase",
3
- "version": "1.0.0-rc.92",
3
+ "version": "1.0.0-rc.94",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Karim Amahtil",