@markuplint/astro-parser 4.0.0-alpha.3 → 4.0.0-dev.28

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.
Files changed (2) hide show
  1. package/lib/parse.js +2 -2
  2. package/package.json +6 -7
package/lib/parse.js CHANGED
@@ -108,7 +108,7 @@ parentNode, scopeNS, rawHtml, offset = 0, options, inExpression) {
108
108
  let _raw = raw;
109
109
  let closeExpression = null;
110
110
  const firstChild = originNode.children[0];
111
- const lastChild = originNode.children[originNode.children.length - 1];
111
+ const lastChild = originNode.children.at(-1);
112
112
  if (firstChild && lastChild && firstChild !== lastChild) {
113
113
  _endOffset = firstChild.position?.end?.offset ?? endOffset;
114
114
  const startLoc = sliceFragment(rawHtml, startOffset, _endOffset);
@@ -231,7 +231,7 @@ nextNode, offset, options) {
231
231
  let childrenEnd;
232
232
  if (originNode.children[0]) {
233
233
  childrenStart = (originNode.children[0].position?.start?.offset ?? 0) + offset;
234
- childrenEnd = (originNode.children[originNode.children.length - 1]?.position?.end?.offset ?? 0) + offset;
234
+ childrenEnd = (originNode.children.at(-1)?.position?.end?.offset ?? 0) + offset;
235
235
  const startTagStartOffset = originNode.position.start.offset + offset;
236
236
  const startTagEndOffset = childrenStart;
237
237
  startTagRaw = rawHtml.slice(startTagStartOffset, startTagEndOffset);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/astro-parser",
3
- "version": "4.0.0-alpha.3",
3
+ "version": "4.0.0-dev.28+0131de5e",
4
4
  "description": "astro parser for markuplint",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -22,11 +22,10 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@astrojs/parser": "0.22.2",
25
- "@markuplint/html-parser": "4.0.0-alpha.3",
26
- "@markuplint/ml-ast": "4.0.0-alpha.3",
27
- "@markuplint/parser-utils": "4.0.0-alpha.3",
28
- "astro-eslint-parser": "^0.16.0",
29
- "tslib": "^2.6.2"
25
+ "@markuplint/html-parser": "4.0.0-dev.28+0131de5e",
26
+ "@markuplint/ml-ast": "4.0.0-dev.28+0131de5e",
27
+ "@markuplint/parser-utils": "4.0.0-dev.28+0131de5e",
28
+ "astro-eslint-parser": "^0.16.0"
30
29
  },
31
- "gitHead": "380836f7adc1ff7e8eaf9d869e68d29eee8f3b7e"
30
+ "gitHead": "0131de5ea9dd6d3fd5472d7b414b66644c758881"
32
31
  }