Skip to content

Conversation

eloytoro
Copy link
Contributor

Introduces a few nice functions

type res1 = Call<
  // ^? "object.nested" | "tuple[0]" | "tuple[1]"
  Objects.TerminalPaths,
  {
    object: {
      nested: boolean;
    };
    tuple: [0, 1];
>;
type res1 = Call<
  // ^? ["a", string] | ["b.c", number] | ["b.d[0].f", boolean]
  Objects.DeepEntries,
  { a: string; b: { c: number; d: [{ f: boolean }] } }
>;
type res1 = Call<
  // ^? { a: string; b: { c: number } & { d: { 0: { f: boolean } } } }
  Objects.FromDeepEntries,
  ["a", string] | ["b.c", number] | ["b.d[0].f", boolean]
>;

@eloytoro eloytoro force-pushed the eloytoro/terminal-paths branch from 5d69b92 to f31599b Compare April 5, 2023 14:43
@iSplasher
Copy link

I would rename DeepEntries to DeepPathEntries and FromDeepEntries to FromDeepPathEntries

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