All files types.js

100% Statements 280/280
97.74% Branches 130/133
100% Functions 72/72
100% Lines 260/260

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 7311x 1x   87x 1x 959x   1x   1x 317x 10x 307x     1x 133x 4x 2x           2x 1x               1x                                                         129x     1x   688x     102x               6x     6x 1x 6x           6x 6x     50x 50x 54x 54x 50x 50x   50x 4x                   46x   50x               50x 26x 26x 9x 26x               50x 50x 4x 50x     119x 36x 36x   83x 83x 114x 114x 83x           83x 9x 9x 4x 9x               83x 104x 83x   6x     41x 41x               59x     14x   14x     14x     14x 14x     35x 35x 35x   4x     35x 4x 4x 4x 4x 31x 2x 1x 2x 2x   35x         35x 35x             35x 35x     28x 28x 28x                                     28x                         28x 28x 28x 28x     4x 4x           4x 4x     1x 1x           1x 1x             8x 8x           8x     8x   8x 4x           4x 4x                         8x 4x   4x   4x 9x 5x 4x 2x               2x           4x 4x           8x     10x 10x 10x 10x 198x 12x 12x     10x 10x                       58x 58x           19x 19x 19x 19x                       19x 19x 1x 1x               1x   19x 19x 19x 19x     8x 8x           8x 8x     4x 4x         5x                         4x 4x 5x 4x     11x 11x 11x                 11x 11x     5x 5x 5x                     5x 5x     6x 6x           6x 6x     5x 5x 5x 5x 1x 5x     6x 6x 6x 6x         6x     4x 6x     25x 25x         25x 67x   25x 1x     67x 25x     16x 16x 16x     21x       21x 21x     12x           16x 12x     32x             12x 12x 12x 12x 12x                   12x   12x     9x 9x     1x     1x 1x               1x 1x     3x 3x                   6x 3x     50x 44x 2x 44x 44x         44x 44x 44x     7x 7x             7x 7x 7x     11x             11x           11x 11x 11x     25x               4x                 14x 14x 14x     19x             15x     1x 1x     140x 147x     140x 140x               1x 1705x     1x 1x 1x  
const { mapfn, map } = require("../../index");
const { SourceNode } = require("source-map");
 
const join = (arr, sep) => new SourceNode(null, null, null, arr).join(sep);
const asIs = (token) =>
  new SourceNode(token.line, token.column, token.file, token.value);
 
const conditionals = ["fullConditional", "conditional"];
 
const checkLambda = (node, body, getValue) => {
  if (node.lambda?.length)
    return get({ type: "lambda", body, params: node.lambda });
  return getValue ? get(node) : node;
};
 
const getCallFn = (node) => {
  if (node.fn.type == "method") {
    if (!node.isMap)
      return {
        type: "propertyAccess",
        lhs: node.args.shift(),
        dot: node.fn.dot,
        rhs: node.fn.property,
      };
    if (node.args.length > 1)
      return {
        type: "propertyAccess",
        lhs: { type: "symbol", value: "$item" },
        dot: node.fn.dot,
        rhs: node.fn.property,
        dropData: true,
        dropMeta: true,
      };
    return {
      type: "wrapped",
      start: { value: "(" },
      end: { value: ")" },
      content: {
        type: "function",
        start: node.fn,
        noParallel: true,
        name: "",
        needsAsync: node.needsAsync,
        params: [get({ type: "symbol", value: "$item" })],
        body: get({
          type: "return",
          content: [
            {
              type: "call",
              fn: {
                type: "propertyAccess",
                lhs: { type: "symbol", value: "$item" },
                dot: node.fn.dot,
                rhs: node.fn.property,
              },
              args: [],
            },
          ],
        }),
      },
    };
  }
  return node.fn;
};
 
const types = {
  symbol(node) {
    return asIs(node);
  },
  number(node) {
    return new SourceNode(
      node.line,
      node.column,
      node.file,
      node.value.replace(/_/g, "")
    );
  },
  awaited(node) {
    const value = node.all
      ? ["Promise.all(", get(node.value), ")"]
      : [get(node.value)];
    if (node.await.value.startsWith("["))
      node.await.value = node.await.value.slice(1, -1);
    const sn = new SourceNode(
      node.await.line,
      node.await.column,
      node.await.file,
      ["(", asIs(node.await), " ", ...value, ")"]
    );
    sn.needsAsync = true;
    return sn;
  },
  mapCall(node) {
    const { awaited, all } = node;
    const fn = getCallFn(node);
    const args = node.args.map((arg) => checkLambda(arg, get(arg), true));
    const insertBefore = args.map((arg) => arg.insertBefore).filter(Boolean);
    const data = args.shift();
    const needsAsync = data.needsAsync || args.some((arg) => arg.needsAsync);
    let func;
    if (args.length) {
      func = new SourceNode(null, null, null, [
        needsAsync ? "async " : "",
        "($item",
        fn.dropMeta ? ")=>" : ", $index, $iterator)=>",
        checkLambda(fn, get(fn), true),
        fn.dropData ? "(" : "($item,",
        join(args, ","),
        fn.dropMeta ? ")" : ",$index,$iterator)",
      ]);
    } else {
      func = checkLambda(fn, get(fn), true);
    }
    let sn = new SourceNode(fn.line, fn.column, fn.file, [
      data,
      ".",
      "map",
      "(",
      func,
      ")",
    ]);
    if (awaited) {
      const value = all ? ["Promise.all(", sn, ")"] : [sn];
      if (node.await.value.startsWith("["))
        node.await.value = node.await.value.slice(1, -1);
      sn = new SourceNode(node.await.line, node.await.column, node.await.file, [
        "(",
        asIs(node.await),
        " ",
        ...value,
        ")",
      ]);
    }
    if (insertBefore.length) sn.insertBefore = insertBefore;
    sn.needsAsync =
      awaited || data.needsAsync || args.some((arg) => arg.needsAsync);
    return sn;
  },
  call(node) {
    if (node.isMap) {
      node.type = "mapCall";
      return get(node);
    }
    const { awaited, all } = node;
    const fn = getCallFn(node);
    const args = node.args.map((arg) => checkLambda(arg, get(arg), true));
    const insertBefore = args.map((arg) => arg.insertBefore).filter(Boolean);
    let sn = new SourceNode(fn.line, fn.column, fn.file, [
      checkLambda(fn, get(fn), true),
      "(",
      join(args, ","),
      ")",
    ]);
    if (awaited) {
      const value = all ? ["Promise.all(", sn, ")"] : [sn];
      if (node.await.value.startsWith("["))
        node.await.value = node.await.value.slice(1, -1);
      sn = new SourceNode(node.await.line, node.await.column, node.await.file, [
        "(",
        asIs(node.await),
        " ",
        ...value,
        ")",
      ]);
    }
    if (insertBefore.length) sn.insertBefore = insertBefore;
    sn.needsAsync = awaited || args.some((arg) => arg.needsAsync);
    return sn;
  },
  ...mapfn(["add", "mul", "div", "sub", "mod", "pow"], (key) => [
    key,
    (node) => {
      const { op, lhs, rhs } = node;
      return new SourceNode(null, null, null, [
        lhs,
        new SourceNode(op.line, op.column, op.file, op.value),
        rhs,
      ]);
    },
  ]),
  math(node) {
    return node.value;
  },
  block(node) {
    const content = node.content
      .map(get)
      .map((node) => [node.insertBefore, node])
      .flat()
      .filter(Boolean);
    const sn = new SourceNode(null, null, null, [
      new SourceNode(null, null, null, content).join(";"),
    ]);
    sn.needsAsync = content.some((item) => item.needsAsync);
    return sn;
  },
  return(node) {
    let lastNode = node.content.pop();
    let addReturn = true;
    const content = node.content
      .map(get)
      .map((node) => [node.insertBefore, node])
      .flat()
      .filter(Boolean);
    if (conditionals.includes(lastNode.type)) {
      lastNode.if.body.type = "return";
      lastNode.elseIfs.map((elseIf) => (elseIf.body.type = "return"));
      if (lastNode.else) lastNode.else.body.type = "return";
      addReturn = false;
    } else if (lastNode.type == "assignment") {
      if (lastNode.value.insertBefore)
        content.push(lastNode.value.insertBefore);
      content.push(get(lastNode));
      lastNode = lastNode.name;
    }
    let last = lastNode.type
      ? lastNode.lambda?.length
        ? checkLambda(lastNode, get(lastNode))
        : get(lastNode)
      : lastNode;
    if (last.returnAs) last = last.returnAs;
    const sn = new SourceNode(null, null, null, [
      new SourceNode(null, null, null, content).join(";"),
      ...(content.length ? [";"] : []),
      ...(last.insertBefore ? [last.insertBefore, ";"] : []),
      ...(addReturn ? ["return "] : []),
      last,
    ]);
    sn.needsAsync = last.needsAsync || content.some((item) => item.needsAsync);
    return sn;
  },
  function(node) {
    const { start, name, params, body } = node;
    const man = node.man ? [`;`, name, ".__man__=`", asIs(node.man), "`"] : [];
    const parallel = node.noParallel
      ? []
      : [
          ";",
          "distributed.set(`",
          start.file,
          "/",
          name,
          "`,",
          name,
          ")",
          ";",
          name,
          ".parallel=distributed.get(`",
          start.file,
          "/",
          name,
          "`)",
        ];
    const sn = new SourceNode(start.line, start.column, start.file, [
      ...(name ? ["const ", name, "="] : []),
      "tco(",
      node.body.needsAsync ? "async" : "",
      "(",
      new SourceNode(null, null, null, params).join(","),
      ")=>",
      "{",
      body,
      "})",
      ...man,
      ...parallel,
    ]);
    sn.needsAsync = false;
    sn.returnAs = new SourceNode(null, null, null, name);
    sn.returnAs.insertBefore = sn;
    return sn;
  },
  exportedFunction(node) {
    const fn = get(node.value);
    const sn = new SourceNode(
      node.export.line,
      node.export.column,
      node.export.file,
      ["clio.exports.", node.name, "=", node.name]
    );
    sn.insertBefore = [fn.insertBefore, fn].filter(Boolean);
    return sn;
  },
  exported(node) {
    const value = get(node.value);
    const sn = new SourceNode(
      node.export.line,
      node.export.column,
      node.export.file,
      ["clio.exports.", node.name, "=", node.name]
    );
    sn.insertBefore = [value.insertBefore, value].filter(Boolean);
    return sn;
  },
  imported(node) {
    /* each import has 2 parts:
        1. import
        2. assign
    */
    const path = node.path.value.slice(1, -1).replace(/^[^:]*:/, "");
    const name = path
      .replace(/\.[^.]*$/, "")
      .split("/")
      .pop()
      .split(".")
      .filter(Boolean)
      .map((v, i) => (i > 0 ? v[0].toUpperCase() + v.slice(1) : v))
      .join("");
    const protocol =
      node.path.value.slice(1, -1).match(/^[^:]*(?=:)/)?.[0] || "clio";
    let require;
    if (protocol == "js") {
      require = new SourceNode(
        node.import.line,
        node.import.column,
        node.import.file,
        ["require(", '"', path, '")']
      );
    } else Eif (protocol == "clio") {
      require = new SourceNode(
        node.import.line,
        node.import.column,
        node.import.file,
        [
          "await require(",
          '"',
          path + (path.endsWith(".clio") ? ".js" : ".clio.js"),
          '").exports(clio)',
        ]
      );
    }
    let assign;
    if (!node.items) {
      assign = new SourceNode(null, null, null, ["const ", name, "="]);
    } else {
      let parts = [];
      let rest;
      for (const part of node.items) {
        if (part.type == "symbol") {
          parts.push(get(part));
        } else if (part.lhs.type == "symbol") {
          parts.push(
            new SourceNode(part.as.line, part.as.column, part.as.file, [
              get(part.lhs),
              ":",
              get(part.rhs),
            ])
          );
        } else {
          rest = new SourceNode(part.as.line, part.as.column, part.as.file, [
            "...",
            get(part.rhs),
          ]);
        }
      }
      if (rest) parts.push(rest);
      assign = new SourceNode(null, null, null, [
        "const{",
        new SourceNode(null, null, null, parts).join(","),
        "}=",
      ]);
    }
    return new SourceNode(null, null, null, [assign, require]);
  },
  lambda(node) {
    const { body } = node;
    const params = [];
    const added = new Set();
    for (const param of node.params) {
      if (!added.has(param.value)) {
        added.add(param.value);
        params.push(get(param));
      }
    }
    const start = node.params[0];
    return new SourceNode(start.line, start.column, start.file, [
      "(",
      body.needsAsync ? "async " : "",
      "(",
      new SourceNode(null, null, null, params).join(","),
      ")",
      "=>",
      body,
      ")",
    ]);
  },
  parallelFn(node) {
    const { start, fn } = node;
    return new SourceNode(start.line, start.column, start.file, [
      fn,
      ".parallel",
    ]);
  },
  comparison(node) {
    const nodes = [];
    const first = node.comparisons.shift();
    let needsAsync = node.lhs.needsAsync;
    nodes.push(
      "(",
      node.lhs,
      new SourceNode(
        first.op.line,
        first.op.column,
        first.op.file,
        first.op.value
      ),
      first.rhs,
      ")"
    );
    let lhs = first.rhs;
    for (const { op, rhs } of node.comparisons) {
      needsAsync = needsAsync || lhs.needsAsync;
      nodes.push(
        "&&",
        "(",
        lhs,
        new SourceNode(op.line, op.column, op.file, op.value),
        rhs,
        ")"
      );
      lhs = rhs;
    }
    const sn = new SourceNode(null, null, null, nodes);
    sn.needsAsync = needsAsync;
    sn.lambda = node.lambda;
    return sn;
  },
  logicalNot(node) {
    const { rhs, op } = node;
    const sn = new SourceNode(op.line, op.column, op.file, [
      new SourceNode(op.line, op.column, op.file, "!"),
      "(",
      rhs,
      ")",
    ]);
    sn.needsAsync = rhs.needsAsync;
    return sn;
  },
  logical(node) {
    const { lhs, logicals } = node;
    const parts = [
      "(",
      lhs,
      ")",
      ...logicals
        .map(({ op, rhs }) => [
          new SourceNode(
            op.line,
            op.column,
            op.file,
            op.value == "and" ? "&&" : "||"
          ),
          "(",
          rhs,
          ")",
        ])
        .flat(),
    ];
    const sn = new SourceNode(null, null, null, parts);
    sn.needsAsync =
      lhs.needsAsync || logicals.some(({ rhs }) => rhs.needsAsync);
    return sn;
  },
  ifBlock(node) {
    const { start, condition } = node;
    const body = get(node.body);
    const sn = new SourceNode(null, null, null, [
      asIs(start),
      "(",
      condition,
      ")",
      "{",
      body,
      "}",
    ]);
    sn.needsAsync = body.needsAsync;
    return sn;
  },
  elseIfBlock(node) {
    const { start, condition } = node;
    const body = get(node.body);
    const sn = new SourceNode(null, null, null, [
      asIs(start),
      " ",
      asIs(node.if),
      "(",
      condition,
      ")",
      "{",
      body,
      "}",
    ]);
    sn.needsAsync = body.needsAsync;
    return sn;
  },
  elseBlock(node) {
    const body = get(node.body);
    const sn = new SourceNode(null, null, null, [
      asIs(node.start),
      "{",
      body,
      "}",
    ]);
    sn.needsAsync = body.needsAsync;
    return sn;
  },
  conditional(node) {
    const ifBlock = get(node.if);
    const elseIfBlocks = node.elseIfs.map(get);
    const sn = new SourceNode(null, null, null, [ifBlock, ...elseIfBlocks]);
    sn.needsAsync =
      ifBlock.needsAsync || elseIfBlocks.some((block) => block.needsAsync);
    return sn;
  },
  fullConditional(node) {
    const ifBlock = get(node.if);
    const elseIfBlocks = node.elseIfs.map(get);
    const elseBlock = get(node.else);
    const sn = new SourceNode(null, null, null, [
      ifBlock,
      ...elseIfBlocks,
      elseBlock,
    ]);
    sn.needsAsync =
      ifBlock.needsAsync ||
      elseBlock.needsAsync ||
      elseIfBlocks.some((block) => block.needsAsync);
    return sn;
  },
  array(node) {
    const { start, end, items } = node;
    const sn = new SourceNode(null, null, null, [
      asIs(start),
      new SourceNode(null, null, null, items).join(","),
      asIs(end),
    ]);
    const insertBefores = items
      .map((item) => item.insertBefore)
      .filter(Boolean);
    if (insertBefores.length)
      sn.insertBefore = new SourceNode(null, null, null, insertBefores).join(
        ";"
      );
    sn.needsAsync = items.some((item) => item.needsAsync);
    return sn;
  },
  keyValue(node) {
    const sn = new SourceNode(null, null, null, [node.key, ":", node.value]);
    sn.needsAsync = node.value.needsAsync;
    return sn;
  },
  string(node) {
    node.value = node.value
      .slice(1, -1)
      .replace(/`/g, "\\`")
      .replace(/\\"/, '"');
    node.value = "`" + node.value + "`";
    return asIs(node);
  },
  hashmap(node) {
    const sn = new SourceNode(
      node.start.line,
      node.start.column,
      node.start.file,
      ["{", new SourceNode(null, null, null, node.keyValues).join(","), "}"]
    );
    sn.needsAsync = node.keyValues.some((kv) => kv.needsAsync);
    return sn;
  },
  propertyAccess(node) {
    return new SourceNode(null, null, null, [
      get(node.lhs),
      asIs(node.dot),
      get(node.rhs),
    ]);
  },
  range(node) {
    const start = node.start || "0";
    const end = node.end || "Inf";
    const step = node.step || "null";
    const { location } = node;
    const sn = new SourceNode(location.line, location.column, location.file, [
      "range",
      "(",
      start,
      ",",
      end,
      ",",
      step,
      ")",
    ]);
    sn.needsAsync =
      node.start?.needsAsync || node.end?.needsAsync || node.step?.needsAsync;
    return sn;
  },
  ...map(["rangeFull", "byRange", "rangeBy"], (node) => {
    node.type = "range";
    return get(node);
  }),
  ranger(node) {
    return get({ type: "range", location: node });
  },
  slice(node) {
    const { slicer, slicee } = node;
    const sn = new SourceNode(null, null, null, [
      "slice",
      "(",
      slicee,
      ",",
      slicer,
      ")",
    ]);
    sn.needsAsync = slicer.needsAsync || slicee.needsAsync;
    return sn;
  },
  set(node) {
    const { start, items } = node;
    const sn = new SourceNode(start.line, start.column, start.file, [
      "new",
      " ",
      "Set",
      "(",
      "[",
      new SourceNode(null, null, null, items).join(","),
      "]",
      ")",
    ]);
    sn.needsAsync = items.some((item) => item.needsAsync);
    return sn;
  },
  wrapped(node) {
    if (!node.content) return new SourceNode(null, null, null, "");
    if (node.isFn && node.content.type == "call")
      node.content.args.map((arg) => (arg.lambda = []));
    const content = get(node.content);
    const sn = new SourceNode(null, null, null, [
      asIs(node.start),
      content,
      asIs(node.end),
    ]);
    sn.insertBefore = content.insertBefore;
    sn.needsAsync = content.needsAsync;
    return sn;
  },
  assignment(node) {
    const value = checkLambda(node.value, node.value);
    const sn = new SourceNode(null, null, null, [
      "const",
      " ",
      node.name,
      asIs(node.assign),
      value,
    ]);
    sn.insertBefore = node.value.insertBefore;
    sn.needsAsync = value.needsAsync;
    return sn;
  },
  arrowAssignment(node) {
    const insertBefore = new SourceNode(null, null, null, [
      "const",
      " ",
      node.name,
      new SourceNode(node.arrow.line, node.arrow.column, node.arrow.file, "="),
      node.value,
    ]);
    const insertBefores = new SourceNode(
      null,
      null,
      null,
      [node.value.insertBefore, insertBefore].filter(Boolean)
    ).join(";");
    node.name.insertBefore = insertBefores;
    node.name.needsAsync = node.value.needsAsync;
    return node.name;
  },
  parameter(node) {
    return new SourceNode(
      node.line,
      node.column,
      node.file,
      node.value.slice(1)
    );
  },
  inCheck(node) {
    return new SourceNode(node.start.line, node.start.column, node.start.file, [
      "inCheck(",
      get(node.lhs),
      ",",
      get(node.rhs),
      ")",
    ]);
  },
  formattedString(node) {
    const fn = get(node.fn);
    const args = new SourceNode(null, null, null, node.args.map(get));
    return new SourceNode(null, null, null, [fn, "(", args.join(","), ")"]);
  },
  fmtStr(node) {
    return new SourceNode(node.line, node.column, node.file, [
      "`",
      node.value,
      "`",
    ]);
  },
  fmtExpr(node) {
    return node.content || "undefined";
  },
  strEscape(node) {
    node.value = node.value.slice(1);
    return new SourceNode(null, null, null, ["`", asIs(node), "`"]);
  },
  clio(node) {
    const content = node.content
      .map((node) => [node.insertBefore, node])
      .flat()
      .filter(Boolean);
    const inner = new SourceNode(null, null, null, content).join(";");
    return new SourceNode(null, null, null, [
      "module.exports.exports=async(clio)=>{const{tco,range,man,inCheck,slice,f,distributed}=clio;",
      inner,
      ";return clio.exports}",
    ]);
  },
};
 
const get = (node) => {
  return types[node.type](node);
};
 
module.exports.checkLambda = checkLambda;
module.exports.types = types;
module.exports.get = get;