Repository navigation
Add truncate, pluralize, list and rounding functions, and + for text - #10
Merged
Merged
Conversation
mierau
force-pushed
the
claude/project-thread-cj3hxv
branch
from
October 10, 2026 12:53
7185510 to
cd2ce25
Compare
…th +. New built-in functions: truncate, pluralize, sort, where, unique, first, last, count, round, floor, ceil and abs. + joins text when either side is text that isn't a number, so "Hi " + name works; numeric strings still add.
mierau
force-pushed
the
claude/project-thread-cj3hxv
branch
from
October 10, 2026 13:02
cd2ce25 to
e6073b5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: common jobs needed custom functions or
ifblocks. Truncating a bio meant registering a function, "1 comment / 3 comments" took a three-branchif, lists couldn't be sorted or filtered in a template, and"Hi " + namegave nothing because+only added numbers.After:
New functions:
truncate(n, ending)shortens text to at mostncharacters, including the ending ("…" by default).pluralize(singular, plural)gives the count with the right word.pluraldefaults to the singular plus "s".sort/sort(key)is stable and puts nil last.where(key, value)/where(key)filters a list, anduniqueremoves duplicates.first,lastandcountare now functions too, so they chain in a pipe..firstwithout parentheses is still a key lookup.round(places),floor,ceilandabs.How:
+joins text when either side is text that isn't a number, and nil joins as nothing. Two numeric strings still add as numbers, so"41" + 1stays 42.Generated by Claude Code