MCPcopy Create free account
hub / github.com/Noumena-Network/code / evaluateBuildGate

Function evaluateBuildGate

scripts/generate_slash_command_appendix.mjs:863–884  ·  view source on GitHub ↗
(gate, buildFeatureSet, runtimeProbe)

Source from the content-addressed store, hash-verified

861}
862
863function evaluateBuildGate(gate, buildFeatureSet, runtimeProbe) {
864 if (!gate || gate === 'always') return true
865 let expression = gate
866 .replace(/feature\('([^']+)'\)/g, (_, featureName) =>
867 buildFeatureSet.has(featureName) ? 'true' : 'false')
868 .replace(
869 /shouldAutoEnableClaudeInChrome\(\)/g,
870 typeof runtimeProbe.shouldAutoEnableClaudeInChrome === 'boolean'
871 ? (runtimeProbe.shouldAutoEnableClaudeInChrome ? 'true' : 'false')
872 : 'unknown',
873 )
874
875 if (/feature\(/.test(expression)) {
876 return 'unknown'
877 }
878
879 try {
880 return Boolean(Function(`return (${expression});`)())
881 } catch {
882 return 'unknown'
883 }
884}
885
886appendixRows.sort((a, b) => {
887 const scopeCmp = a.registryScope.localeCompare(b.registryScope)

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected