@forge/bridge
5.14.2-next.4-experimental-13a01c25.15.0-next.5
out/featureFlags/initFeatureFlags.js~
out/featureFlags/initFeatureFlags.jsModified+3
Index: package/out/featureFlags/initFeatureFlags.js
===================================================================
--- package/out/featureFlags/initFeatureFlags.js
+++ package/out/featureFlags/initFeatureFlags.js
@@ -10,8 +10,11 @@
const validatePayload = (payload) => {
if (!payload || !payload.user || !payload.config) {
throw new errors_1.BridgeAPIError('Missing required parameters. Parameter user is required in the payload.');
}
+ if (!payload.config.environment || !['development', 'staging', 'production'].includes(payload.config.environment)) {
+ throw new errors_1.BridgeAPIError('Invalid environment. Valid environments are: development, staging, production');
+ }
if (Object.values(payload).some((val) => typeof val === 'function')) {
throw new errors_1.BridgeAPIError('Passing functions as part of the payload is not supported!');
}
};