UNPKG

@netlify/config

Version:
13 lines (12 loc) 476 B
// From CLI `--featureFlags=a,b,c` to programmatic `{ a: true, b: true, c: true }` export const normalizeCliFeatureFlags = function (cliFeatureFlags) { return Object.assign({}, ...cliFeatureFlags.split(',').filter(isNotEmpty).map(getFeatureFlag)); }; const isNotEmpty = function (name) { return name.trim() !== ''; }; const getFeatureFlag = function (name) { return { [name]: true }; }; // Default values for feature flags export const DEFAULT_FEATURE_FLAGS = {};