mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-20 20:00:33 +03:00
feat(core): allow to pass dynamic data in options for render (#59)
This commit is contained in:
@@ -18,6 +18,7 @@ export default function bbob(plugs) {
|
|||||||
|
|
||||||
const parseFn = options.parser || parse;
|
const parseFn = options.parser || parse;
|
||||||
const renderFn = options.render;
|
const renderFn = options.render;
|
||||||
|
const data = options.data || null;
|
||||||
|
|
||||||
if (typeof parseFn !== 'function') {
|
if (typeof parseFn !== 'function') {
|
||||||
throw new Error('"parser" is not a function, please pass to "process(input, { parser })" right function');
|
throw new Error('"parser" is not a function, please pass to "process(input, { parser })" right function');
|
||||||
@@ -41,6 +42,7 @@ export default function bbob(plugs) {
|
|||||||
render: renderFn,
|
render: renderFn,
|
||||||
iterate,
|
iterate,
|
||||||
match,
|
match,
|
||||||
|
data,
|
||||||
}) || tree;
|
}) || tree;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user