Skip to content

Add checks variable modifiers #662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 13, 2025
Merged

Add checks variable modifiers #662

merged 3 commits into from
Jan 13, 2025

Conversation

Stef-00012
Copy link
Contributor

@Stef-00012 Stef-00012 commented Jan 12, 2025

For numbers:

  • >X: Greater than X 1
  • >=X: Greater or equal to X 1
  • =X: Equal to X 1
  • <=X: Lesser or equal to X 1
  • <X: less than X 1

For strings:

  • =Y: Equals to Y 2
  • ~Y: Contains/Includes Y 2
  • $Y: Starts with Y 2
  • ^Y: Ends with Y 2
  • exists: If the string is not null or empty ""

For booleans:
istrue: Is true

they work like so
{type.prop::mod["true string"||"false string"]}

Example:
{file.maxViews::>0["{file.views}/{file.maxViews}"||""]}
This will return

  • <views>/<max_views> (eg. 2/7) when maxViews is greater than 0
  • Nothing when it's 0, less than 0 or null

Footnotes

  1. X is any number 2 3 4 5

  2. Y is any string 2 3 4

@diced diced merged commit 0464d0d into diced:v4 Jan 13, 2025
3 checks passed
@diced diced added the v4 v4 bugs label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v4 v4 bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants