Skip to content

[LiquidDoc] Add union types #1962

@andershagbard

Description

@andershagbard

Add the possibility to add union types for LiquidDocs.

E.g.

@param {string|number} my_variable - This can be a string or a number.

Use cases:

  • When passing an image aspect attribute, you can manually enter the numeric value as 0.5 or you can enter a string as 1/2, and then have the snippet to the math for you.

  • To be a bit more lax. When passing a width attribute and appending %. E.g. {{ width | append: '%' }}, you wouldn't care if it's a number or a string.

@karreiro (Tagging for visibility)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions