Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jasonkuhrt
Copy link
Owner

Summary

  • Add expression compiler (type-level and runtime) for lens expressions
  • Support property access (.name), bracket notation (['key']), tuple ([N])
  • Support type-level-only syntax: array ([]), indexed (:), awaited (#), returned (>), parameters (())
  • Add Lens.get (uncurried), Lens.getWith (curried), Lens.getOn (inverse curried)
  • Remove Obj.getWith, Obj.getOn, Obj.path in favor of Lens equivalents
  • Migrate str/template.ts to use Lens.getOn

Examples

// Property access
Lens.get('.user.address.city', data)  // typed result

// Curried for pipelines
users.map(Lens.getWith('.name'))

// Inverse curried for multiple extractions
const fromUser = Lens.getOn(user)
fromUser('.name')
fromUser('.address.city')

// Type-level only
type T = Lens.Get<'.items[]', { items: number[] }>  // number
type T = Lens.Get<'.data:', { data: Record<string, number> }>  // number

BREAKING CHANGE

Removed Obj.getWith, Obj.getOn and Obj.path exports - use Lens.get/Lens.getWith/Lens.getOn instead.

Test plan

  • Type checking passes
  • All 2956 tests pass
  • Lens module tests cover all expression syntax

@netlify
Copy link

netlify bot commented Nov 24, 2025

Deploy Preview for wollybeard-kit canceled.

Name Link
🔨 Latest commit 12b15a0
🔍 Latest deploy log https://app.netlify.com/projects/wollybeard-kit/deploys/6923e30bcc05a000089b11a7

- Add expression compiler (type-level and runtime) for lens expressions
- Support property access (.name), bracket notation (['key']), tuple ([N])
- Support type-level-only syntax: array ([]), indexed (:), awaited (#), returned (>), parameters (())
- Add Lens.get (uncurried), Lens.getWith (curried), Lens.getOn (inverse curried)
- Remove Obj.getWith, Obj.getOn, Obj.path in favor of Lens equivalents
- Migrate str/template.ts to use Lens.getOn

BREAKING CHANGE: Removed Obj.getWith, Obj.getOn and Obj.path exports
@jasonkuhrt jasonkuhrt force-pushed the feat/86-feat-lens-expressions-with-jso branch from 7e01d61 to 12b15a0 Compare November 24, 2025 04:46
@jasonkuhrt jasonkuhrt merged commit af5170d into main Nov 24, 2025
11 checks passed
@jasonkuhrt jasonkuhrt deleted the feat/86-feat-lens-expressions-with-jso branch November 24, 2025 04:53
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