hotscript icon indicating copy to clipboard operation
hotscript copied to clipboard

Objects TerminalPaths

Open eloytoro opened this issue 2 years ago • 1 comments
trafficstars

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 avatar Mar 28 '23 07:03 eloytoro

I would rename DeepEntries to DeepPathEntries and FromDeepEntries to FromDeepPathEntries

iSplasher avatar Oct 12 '23 00:10 iSplasher