@presenta/config-interpolator
v1.0.46
Published
Presenta Config Interpolator
Downloads
56
Readme
Presenta Config Interpolator
This function accepts a data config and a template config and return a merged version useful to create a PRESENTA Lib document.
Usage
import { interpolate } from '@presenta/config-interpolator
const data = {
myText: 'Hello',
myText[color]: 'red', //
myText[coords][top]: 20, //
myText[hidden][hidden]: true
}
const templateConfig = {
scenes:[{
blocks:[{
type: 'text',
ukey: 'myText',
content: ''
}]
}]
}
const config = await interpolate(data, templateConfig)
/*
const data = {
myText: 'Hello'
}
const templateConfig = {
scenes:[{
blocks:[{
type: 'text',
ukey: 'myText',
content: 'Hello'
}]
}]
}
*/