inibase 1.0.0-rc.105 → 1.0.0-rc.106
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.js +8 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1074,8 +1074,8 @@ export default class Inibase {
|
|
|
1074
1074
|
if (!returnPostedData)
|
|
1075
1075
|
returnPostedData = false;
|
|
1076
1076
|
const keys = UtilsServer.hashString(Object.keys(Array.isArray(data) ? data[0] : data).join("."));
|
|
1077
|
-
// Skip
|
|
1078
|
-
this.validateData(data, schema.slice(
|
|
1077
|
+
// Skip ID and (created|updated)At
|
|
1078
|
+
this.validateData(data, schema.slice(1, -2));
|
|
1079
1079
|
let lastId = 0;
|
|
1080
1080
|
const renameList = [];
|
|
1081
1081
|
try {
|
|
@@ -1153,9 +1153,10 @@ export default class Inibase {
|
|
|
1153
1153
|
throw this.Error("INVALID_ID", data.id);
|
|
1154
1154
|
return this.put(tableName, data, data.id, options, returnUpdatedData || undefined);
|
|
1155
1155
|
}
|
|
1156
|
-
|
|
1156
|
+
// Skip ID and (created|updated)At
|
|
1157
|
+
this.validateData(data, schema.slice(1, -2), true);
|
|
1157
1158
|
await this.checkUnique(tableName, schema);
|
|
1158
|
-
|
|
1159
|
+
this.formatData(data, schema, true);
|
|
1159
1160
|
const pathesContents = this.joinPathesContents(tableName, {
|
|
1160
1161
|
...(({ id, ...restOfData }) => restOfData)(data),
|
|
1161
1162
|
updatedAt: Date.now(),
|
|
@@ -1191,9 +1192,9 @@ export default class Inibase {
|
|
|
1191
1192
|
else if ((Array.isArray(where) && where.every(Utils.isNumber)) ||
|
|
1192
1193
|
Utils.isNumber(where)) {
|
|
1193
1194
|
// "where" in this case, is the line(s) number(s) and not id(s)
|
|
1194
|
-
this.validateData(data, schema, true);
|
|
1195
|
-
await this.checkUnique(tableName, schema);
|
|
1196
|
-
|
|
1195
|
+
this.validateData(data, schema.slice(1, -2), true);
|
|
1196
|
+
await this.checkUnique(tableName, schema.slice(1, -2));
|
|
1197
|
+
this.formatData(data, schema, true);
|
|
1197
1198
|
const pathesContents = Object.fromEntries(Object.entries(this.joinPathesContents(tableName, Utils.isArrayOfObjects(data)
|
|
1198
1199
|
? data.map((item) => ({
|
|
1199
1200
|
...item,
|