MCPcopy Create free account
hub / github.com/error311/FileRise / getCapabilityState

Function getCapabilityState

public/js/adminPanel.js:1922–1934  ·  view source on GitHub ↗
(key, testState)

Source from the content-addressed store, hash-verified

1920 };
1921
1922 const getCapabilityState = (key, testState) => {
1923 const checks = Array.isArray(testState?.checks) ? testState.checks : [];
1924 const found = checks.find((check) => check.key === key);
1925 if (found) return normalizeCheckState(found.state);
1926
1927 const caps = testState && typeof testState.capabilities === 'object'
1928 ? testState.capabilities
1929 : {};
1930 if (!Object.prototype.hasOwnProperty.call(caps, key)) return 'unknown';
1931 if (caps[key] === true) return 'ok';
1932 if (caps[key] === false) return 'fail';
1933 return 'skipped';
1934 };
1935
1936 const getCapabilityTitle = (key, testState, state) => {
1937 const label = capabilityLabelMap[key] || key;

Callers 1

renderCapabilityBadgesFunction · 0.85

Calls 1

normalizeCheckStateFunction · 0.85

Tested by

no test coverage detected