UNPKG

@utilify/core

Version:

Modern, strongly typed, and safe utility function library for JavaScript and TypeScript. Includes type checking, manipulation of arrays, objects, strings, dates, colors, numbers, regular expressions, and more. Compatible with Browser, Node.js, Deno, and B

10 lines 515 B
/** * Interpolates values from a data object into a string using a pattern. * @param {string} str - The template string. * @param {Record<PropertyKey, any>} data - The data object. * @param {RegExp} [pattern=/{{(.*?)}}/g] - The pattern to match template variables. * @returns {string} The interpolated string. * @throws {TypeError} If str is not a string. */ export default function interpolate(str: string, data: Record<PropertyKey, any>, pattern?: RegExp): string; //# sourceMappingURL=interpolate.d.ts.map