How can I convert below JSON array dynamically with javascript to:
[{"name":"file1.txt"},{"name":"folderA/file2.txt"},{&