1
2
3
4
5
6
7
8
9
10
11
export function FigmaFramesOnly(json: any): any {
const frames = [];
const canvases = json.document.children.filter((child) =>
child.type === "CANVAS"
);
for (const canvas of canvases) {
const children = canvas.children.filter((child) => child.type === "FRAME");
frames.push(...children);
}
return frames;
}