Skip to content

Add ToLower, Trim, ToDecimal transforms and AddJsonTransform DI convenience method#20

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/propose-new-features-or-improvements
Draft

Add ToLower, Trim, ToDecimal transforms and AddJsonTransform DI convenience method#20
Copilot wants to merge 2 commits into
mainfrom
copilot/propose-new-features-or-improvements

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 21, 2026

JSLTSharp lacked several common string/numeric transforms and required two separate DI registration calls to wire up the engine.

New built-in transformation operations

  • ToLower — lower-cases a string field (complement to ToUpper)
  • Trim — strips leading/trailing whitespace from a string field
  • ToDecimal — converts string, integer, float, or boolean to decimal; returns null on unconvertible input (complement to ToInteger)

All three are registered automatically via the existing RegisterJsonCustomTransformFunctions().

Simplified DI registration

New AddJsonTransform() extension method collapses the previous two-step setup into one:

// Before
services.RegisterJsonCustomTransformFunctions();
services.AddSingleton<JsonTransform>();

// After
services.AddJsonTransform();

Usage examples

{ "normalized": "$.rawField->Trim()->ToLower()" }
{ "price":      "$.rawPrice->ToDecimal()" }

Copilot AI changed the title [WIP] Propose new features or improvements for developers Add ToLower, Trim, ToDecimal transforms and AddJsonTransform DI convenience method Apr 21, 2026
Copilot AI requested a review from mathieumack April 21, 2026 22:14
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.

Propose New Features or Improvements to Benefit Developers

2 participants