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 +1 -1
- package/dist/index.js +9 -5
- package/package.json +1 -1
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
|
|
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
|
-
|
|
386
|
-
|
|
387
|
-
|
|
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 {
|