@lwc/template-compiler 8.13.1 → 8.13.3

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.
package/dist/index.cjs.js CHANGED
@@ -672,7 +672,7 @@ const decodeMap = new Map([
672
672
  */
673
673
  const fromCodePoint =
674
674
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
675
- (_a = String.fromCodePoint) !== null && _a !== undefined ? _a : function (codePoint) {
675
+ (_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) {
676
676
  let output = "";
677
677
  if (codePoint > 0xffff) {
678
678
  codePoint -= 0x10000;
@@ -692,7 +692,7 @@ function replaceCodePoint(codePoint) {
692
692
  if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
693
693
  return 0xfffd;
694
694
  }
695
- return (_a = decodeMap.get(codePoint)) !== null && _a !== undefined ? _a : codePoint;
695
+ return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;
696
696
  }
697
697
 
698
698
  var CharCodes;
@@ -936,7 +936,7 @@ class EntityDecoder {
936
936
  var _a;
937
937
  // Ensure we consumed at least one digit.
938
938
  if (this.consumed <= expectedLength) {
939
- (_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
939
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
940
940
  return 0;
941
941
  }
942
942
  // Figure out if this is a legit end of the entity
@@ -1011,7 +1011,7 @@ class EntityDecoder {
1011
1011
  const { result, decodeTree } = this;
1012
1012
  const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
1013
1013
  this.emitNamedEntityData(result, valueLength, this.consumed);
1014
- (_a = this.errors) === null || _a === undefined ? undefined : _a.missingSemicolonAfterCharacterReference();
1014
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();
1015
1015
  return this.consumed;
1016
1016
  }
1017
1017
  /**
@@ -1060,7 +1060,7 @@ class EntityDecoder {
1060
1060
  return this.emitNumericEntity(0, 3);
1061
1061
  }
1062
1062
  case EntityDecoderState.NumericStart: {
1063
- (_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
1063
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
1064
1064
  return 0;
1065
1065
  }
1066
1066
  case EntityDecoderState.EntityStart: {
@@ -1565,7 +1565,7 @@ const TAG_NAME_TO_ID = new Map([
1565
1565
  ]);
1566
1566
  function getTagID(tagName) {
1567
1567
  var _a;
1568
- return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !== undefined ? _a : TAG_ID.UNKNOWN;
1568
+ return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !== void 0 ? _a : TAG_ID.UNKNOWN;
1569
1569
  }
1570
1570
  const $ = TAG_ID;
1571
1571
  const SPECIAL_ELEMENTS = {
@@ -1851,7 +1851,7 @@ class Tokenizer {
1851
1851
  //Errors
1852
1852
  _err(code, cpOffset = 0) {
1853
1853
  var _a, _b;
1854
- (_b = (_a = this.handler).onParseError) === null || _b === undefined ? undefined : _b.call(_a, this.preprocessor.getError(code, cpOffset));
1854
+ (_b = (_a = this.handler).onParseError) === null || _b === void 0 ? void 0 : _b.call(_a, this.preprocessor.getError(code, cpOffset));
1855
1855
  }
1856
1856
  // NOTE: `offset` may never run across line boundaries.
1857
1857
  getCurrentLocation(offset) {
@@ -1894,7 +1894,7 @@ class Tokenizer {
1894
1894
  return;
1895
1895
  this._runParsingLoop();
1896
1896
  if (!this.paused) {
1897
- writeCallback === null || writeCallback === undefined ? undefined : writeCallback();
1897
+ writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback();
1898
1898
  }
1899
1899
  }
1900
1900
  write(chunk, isLastChunk, writeCallback) {
@@ -1902,7 +1902,7 @@ class Tokenizer {
1902
1902
  this.preprocessor.write(chunk, isLastChunk);
1903
1903
  this._runParsingLoop();
1904
1904
  if (!this.paused) {
1905
- writeCallback === null || writeCallback === undefined ? undefined : writeCallback();
1905
+ writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback();
1906
1906
  }
1907
1907
  }
1908
1908
  insertHtmlAtCurrentPos(chunk) {
@@ -2001,7 +2001,7 @@ class Tokenizer {
2001
2001
  if (getTokenAttr(token, this.currentAttr.name) === null) {
2002
2002
  token.attrs.push(this.currentAttr);
2003
2003
  if (token.location && this.currentLocation) {
2004
- const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !== undefined ? _a : (_b.attrs = Object.create(null)));
2004
+ const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !== void 0 ? _a : (_b.attrs = Object.create(null)));
2005
2005
  attrLocations[this.currentAttr.name] = this.currentLocation;
2006
2006
  // Set end location
2007
2007
  this._leaveAttrValue();
@@ -5414,11 +5414,11 @@ class Parser {
5414
5414
  if (this.onParseError) {
5415
5415
  this.options.sourceCodeLocationInfo = true;
5416
5416
  }
5417
- this.document = document !== null && document !== undefined ? document : this.treeAdapter.createDocument();
5417
+ this.document = document !== null && document !== void 0 ? document : this.treeAdapter.createDocument();
5418
5418
  this.tokenizer = new Tokenizer(this.options, this);
5419
5419
  this.activeFormattingElements = new FormattingElementList(this.treeAdapter);
5420
5420
  this.fragmentContextID = fragmentContext ? getTagID(this.treeAdapter.getTagName(fragmentContext)) : TAG_ID.UNKNOWN;
5421
- this._setContextModes(fragmentContext !== null && fragmentContext !== undefined ? fragmentContext : this.document, this.fragmentContextID);
5421
+ this._setContextModes(fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : this.document, this.fragmentContextID);
5422
5422
  this.openElements = new OpenElementStack(this.document, this.treeAdapter, this);
5423
5423
  }
5424
5424
  // API
@@ -5434,7 +5434,7 @@ class Parser {
5434
5434
  };
5435
5435
  //NOTE: use a <template> element as the fragment context if no context element was provided,
5436
5436
  //so we will parse in a "forgiving" manner
5437
- fragmentContext !== null && fragmentContext !== undefined ? fragmentContext : (fragmentContext = opts.treeAdapter.createElement(TAG_NAMES.TEMPLATE, NS.HTML, []));
5437
+ fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : (fragmentContext = opts.treeAdapter.createElement(TAG_NAMES.TEMPLATE, NS.HTML, []));
5438
5438
  //NOTE: create a fake element which will be used as the `document` for fragment parsing.
5439
5439
  //This is important for jsdom, where a new `document` cannot be created. This led to
5440
5440
  //fragment parsing messing with the main `document`.
@@ -5461,7 +5461,7 @@ class Parser {
5461
5461
  var _a;
5462
5462
  if (!this.onParseError)
5463
5463
  return;
5464
- const loc = (_a = token.location) !== null && _a !== undefined ? _a : BASE_LOC;
5464
+ const loc = (_a = token.location) !== null && _a !== void 0 ? _a : BASE_LOC;
5465
5465
  const err = {
5466
5466
  code,
5467
5467
  startLine: loc.startLine,
@@ -5477,7 +5477,7 @@ class Parser {
5477
5477
  /** @internal */
5478
5478
  onItemPush(node, tid, isTop) {
5479
5479
  var _a, _b;
5480
- (_b = (_a = this.treeAdapter).onItemPush) === null || _b === undefined ? undefined : _b.call(_a, node);
5480
+ (_b = (_a = this.treeAdapter).onItemPush) === null || _b === void 0 ? void 0 : _b.call(_a, node);
5481
5481
  if (isTop && this.openElements.stackTop > 0)
5482
5482
  this._setContextModes(node, tid);
5483
5483
  }
@@ -5487,7 +5487,7 @@ class Parser {
5487
5487
  if (this.options.sourceCodeLocationInfo) {
5488
5488
  this._setEndLocation(node, this.currentToken);
5489
5489
  }
5490
- (_b = (_a = this.treeAdapter).onItemPop) === null || _b === undefined ? undefined : _b.call(_a, node, this.openElements.current);
5490
+ (_b = (_a = this.treeAdapter).onItemPop) === null || _b === void 0 ? void 0 : _b.call(_a, node, this.openElements.current);
5491
5491
  if (isTop) {
5492
5492
  let current;
5493
5493
  let currentTagId;
@@ -7649,7 +7649,7 @@ function eofInBody(p, token) {
7649
7649
  function endTagInText(p, token) {
7650
7650
  var _a;
7651
7651
  if (token.tagID === TAG_ID.SCRIPT) {
7652
- (_a = p.scriptHandler) === null || _a === undefined ? undefined : _a.call(p, p.openElements.current);
7652
+ (_a = p.scriptHandler) === null || _a === void 0 ? void 0 : _a.call(p, p.openElements.current);
7653
7653
  }
7654
7654
  p.openElements.pop();
7655
7655
  p.insertionMode = p.originalInsertionMode;
@@ -8377,7 +8377,7 @@ function endTagAfterBody(p, token) {
8377
8377
  p._setEndLocation(p.openElements.items[0], token);
8378
8378
  // Update the body element, if it doesn't have an end tag
8379
8379
  const bodyElement = p.openElements.items[1];
8380
- if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a === undefined ? undefined : _a.endTag)) {
8380
+ if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a === void 0 ? void 0 : _a.endTag)) {
8381
8381
  p._setEndLocation(bodyElement, token);
8382
8382
  }
8383
8383
  }
@@ -14702,5 +14702,5 @@ exports.generateScopeTokens = generateScopeTokens;
14702
14702
  exports.kebabcaseToCamelcase = kebabcaseToCamelcase;
14703
14703
  exports.parse = parse;
14704
14704
  exports.toPropertyName = toPropertyName;
14705
- /** version: 8.13.1 */
14705
+ /** version: 8.13.3 */
14706
14706
  //# sourceMappingURL=index.cjs.js.map
package/dist/index.js CHANGED
@@ -648,7 +648,7 @@ const decodeMap = new Map([
648
648
  */
649
649
  const fromCodePoint =
650
650
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
651
- (_a = String.fromCodePoint) !== null && _a !== undefined ? _a : function (codePoint) {
651
+ (_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) {
652
652
  let output = "";
653
653
  if (codePoint > 0xffff) {
654
654
  codePoint -= 0x10000;
@@ -668,7 +668,7 @@ function replaceCodePoint(codePoint) {
668
668
  if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
669
669
  return 0xfffd;
670
670
  }
671
- return (_a = decodeMap.get(codePoint)) !== null && _a !== undefined ? _a : codePoint;
671
+ return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;
672
672
  }
673
673
 
674
674
  var CharCodes;
@@ -912,7 +912,7 @@ class EntityDecoder {
912
912
  var _a;
913
913
  // Ensure we consumed at least one digit.
914
914
  if (this.consumed <= expectedLength) {
915
- (_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
915
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
916
916
  return 0;
917
917
  }
918
918
  // Figure out if this is a legit end of the entity
@@ -987,7 +987,7 @@ class EntityDecoder {
987
987
  const { result, decodeTree } = this;
988
988
  const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
989
989
  this.emitNamedEntityData(result, valueLength, this.consumed);
990
- (_a = this.errors) === null || _a === undefined ? undefined : _a.missingSemicolonAfterCharacterReference();
990
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();
991
991
  return this.consumed;
992
992
  }
993
993
  /**
@@ -1036,7 +1036,7 @@ class EntityDecoder {
1036
1036
  return this.emitNumericEntity(0, 3);
1037
1037
  }
1038
1038
  case EntityDecoderState.NumericStart: {
1039
- (_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
1039
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
1040
1040
  return 0;
1041
1041
  }
1042
1042
  case EntityDecoderState.EntityStart: {
@@ -1541,7 +1541,7 @@ const TAG_NAME_TO_ID = new Map([
1541
1541
  ]);
1542
1542
  function getTagID(tagName) {
1543
1543
  var _a;
1544
- return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !== undefined ? _a : TAG_ID.UNKNOWN;
1544
+ return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !== void 0 ? _a : TAG_ID.UNKNOWN;
1545
1545
  }
1546
1546
  const $ = TAG_ID;
1547
1547
  const SPECIAL_ELEMENTS = {
@@ -1827,7 +1827,7 @@ class Tokenizer {
1827
1827
  //Errors
1828
1828
  _err(code, cpOffset = 0) {
1829
1829
  var _a, _b;
1830
- (_b = (_a = this.handler).onParseError) === null || _b === undefined ? undefined : _b.call(_a, this.preprocessor.getError(code, cpOffset));
1830
+ (_b = (_a = this.handler).onParseError) === null || _b === void 0 ? void 0 : _b.call(_a, this.preprocessor.getError(code, cpOffset));
1831
1831
  }
1832
1832
  // NOTE: `offset` may never run across line boundaries.
1833
1833
  getCurrentLocation(offset) {
@@ -1870,7 +1870,7 @@ class Tokenizer {
1870
1870
  return;
1871
1871
  this._runParsingLoop();
1872
1872
  if (!this.paused) {
1873
- writeCallback === null || writeCallback === undefined ? undefined : writeCallback();
1873
+ writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback();
1874
1874
  }
1875
1875
  }
1876
1876
  write(chunk, isLastChunk, writeCallback) {
@@ -1878,7 +1878,7 @@ class Tokenizer {
1878
1878
  this.preprocessor.write(chunk, isLastChunk);
1879
1879
  this._runParsingLoop();
1880
1880
  if (!this.paused) {
1881
- writeCallback === null || writeCallback === undefined ? undefined : writeCallback();
1881
+ writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback();
1882
1882
  }
1883
1883
  }
1884
1884
  insertHtmlAtCurrentPos(chunk) {
@@ -1977,7 +1977,7 @@ class Tokenizer {
1977
1977
  if (getTokenAttr(token, this.currentAttr.name) === null) {
1978
1978
  token.attrs.push(this.currentAttr);
1979
1979
  if (token.location && this.currentLocation) {
1980
- const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !== undefined ? _a : (_b.attrs = Object.create(null)));
1980
+ const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !== void 0 ? _a : (_b.attrs = Object.create(null)));
1981
1981
  attrLocations[this.currentAttr.name] = this.currentLocation;
1982
1982
  // Set end location
1983
1983
  this._leaveAttrValue();
@@ -5390,11 +5390,11 @@ class Parser {
5390
5390
  if (this.onParseError) {
5391
5391
  this.options.sourceCodeLocationInfo = true;
5392
5392
  }
5393
- this.document = document !== null && document !== undefined ? document : this.treeAdapter.createDocument();
5393
+ this.document = document !== null && document !== void 0 ? document : this.treeAdapter.createDocument();
5394
5394
  this.tokenizer = new Tokenizer(this.options, this);
5395
5395
  this.activeFormattingElements = new FormattingElementList(this.treeAdapter);
5396
5396
  this.fragmentContextID = fragmentContext ? getTagID(this.treeAdapter.getTagName(fragmentContext)) : TAG_ID.UNKNOWN;
5397
- this._setContextModes(fragmentContext !== null && fragmentContext !== undefined ? fragmentContext : this.document, this.fragmentContextID);
5397
+ this._setContextModes(fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : this.document, this.fragmentContextID);
5398
5398
  this.openElements = new OpenElementStack(this.document, this.treeAdapter, this);
5399
5399
  }
5400
5400
  // API
@@ -5410,7 +5410,7 @@ class Parser {
5410
5410
  };
5411
5411
  //NOTE: use a <template> element as the fragment context if no context element was provided,
5412
5412
  //so we will parse in a "forgiving" manner
5413
- fragmentContext !== null && fragmentContext !== undefined ? fragmentContext : (fragmentContext = opts.treeAdapter.createElement(TAG_NAMES.TEMPLATE, NS.HTML, []));
5413
+ fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : (fragmentContext = opts.treeAdapter.createElement(TAG_NAMES.TEMPLATE, NS.HTML, []));
5414
5414
  //NOTE: create a fake element which will be used as the `document` for fragment parsing.
5415
5415
  //This is important for jsdom, where a new `document` cannot be created. This led to
5416
5416
  //fragment parsing messing with the main `document`.
@@ -5437,7 +5437,7 @@ class Parser {
5437
5437
  var _a;
5438
5438
  if (!this.onParseError)
5439
5439
  return;
5440
- const loc = (_a = token.location) !== null && _a !== undefined ? _a : BASE_LOC;
5440
+ const loc = (_a = token.location) !== null && _a !== void 0 ? _a : BASE_LOC;
5441
5441
  const err = {
5442
5442
  code,
5443
5443
  startLine: loc.startLine,
@@ -5453,7 +5453,7 @@ class Parser {
5453
5453
  /** @internal */
5454
5454
  onItemPush(node, tid, isTop) {
5455
5455
  var _a, _b;
5456
- (_b = (_a = this.treeAdapter).onItemPush) === null || _b === undefined ? undefined : _b.call(_a, node);
5456
+ (_b = (_a = this.treeAdapter).onItemPush) === null || _b === void 0 ? void 0 : _b.call(_a, node);
5457
5457
  if (isTop && this.openElements.stackTop > 0)
5458
5458
  this._setContextModes(node, tid);
5459
5459
  }
@@ -5463,7 +5463,7 @@ class Parser {
5463
5463
  if (this.options.sourceCodeLocationInfo) {
5464
5464
  this._setEndLocation(node, this.currentToken);
5465
5465
  }
5466
- (_b = (_a = this.treeAdapter).onItemPop) === null || _b === undefined ? undefined : _b.call(_a, node, this.openElements.current);
5466
+ (_b = (_a = this.treeAdapter).onItemPop) === null || _b === void 0 ? void 0 : _b.call(_a, node, this.openElements.current);
5467
5467
  if (isTop) {
5468
5468
  let current;
5469
5469
  let currentTagId;
@@ -7625,7 +7625,7 @@ function eofInBody(p, token) {
7625
7625
  function endTagInText(p, token) {
7626
7626
  var _a;
7627
7627
  if (token.tagID === TAG_ID.SCRIPT) {
7628
- (_a = p.scriptHandler) === null || _a === undefined ? undefined : _a.call(p, p.openElements.current);
7628
+ (_a = p.scriptHandler) === null || _a === void 0 ? void 0 : _a.call(p, p.openElements.current);
7629
7629
  }
7630
7630
  p.openElements.pop();
7631
7631
  p.insertionMode = p.originalInsertionMode;
@@ -8353,7 +8353,7 @@ function endTagAfterBody(p, token) {
8353
8353
  p._setEndLocation(p.openElements.items[0], token);
8354
8354
  // Update the body element, if it doesn't have an end tag
8355
8355
  const bodyElement = p.openElements.items[1];
8356
- if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a === undefined ? undefined : _a.endTag)) {
8356
+ if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a === void 0 ? void 0 : _a.endTag)) {
8357
8357
  p._setEndLocation(bodyElement, token);
8358
8358
  }
8359
8359
  }
@@ -14673,5 +14673,5 @@ function compile(source, filename, config) {
14673
14673
  }
14674
14674
 
14675
14675
  export { ElementDirectiveName, LWCDirectiveDomMode, LWCDirectiveRenderMode, LwcTagName, RootDirectiveName, TemplateDirectiveName, compile, compile as default, generateScopeTokens, kebabcaseToCamelcase, parse, toPropertyName };
14676
- /** version: 8.13.1 */
14676
+ /** version: 8.13.3 */
14677
14677
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
5
5
  ],
6
6
  "name": "@lwc/template-compiler",
7
- "version": "8.13.1",
7
+ "version": "8.13.3",
8
8
  "description": "Template compiler package",
9
9
  "keywords": [
10
10
  "lwc"
@@ -46,8 +46,8 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@lwc/errors": "8.13.1",
50
- "@lwc/shared": "8.13.1",
49
+ "@lwc/errors": "8.13.3",
50
+ "@lwc/shared": "8.13.3",
51
51
  "acorn": "~8.14.0",
52
52
  "astring": "~1.9.0",
53
53
  "he": "~1.2.0"