corebasic 1.0.126 → 1.0.127
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/libs/elabase.js +2 -3
- package/package.json +1 -1
package/libs/elabase.js
CHANGED
|
@@ -103,12 +103,11 @@ export const insert = async (meta, collection, value, _id) => {
|
|
|
103
103
|
if (_id)
|
|
104
104
|
arg._id = _id
|
|
105
105
|
|
|
106
|
-
if (!(["string", "number"].includes(typeof
|
|
106
|
+
if (!(["string", "number"].includes(typeof value?._id)))
|
|
107
107
|
throw {message: "Error: invalid _id in Dip.insert()"}
|
|
108
|
-
if (typeof
|
|
108
|
+
if (typeof value?._id === "string" && value._id.trim().length === 0)
|
|
109
109
|
throw {message: "Error: invalid _id in Dip.insert()"}
|
|
110
110
|
|
|
111
|
-
if ((!arg._id && arg._id !== 0))
|
|
112
111
|
|
|
113
112
|
if (isTransaction) {
|
|
114
113
|
transactions.push(arg)
|