Custom String Formatter API
    Preparing search index...

    Function enumVariables

    • Enumerates and parses variables from a string, for any kind of reference analysis.

      Parameters

      • text: string

        Text string with variables.

      Returns IVariable[]

      IVariable[] An array of matched variables (as descriptors)

      import {enumVariables} from 'custom-string-formatter';

      enumVariables('${title} ${name} address: ${address | json}');
      // ==>
      [
      {match: '${title}', property: 'title', filters: []},
      {match: '${name}', property: 'name', filters: []},
      {
      match: '${address | json}',
      property: 'address',
      filters: [{name: 'json', args: []}]
      }
      ]