@orgajs/orgx 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/lib/util/is-org-content.d.ts +6 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/index.js +1 -0
- package/lib/util/is-org-content.js +14 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { createProcessor } from "./lib/core.js";
|
|
2
|
+
export { isOrgContent } from "./lib/util/is-org-content.js";
|
|
2
3
|
export type ProcessorOptions = import("./lib/core.js").ProcessorOptions;
|
|
3
4
|
export type CompileOptions = import("./lib/compile.js").CompileOptions;
|
|
4
5
|
export type EvaluateOptions = import("./lib/evaluate.js").EvaluateOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../lib/compile.js","../lib/core.js","../lib/evaluate.js","../lib/run.js","../lib/types.ts","../lib/plugin/recma-build-jsx-transform.js","../lib/plugin/recma-document.js","../lib/plugin/recma-jsx-rewrite.js","../lib/plugin/rehype-recma.js","../lib/util/estree-util-create.js","../lib/util/estree-util-declaration-to-expression.js","../lib/util/estree-util-is-declaration.js","../lib/util/estree-util-specifiers-to-declarations.js","../lib/util/estree-util-to-binary-addition.js","../lib/util/estree-util-to-id-or-member-expression.js","../lib/util/render-error.js","../lib/util/resolve-evaluate-options.js","../lib/util/resolve-file-and-options.js","../index.js"],"version":"5.7.3"}
|
|
1
|
+
{"root":["../lib/compile.js","../lib/core.js","../lib/evaluate.js","../lib/run.js","../lib/types.ts","../lib/plugin/recma-build-jsx-transform.js","../lib/plugin/recma-document.js","../lib/plugin/recma-jsx-rewrite.js","../lib/plugin/rehype-recma.js","../lib/util/estree-util-create.js","../lib/util/estree-util-declaration-to-expression.js","../lib/util/estree-util-is-declaration.js","../lib/util/estree-util-specifiers-to-declarations.js","../lib/util/estree-util-to-binary-addition.js","../lib/util/estree-util-to-id-or-member-expression.js","../lib/util/is-org-content.js","../lib/util/render-error.js","../lib/util/resolve-evaluate-options.js","../lib/util/resolve-file-and-options.js","../index.js"],"version":"5.7.3"}
|
package/index.js
CHANGED
|
@@ -12,3 +12,4 @@ export { createProcessor } from './lib/core.js'
|
|
|
12
12
|
export { compile, compileSync } from './lib/compile.js'
|
|
13
13
|
export { evaluate, evaluateSync } from './lib/evaluate.js'
|
|
14
14
|
export { run, runSync } from './lib/run.js'
|
|
15
|
+
export { isOrgContent } from './lib/util/is-org-content.js'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if a node is an org content node.
|
|
3
|
+
* @param {import('react').ReactNode} node
|
|
4
|
+
* @returns {boolean}
|
|
5
|
+
*/
|
|
6
|
+
export function isOrgContent(node) {
|
|
7
|
+
return (
|
|
8
|
+
!!node &&
|
|
9
|
+
typeof node === 'object' &&
|
|
10
|
+
'type' in node &&
|
|
11
|
+
typeof node.type === 'function' &&
|
|
12
|
+
node.type.name === 'OrgContent'
|
|
13
|
+
)
|
|
14
|
+
}
|