internaldocs-fb-helpers
Advanced tools
Comparing version 1.6.1 to 1.6.2
@@ -21,3 +21,3 @@ /** | ||
export declare function validateFbContentArgs<X, Y>(args: FbContent<X, Y>): void; | ||
export declare function isInternal(): any; | ||
export declare function isInternal(): string | undefined; | ||
export declare function FbInternalOnly<T>(props: { | ||
@@ -24,0 +24,0 @@ children: ReactElement<T>; |
@@ -32,11 +32,2 @@ "use strict"; | ||
const FB_CONTENT_ARG_KEYS = ['internal', 'external']; | ||
let usePluginData; | ||
try { | ||
// When using docusuarus V2 (and docusaurus-plugin-internaldocs-fb), | ||
// we can switch content at runtime (in the browser). | ||
usePluginData = require('@docusaurus/useGlobalData').usePluginData; | ||
} | ||
catch (e) { | ||
usePluginData = null; | ||
} | ||
/* | ||
@@ -93,4 +84,4 @@ * Accepts arguments of the form: | ||
function isInternal() { | ||
return (process.env.FB_INTERNAL || | ||
(usePluginData && usePluginData('internaldocs-fb').FB_INTERNAL)); | ||
// To use this in front-end code, we're relying on docusaurus-plugin-internaldocs-fb to add this value to the webpack env plugins. | ||
return process.env.FB_INTERNAL; | ||
} | ||
@@ -97,0 +88,0 @@ exports.isInternal = isInternal; |
{ | ||
"name": "internaldocs-fb-helpers", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"description": "Helper library for including / excluding content from docusaurus websites", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
15699
433