Skip to content
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

feat(core): add typeof filter #317

Merged
merged 1 commit into from
Oct 17, 2023
Merged

feat(core): add typeof filter #317

merged 1 commit into from
Oct 17, 2023

Conversation

JSYOU
Copy link
Contributor

@JSYOU JSYOU commented Oct 16, 2023

Description

This pull request introduces a new filter called typeof that allows retrieving the type of a variable in templates.
For example, you can now use
{% if context.params.foo|typeof == 'string' %}
to conditionally execute code based on the type of the foo variable.

Issue ticket number

n/a

Additional Context

@vercel
Copy link

vercel bot commented Oct 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
vulcan-sql-document ✅ Ready (Inspect) Visit Preview Oct 16, 2023 4:21pm

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Files Coverage Δ
...ate-engine/built-in-extensions/sql-helper/index.ts 100.00% <100.00%> (ø)
...ne/built-in-extensions/sql-helper/typeofBuilder.ts 100.00% <100.00%> (ø)
...ine/built-in-extensions/sql-helper/typeofRunner.ts 75.00% <75.00%> (ø)

... and 1 file with indirect coverage changes

📢 Thoughts on this report? Let us know!.

Copy link
Contributor

@kokokuo kokokuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@kokokuo
Copy link
Contributor

kokokuo commented Oct 17, 2023

Remember to add the document to VulcanSQL official document in the future, cc @wwwy3y3, @onlyjackfrost, @cyyeh to know Star add the new filter for checking type.

@kokokuo kokokuo merged commit 10ca6f7 into develop Oct 17, 2023
@kokokuo kokokuo deleted the feature/filter-typeof branch October 17, 2023 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants