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