MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / getEntitlements

Function getEntitlements

packages/shared/src/entitlements.ts:159–172  ·  view source on GitHub ↗
(_license: License | null)

Source from the content-addressed store, hash-verified

157}
158
159export const getEntitlements = (_license: License | null): Entitlement[] => {
160 const offlineLicense = getValidOfflineLicense();
161 if (offlineLicense) {
162 return ALL_ENTITLEMENTS as unknown as Entitlement[];
163 }
164
165 const onlineLicense = getValidOnlineLicense(_license);
166 if (onlineLicense) {
167 return onlineLicense.entitlements as unknown as Entitlement[];
168 }
169 else {
170 return [];
171 }
172}
173
174export const hasEntitlement = (entitlement: Entitlement, _license: License | null) => {
175 const entitlements = getEntitlements(_license);

Callers 2

hasEntitlementFunction · 0.70

Calls 2

getValidOfflineLicenseFunction · 0.85
getValidOnlineLicenseFunction · 0.85

Tested by

no test coverage detected