appendIndexToPath static method
Implementation
static Iterable<Map<String, dynamic>> appendIndexToPath(
List<Map<String, dynamic>> elementPatches, int index) {
return elementPatches.map((Map<String, dynamic> elementPatch) {
final path = elementPatch['path'] as String;
final copy = Map<String, dynamic>.from(elementPatch);
copy['path'] = JsonPointer.join(
JsonPointer.fromSegments([index.toString()]),
JsonPointer.fromString(path),
).toString();
return copy;
});
}