corebasic 1.0.266 → 1.0.267
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/libs/features.js +3 -1
- package/libs/features.ts +4 -1
- package/package.json +1 -1
package/dist/libs/features.js
CHANGED
|
@@ -49,6 +49,8 @@ const getFeatureUrl = (api) => { const url = api.split(' ')[1]; if (!url)
|
|
|
49
49
|
throw new Error(`Invalid Feature url in api: ${api}`); return url; };
|
|
50
50
|
const getFeature = (name) => features[name];
|
|
51
51
|
function getLeaf(feature, req) {
|
|
52
|
+
if (feature)
|
|
53
|
+
return feature.split(/\.(query|command)\./)[0];
|
|
52
54
|
if (req) {
|
|
53
55
|
for (let key in features) {
|
|
54
56
|
const feature = features[key];
|
|
@@ -58,7 +60,7 @@ function getLeaf(feature, req) {
|
|
|
58
60
|
return "NOLEAF"; // This code will never be reached as apiHandler()'s prior code ensures req is valid and there exists a feature. Included to silence ./tsc
|
|
59
61
|
}
|
|
60
62
|
else {
|
|
61
|
-
return feature.
|
|
63
|
+
return "NOLEAF"; // This code will never be reached as apiHandler()'s prior code ensures req is valid and there exists a feature. Included to silence ./tsc
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
const DEPLOY_TOKEN_SECRET = process.env.DEPLOY_TOKEN_SECRET || "MY_SECRET_DEPLOY_TOKEN";
|
package/libs/features.ts
CHANGED
|
@@ -157,6 +157,9 @@ const getFeatureUrl = (api: string): string => { const url = api.split(' ')[1];
|
|
|
157
157
|
const getFeature = (name: string): FeatureEntry | undefined => features[name]
|
|
158
158
|
|
|
159
159
|
function getLeaf(feature: string, req?: ExpressRequest): string {
|
|
160
|
+
if (feature)
|
|
161
|
+
return feature.split(/\.(query|command)\./)[0]!
|
|
162
|
+
|
|
160
163
|
if (req) {
|
|
161
164
|
for(let key in features) {
|
|
162
165
|
const feature = features[key]!
|
|
@@ -165,7 +168,7 @@ function getLeaf(feature: string, req?: ExpressRequest): string {
|
|
|
165
168
|
}
|
|
166
169
|
return "NOLEAF" // This code will never be reached as apiHandler()'s prior code ensures req is valid and there exists a feature. Included to silence ./tsc
|
|
167
170
|
} else {
|
|
168
|
-
return feature.
|
|
171
|
+
return "NOLEAF" // This code will never be reached as apiHandler()'s prior code ensures req is valid and there exists a feature. Included to silence ./tsc
|
|
169
172
|
}
|
|
170
173
|
}
|
|
171
174
|
|