corebasic 1.0.150 → 1.0.151

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/libs/elabase.js +4 -0
  2. package/package.json +1 -1
package/libs/elabase.js CHANGED
@@ -84,6 +84,7 @@ export function transactionCommit(arg) {
84
84
  }
85
85
 
86
86
  export const insert = async (meta, collection, value, _id) => {
87
+ if (typeof collection !== "string") throw {message: "Error: collection type is not string in Dip.insert()"}
87
88
  // Multi Company Support
88
89
  if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.insert()"}
89
90
  collection = `${meta.company}.${collection}`
@@ -123,6 +124,7 @@ export const insert = async (meta, collection, value, _id) => {
123
124
  }
124
125
 
125
126
  export const query = async (meta, collection, query, options) => {
127
+ if (typeof collection !== "string") throw {message: "Error: collection type is not string in Dip.query()"}
126
128
  if (meta?.USE_EMPTY_COMPANY) {
127
129
 
128
130
  } else {
@@ -172,6 +174,7 @@ function collectionArray(col) {
172
174
  export const update = async (meta, collection, query, update, options) => {
173
175
  // Multi Company Support
174
176
  if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.update()"}
177
+ if (typeof collection !== "string") throw {message: "Error: collection type is not string in Dip.update()"}
175
178
  collection = `${meta.company}.${collection}`
176
179
  if (meta.company !== "GLOBAL") {
177
180
  query.company = meta.company
@@ -215,6 +218,7 @@ export const update = async (meta, collection, query, update, options) => {
215
218
  export const remove = async (meta, collection, query) => {
216
219
  // Multi Company Support
217
220
  if (Utils.isEmpty(meta?.company)) throw {message: "Error: meta argument not provided in Dip.remove()"}
221
+ if (typeof collection !== "string") throw {message: "Error: collection type is not string in Dip.remove()"}
218
222
  collection = `${meta.company}.${collection}`
219
223
  if (meta.company !== "GLOBAL")
220
224
  query.company = meta.company
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.150",
4
+ "version": "1.0.151",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {