@presenta/config-interpolator

1.0.46 • Public • Published

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'
		}]
	}]
}

*/

Readme

Keywords

none

Package Sidebar

Install

npm i @presenta/config-interpolator

Weekly Downloads

5

Version

1.0.46

License

BSD-3-Clause

Unpacked Size

95.7 kB

Total Files

4

Last publish

Collaborators

  • abusedmedia