@dogsbay/tree-diff 0.2.0-beta.165 → 0.2.0-beta.167

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/dist/diff.js +5 -4
  2. package/package.json +3 -3
package/dist/diff.js CHANGED
@@ -48,13 +48,14 @@ export function sectionize(nodes) {
48
48
  return root;
49
49
  }
50
50
  /**
51
- * Whether two nodes have the same content. A node's source line (`meta.line`, from a parser's `sourceLines`)
52
- * says where it is, not what it is: compared, every block below an edit would show as changed.
51
+ * Whether two nodes have the same content. A node's source lines (`meta.line`, `meta.endLine`, from a
52
+ * parser's `sourceLines`) and their origin (`meta.source`, from a source map) say where it is, not what
53
+ * it is: compared, every block below an edit would show as changed.
53
54
  */
54
55
  const withoutLines = (key, value) => {
55
- if (key !== "meta" || !value || typeof value !== "object" || !("line" in value))
56
+ if (key !== "meta" || !value || typeof value !== "object" || !("line" in value || "endLine" in value || "source" in value))
56
57
  return value;
57
- const { line: _line, ...rest } = value;
58
+ const { line: _line, endLine: _endLine, source: _source, ...rest } = value;
58
59
  return Object.keys(rest).length ? rest : undefined;
59
60
  };
60
61
  const sameContent = (a, b) => JSON.stringify(a, withoutLines) === JSON.stringify(b, withoutLines);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dogsbay/tree-diff",
3
- "version": "0.2.0-beta.165",
3
+ "version": "0.2.0-beta.167",
4
4
  "license": "MIT",
5
5
  "description": "diffTrees: identity-driven version diffing over TreeNode — one DiffTree, many views (comparison pages, PR review, version-switcher compare, IDE change review)",
6
6
  "type": "module",
@@ -20,10 +20,10 @@
20
20
  "@types/node": "^25.9.5",
21
21
  "typescript": "^5.9.3",
22
22
  "vitest": "^4.1.10",
23
- "@dogsbay/format-dogsbay-md": "0.2.0-beta.165"
23
+ "@dogsbay/format-dogsbay-md": "0.2.0-beta.167"
24
24
  },
25
25
  "dependencies": {
26
- "@dogsbay/types": "0.2.0-beta.165"
26
+ "@dogsbay/types": "0.2.0-beta.167"
27
27
  },
28
28
  "repository": {
29
29
  "type": "git",