UNPKG

@selenite/graph-editor

Version:

A graph editor for visual programming, based on rete and svelte.

5 lines (4 loc) 200 B
export function getVarsFromFormatString(formatString) { // return all matches of the regex return [...new Set(Array.from(formatString.matchAll(/{([^}]+)\s*?}/g)).map((match) => match[1]))]; }