Skip to content

Conversation

@joente
Copy link
Member

@joente joente commented Oct 24, 2025

Description

We introduced a flag which can skip values when equal to nil. In some cases, it is useful to exclude values when they
just evaluate to false to be even more clean. For example:

set_type('T', {
    name: 'str',
    canBike: '!bool',
});
T{name: 'Alice', canBike: false}.wrap(); 

The above will return

{
   "name": "Alice"
}

As we wrap() and the wrap-prefix flag ! tells to exclude the properties which evaluate to false.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Update Test Wrap

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes

@joente joente self-assigned this Oct 24, 2025
@joente joente merged commit f5f8cc6 into main Oct 24, 2025
1 check passed
@joente joente deleted the skip_false branch October 25, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants