1 | ;
|
2 | const Transform = require('./transform');
|
3 |
|
4 | /**
|
5 | * Parse both base and child templates
|
6 | *
|
7 | * @param {Array} handledTags - Tags that should be treated specially and will be handled in the future
|
8 | * @param {Array} insertBeforePipeTags - Pipe definition will be inserted before these tags
|
9 | * @returns {Promise} Promise that resolves to serialized array consisits of buffer and fragment objects
|
10 | */
|
11 | module.exports = (handledTags, insertBeforePipeTags) => (
|
12 | baseTemplate,
|
13 | childTemplate,
|
14 | fullRendering = true
|
15 | ) => {
|
16 | return Promise.resolve(
|
17 | new Transform(handledTags, insertBeforePipeTags)
|
18 | ).then(transform =>
|
19 | transform.applyTransforms(baseTemplate, childTemplate, fullRendering)
|
20 | );
|
21 | };
|