2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-05-15 11:59:37 +03:00

feat(core): allow to pass dynamic data in options for render (#59)

This commit is contained in:
Vladimir
2020-03-16 22:37:36 +10:00
committed by GitHub
parent aac1ae0e81
commit 0b74be7830
+2
View File
@@ -18,6 +18,7 @@ export default function bbob(plugs) {
const parseFn = options.parser || parse;
const renderFn = options.render;
const data = options.data || null;
if (typeof parseFn !== '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,
iterate,
match,
data,
}) || tree;
});