getPaths method
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) {
final value = self[k];
if (value is Map) {
final subPaths = value.asJsonMap().getPaths();
if (subPaths.isEmpty) {
result.add(k);
} else {
result.addAll(subPaths.map((v) => '$k $v'));
}
} else if (_metaKeyPattern.hasMatch(k)) {
continue;
} else {
result.add(k);
}
}
return result.map((v) => v.trim()).where((v) => v.isNotEmpty).toSet().toList()..sort();
}