UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

22 lines (21 loc) 1.23 kB
var FEDRAMP_MODERATE = 'fedramp-moderate'; // To determine whether an instance is a FedRAMP instance // Copied from platform/packages/uip/atl-context/src/services/is-fedramp/index.tsx // We cannot import the same-named function from @atlassian/atl-context due to editor-common being a public package (and atl-context being private) // TODO: Seek alternatives export function isFedRamp() { var _global$location; // Ignored via go/ees005 // eslint-disable-next-line @typescript-eslint/no-explicit-any var global = globalThis; // MICROS_PERIMETER is already used by few products, so we need to keep it for backward compatibility var env = global.MICROS_PERIMETER || global.UNSAFE_ATL_CONTEXT_BOUNDARY; if (env) { return env === FEDRAMP_MODERATE; } var matches = (_global$location = global.location) === null || _global$location === void 0 || (_global$location = _global$location.hostname) === null || _global$location === void 0 ? void 0 : _global$location.match( // Ignored via go/ees005 // eslint-disable-next-line require-unicode-regexp /atlassian-us-gov-mod\.(com|net)|atlassian-us-gov\.(com|net)|atlassian-fex\.(com|net)|atlassian-stg-fedm\.(com|net)/); return matches ? matches.length > 0 : false; }