Skip to content

Commit

Permalink
Pass prototype to toAttribute method.
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed Jun 6, 2024
1 parent 9674143 commit aa9d45f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/modern-doors-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@chialab/storybook-dna": patch
---

Pass prototype to `toAttribute` method.
6 changes: 5 additions & 1 deletion packages/storybook-dna/src/docs/sourceDecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ function vnodeToString(vnode: Template): string {
return false;
}

value = (definedProperty?.toAttribute as any)?.(value) ?? value;
value =
(definedProperty?.toAttribute as any)?.call(

Check warning on line 184 in packages/storybook-dna/src/docs/sourceDecorator.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
(constructor as CustomElementConstructor).prototype,
value
) ?? value;
prop = definedProperty?.attribute ?? prop;

if (value == null || value === false) {
Expand Down

0 comments on commit aa9d45f

Please sign in to comment.