MCPcopy Index your code
hub / github.com/chartbrew/chartbrew / applySourceAvailability

Function applySourceAvailability

server/sources/sourceAvailability.js:31–46  ·  view source on GitHub ↗
(source, env = process.env)

Source from the content-addressed store, hash-verified

29}
30
31function applySourceAvailability(source, env = process.env) {
32 const disabledServerSources = parseSourceList(env.CB_DISABLED_SERVER_SOURCES);
33 const serverEnabled = !sourceMatchesList(source, disabledServerSources);
34
35 return {
36 ...source,
37 availability: {
38 ...source.availability,
39 server: {
40 enabled: serverEnabled,
41 ...source.availability?.server,
42 ...(serverEnabled ? {} : { enabled: false }),
43 },
44 },
45 };
46}
47
48function isSourceServerEnabled(source, env = process.env) {
49 const disabledServerSources = parseSourceList(env.CB_DISABLED_SERVER_SOURCES);

Callers 1

Calls 2

parseSourceListFunction · 0.70
sourceMatchesListFunction · 0.70

Tested by

no test coverage detected