MCPcopy Create free account
hub / github.com/bernaferrari/FigmaToCode / getImageFills

Function getImageFills

packages/backend/src/common/images.ts:59–65  ·  view source on GitHub ↗
(node: MinimalFillsMixin)

Source from the content-addressed store, hash-verified

57const fillIsImage = ({ type }: Paint) => type === "IMAGE";
58
59export const getImageFills = (node: MinimalFillsMixin): ImagePaint[] => {
60 try {
61 return (node.fills as ImagePaint[]).filter(fillIsImage);
62 } catch (e) {
63 return [];
64 }
65};
66
67export const nodeHasImageFill = (node: MinimalFillsMixin): Boolean =>
68 getImageFills(node).length > 0;

Callers 1

nodeHasImageFillFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected