Prism · Strings
$fill
Fills a counted phrase with its own slots: a value of the form { phrase, slots } becomes the phrase with each {slot} replaced. A value of any other form passes through unchanged.
{
progress: { phrase: '{n} of {total}', slots: { n: 1, total: 12 } },
plain: 'done',
}{
filled: { $fill: { $ref: '$.progress' } },
untouched: { $fill: { $ref: '$.plain' } },
}{ filled: '1 of 12', untouched: 'done' }Runs in this page on the installed package. The input and the expected output are defined by the example.