getPaths method

List<String> getPaths()

Gets valid paths to access values from a map of script definitions.

Implementation

List<String> getPaths() {
  final self = this;
  final result = <String>[];
  for (final k in self.keys) {
    if (self[k] is JsonMap) {
      result.addAll((self[k] as JsonMap).getPaths().map((v) => '$k $v'));
    } else if (RegExp(r'\(\w+\)').matchAsPrefix(k) != null) {
      result.add('');
    } else {
      result.add(k);
    }
  }
  return result.map((v) => v.trim()).toSet().toList();
}