@absolutejs/absolute 0.19.0-beta.1070 → 0.19.0-beta.1072

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4557,6 +4557,59 @@ ${fields}
4557
4557
  deferSlots: inlinedTemplate.deferSlots,
4558
4558
  source: result
4559
4559
  };
4560
+ }, CLASS_KEYWORD = "class", isIdentifierChar = (char) => char !== undefined && /[A-Za-z0-9_$]/.test(char), skipStringLiteral = (source, start) => {
4561
+ const quote = source[start];
4562
+ let index = start + 1;
4563
+ while (index < source.length) {
4564
+ if (source[index] === "\\") {
4565
+ index += 2;
4566
+ continue;
4567
+ }
4568
+ if (source[index] === quote)
4569
+ return index + 1;
4570
+ index += 1;
4571
+ }
4572
+ return index;
4573
+ }, findDecoratedClassKeyword = (source, start) => {
4574
+ let index = start;
4575
+ let depth = 0;
4576
+ while (index < source.length) {
4577
+ const char = source[index];
4578
+ if (char === '"' || char === "'" || char === "`") {
4579
+ index = skipStringLiteral(source, index);
4580
+ continue;
4581
+ }
4582
+ const isOpen = char === "(" || char === "[" || char === "{";
4583
+ const isClose = char === ")" || char === "]" || char === "}";
4584
+ const atClass = depth === 0 && source.startsWith(CLASS_KEYWORD, index) && !isIdentifierChar(source[index - 1]) && !isIdentifierChar(source[index + CLASS_KEYWORD.length]);
4585
+ if (atClass)
4586
+ return index;
4587
+ if (isOpen)
4588
+ depth += 1;
4589
+ else if (isClose)
4590
+ depth -= 1;
4591
+ index += 1;
4592
+ }
4593
+ return -1;
4594
+ }, hoistExportPastDecorators = (source) => {
4595
+ const exportBeforeDecorator = /\bexport\s+(?=@)/g;
4596
+ let result = "";
4597
+ let lastIndex = 0;
4598
+ let match = exportBeforeDecorator.exec(source);
4599
+ while (match !== null) {
4600
+ const decoratorStart = match.index + match[0].length;
4601
+ const classIndex = findDecoratedClassKeyword(source, decoratorStart);
4602
+ if (classIndex !== -1) {
4603
+ result += source.slice(lastIndex, match.index);
4604
+ result += source.slice(decoratorStart, classIndex);
4605
+ result += `export ${CLASS_KEYWORD}`;
4606
+ lastIndex = classIndex + CLASS_KEYWORD.length;
4607
+ exportBeforeDecorator.lastIndex = lastIndex;
4608
+ }
4609
+ match = exportBeforeDecorator.exec(source);
4610
+ }
4611
+ result += source.slice(lastIndex);
4612
+ return result;
4560
4613
  }, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
4561
4614
  const entryPath = resolve7(inputPath);
4562
4615
  const allOutputs = [];
@@ -4621,7 +4674,7 @@ ${fields}
4621
4674
  return specifier.includes("?") ? `${specifier}&t=${cacheBuster}` : `${specifier}?t=${cacheBuster}`;
4622
4675
  };
4623
4676
  const transpileAndRewrite = (sourceCode, relativeDir, actualPath, importRewrites) => {
4624
- let processedContent = angularTranspiler.transformSync(sourceCode);
4677
+ let processedContent = angularTranspiler.transformSync(hoistExportPastDecorators(sourceCode));
4625
4678
  const outputPath = toOutputPath(actualPath);
4626
4679
  const rewriteBareImport = (prefix, specifier, suffix) => {
4627
4680
  const rewritten = importRewrites.get(specifier);
@@ -6354,5 +6407,5 @@ export {
6354
6407
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
6355
6408
  };
6356
6409
 
6357
- //# debugId=C8629B6F44372E1F64756E2164756E21
6410
+ //# debugId=53845EF8C006ECF964756E2164756E21
6358
6411
  //# sourceMappingURL=server.js.map