Skip to content

How to create object from Path? #236

Answered by nucleartux
nucleartux asked this question in Q&A
Discussion options

You must be logged in to vote

Solution:

type ObjFromPath<F, O, P extends L.List, I extends I.Iteration = I.IterationOf<0>> = {
  0: O.Record<P[I.Pos<I>], ObjP< F, O, P, I.Next<I>>>,
  1: O
}[t.A.Extends<I.Pos<I>, L.Length<P>>]; 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nucleartux
Comment options

Answer selected by nucleartux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant