How to use the @uifabric/monaco-editor/lib/configureEnvironment.isConfigAvailable function in @uifabric/monaco-editor

To help you get started, we’ve selected a few @uifabric/monaco-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OfficeDev / office-ui-fabric-react / packages / tsx-editor / src / utilities / isEditorSupported.ts View on Github external
export function isEditorSupported(code: string, supportedPackages: IBasicPackageGroup[]): boolean {
  const win = getWindow();
  return (
    // Not server-side rendering
    !!win &&
    // Required environment config available
    !!isConfigAvailable() &&
    // Opt-out query param or session storage is not set
    getSetting('useEditor') !== '0' &&
    // Not IE 11
    !isIE11() &&
    // Web worker available
    typeof Worker !== 'undefined' &&
    // No immediate issues detected in example (or exceptions thrown from parsing)
    isExampleValid(code, supportedPackages)
  );
}

@uifabric/monaco-editor

Version of monaco-editor with configuration helpers and transformed CSS files

MIT
Latest version published 4 years ago

Package Health Score

70 / 100
Full package analysis

Similar packages