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

Function normalizeCapabilities

public/js/adminPanel.js:1911–1920  ·  view source on GitHub ↗
(raw)

Source from the content-addressed store, hash-verified

1909 const capabilityOrder = ['read', 'createFolder', 'write', 'moveRename', 'delete'];
1910
1911 const normalizeCapabilities = (raw) => {
1912 if (!raw || typeof raw !== 'object') return {};
1913 const out = {};
1914 capabilityOrder.forEach((key) => {
1915 if (!Object.prototype.hasOwnProperty.call(raw, key)) return;
1916 const value = raw[key];
1917 out[key] = (value === true) ? true : ((value === false) ? false : null);
1918 });
1919 return out;
1920 };
1921
1922 const getCapabilityState = (key, testState) => {
1923 const checks = Array.isArray(testState?.checks) ? testState.checks : [];

Callers 3

getTestStatusFunction · 0.85
runSourceTestFunction · 0.85
initSourcesSectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected