github TomWright/dasel v3.5.0

latest releases: v3.8.0, v3.7.0, v3.6.0...
10 hours ago

v3.5.0

A big release packed with new built-in functions, array expressions, and the ternary operator.

Highlights

  • Ternary operator — inline conditionals with condition ? then : else
  • 22 new functions and expressions covering strings, math, arrays, maps, and type conversion
  • Bug fixes for non-base10 number parsing and XML round-trip ordering

New Functions

Strings

  • split(separator) — split a string into an array
  • toLower() / toUpper() — case conversion
  • trim() / trimPrefix(prefix) / trimSuffix(suffix) — whitespace and affix trimming
  • startsWith(prefix) / endsWith(suffix) — prefix/suffix checks
  • indexOf(substring) — find substring position (-1 if not found)

Math

  • abs() — absolute value
  • floor() / ceil() / round() — rounding
  • avg(...) — average of numbers

Arrays

  • flatten() — flatten nested arrays by one level
  • unique() — remove duplicates
  • first() / last() — first/last element

Maps

  • values() — map values as an array
  • entries() / fromEntries() — convert between maps and {key, value} arrays

Type Conversion

  • toBool() — convert a value to boolean
  • stringify(format) — serialize a value to a format string (inverse of parse)

New Expressions

  • any(predicate) — true if any array element matches
  • all(predicate) — true if all array elements match
  • count(predicate) — count matching array elements

Ternary Operator

A compact alternative to if/else blocks:

age >= 18 ? "adult" : "minor"

Supports nesting with parentheses, all comparison/logical operators, and works inside map(), filter(), etc.

Bug Fixes

  • Fixed YAML and TOML parsers failing on non-base10 numbers (hex, binary, octal)
  • Fixed toInt failing on non-base10 numbers
  • Improved XML child element ordering for round-trip handling (thanks @takeokunn)

Full Changelog: v3.4.1...v3.5.0

Don't miss a new dasel release

NewReleases is sending notifications on new releases.