corebasic 1.0.193 → 1.0.194
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 +8 -2
- package/package.json +1 -1
package/libs/elabase.js
CHANGED
|
@@ -53,13 +53,19 @@ export const globalMeta = args => {
|
|
|
53
53
|
return {
|
|
54
54
|
...obj,
|
|
55
55
|
setOutlet: outlet => {
|
|
56
|
-
if (outlet
|
|
56
|
+
if (typeof outlet !== "string" && !Array.isArray(outlet))
|
|
57
|
+
throw {message: "Error: Invalid outlet provided in Dip.globalMeta().setOutlet()"}
|
|
58
|
+
if (!outlet || (typeof outlet === "string" && outlet.trim() === "") || outlet === "GLOBAL" || (Array.isArray(outlet) && (!outlet.length || outlet.some(item => typeof item !== "string" || item.trim() === "" || item === "GLOBAL")) ))
|
|
57
59
|
throw {message: "Error: Invalid outlet provided in Dip.globalMeta().setOutlet()"}
|
|
60
|
+
|
|
58
61
|
return {...obj, outlet}
|
|
59
62
|
},
|
|
60
63
|
setCompany: company => {
|
|
61
|
-
if (company
|
|
64
|
+
if (typeof company !== "string" && !Array.isArray(company))
|
|
65
|
+
throw {message: "Error: Invalid company provided in Dip.globalMeta().setCompany()"}
|
|
66
|
+
if (!company || (typeof company === "string" && company.trim() === "") || company === "GLOBAL" || (Array.isArray(company) && (!company.length || company.some(item => typeof item !== "string" || item.trim() === "" || item === "GLOBAL")) ))
|
|
62
67
|
throw {message: "Error: Invalid company provided in Dip.globalMeta().setCompany()"}
|
|
68
|
+
|
|
63
69
|
return {...obj, company}
|
|
64
70
|
},
|
|
65
71
|
}
|