/**
 * @since Last modified: 2024-08-12 10:48:23
 * @function getStrFromTpl
 * @description Create strings from template literals and template engines.
 * @param {object|object[]} data -  The rendered data, in the form of an object or an array of objects.
 * @param {string} [tplStr] - This is a template string, and it might need to use `{{` and `}}`, but it depends on the template engine being used.
 * @param {function} [tplEng=renderTpl] - This is a template engine, and you can use third-party engines.
 * @returns {string} - The rendered string.
 * @see {@link https://codepen.io/axui/pen/bGPomNm|demo @ codepen}
 * @example
 * ax.getStrFromTpl('#demo');
 * <!--return 'id'-->
 */
'use strict';
const getStrFromTpl = function (data, tplStr, tplEng) {
    let str = tplStr || this.tplStr, eng = tplEng || this.tplEng;
    return eng.name === 'template' ? eng(str)(data) : eng(str, data);
};
export default getStrFromTpl;
