Skip to content

Commit

Permalink
add more clarity to code
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed Apr 17, 2024
1 parent b7f5909 commit 4dfd4da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugin-src/transformers/partials/transformStrokes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ import { translateStrokes } from '@plugin/translators';

import { ShapeAttributes } from '@ui/lib/types/shape/shapeAttributes';

const isVectorLike = (node: MinimalStrokesMixin | VectorLikeMixin): node is VectorLikeMixin => {
return 'vectorNetwork' in node;
};

export const transformStrokes = (
node: MinimalStrokesMixin | (MinimalStrokesMixin & VectorLikeMixin)
): Partial<ShapeAttributes> => {
return {
strokes: translateStrokes(
node.strokes,
node.strokeWeight,
'vectorNetwork' in node ? node.vectorNetwork : undefined
isVectorLike(node) ? node.vectorNetwork : undefined
)
};
};

0 comments on commit 4dfd4da

Please sign in to comment.