Skip to content

Commit

Permalink
fix: add array type check (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
Amiditin authored Dec 11, 2024
1 parent f236eef commit ce49647
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class FigmaThemeBordersGenerator extends FigmaThemeGenerator {
const borders: Map<string, Border> = new Map()

walk(nodes, (node) => {
if (node.strokes?.length) {
if (Array.isArray(node.strokes) && node.strokes.length) {
const weight = node.strokeWeight || 1

node.strokes.forEach((stroke) => {
Expand Down
2 changes: 1 addition & 1 deletion theme/theme-radii-generator/src/strategy/Strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export abstract class Strategy {
stat.set(radius, (stat.get(radius) || 0) + 1)
}

if (node.rectangleCornerRadii) {
if (node.rectangleCornerRadii && Array.isArray(node.rectangleCornerRadii)) {
node.rectangleCornerRadii.forEach((radius) => {
const roundedRadius = Math.round(radius)
stat.set(roundedRadius, (stat.get(roundedRadius) || 0) + 1)
Expand Down

0 comments on commit ce49647

Please sign in to comment.