internaldocs-fb-helpers
Advanced tools
Comparing version 1.1.0 to 1.2.0-alpha.1
33
index.js
@@ -50,3 +50,3 @@ /** | ||
function callIfFunction(arg) { | ||
if (typeof(arg) == 'function') { | ||
if (typeof arg == 'function') { | ||
return arg(); | ||
@@ -92,2 +92,31 @@ } | ||
/* | ||
* React component for wrapping content that should only be rendered on the internal (facebook empoyee-facing) website. | ||
* | ||
* Note: Anything inlined here will still be visible in the public source code, so to include confidential content, | ||
* put it inside an .mdx file in a ./fb folder (this folder won't be synced out to GitHub), and then import it as a JSX component like so: | ||
* | ||
* import MySecretInfo from './fb/MySecretInfo.mdx' | ||
* | ||
* <FbInternalOnly> | ||
* <MySecretInfo/> | ||
* </FbInternalOnly> | ||
*/ | ||
function FbInternalOnly(props) { | ||
if (isInternal()) { | ||
return props.children; | ||
} | ||
return null; | ||
} | ||
/* | ||
* React component for wrapping content that should only be rendered on the external (public-facing) website. | ||
*/ | ||
function OssOnly(props) { | ||
if (!isInternal()) { | ||
return props.children; | ||
} | ||
return null; | ||
} | ||
module.exports = { | ||
@@ -97,2 +126,4 @@ fbContent: fbContent, | ||
isInternal: isInternal, | ||
FbInternalOnly: FbInternalOnly, | ||
OssOnly: OssOnly, | ||
}; |
{ | ||
"name": "internaldocs-fb-helpers", | ||
"version": "1.1.0", | ||
"version": "1.2.0-alpha.1", | ||
"description": "Helper library for including / excluding content from docusaurus websites", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3463
113
2