@limaformat/lima 0.3.0 → 0.3.1

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/CHANGELOG.md CHANGED
@@ -12,6 +12,15 @@ are both frozen regardless of what this file shows.
12
12
 
13
13
  ## [Unreleased]
14
14
 
15
+ ## [0.3.1] — 2026-08-12
16
+
17
+ ### Fixed
18
+
19
+ - References 2.0 document references now resolve correctly when the source
20
+ and target share a top-level mapping, including sibling fields and separate
21
+ nested branches. Genuine self-references and dependency cycles remain
22
+ unresolved.
23
+
15
24
  ## [0.3.0] — 2026-08-12
16
25
 
17
26
  ### Changed
@@ -23,8 +23,18 @@ const lookupPath = (root, segments) => {
23
23
  };
24
24
  const documentTarget = (root, path) => {
25
25
  const segments = path.split('.');
26
- const value = root.get(segments[0]);
27
- return value === undefined ? undefined : { root: value, tail: segments.slice(1) };
26
+ let value = root.get(segments[0]);
27
+ if (value === undefined)
28
+ return undefined;
29
+ let index = 1;
30
+ while (index < segments.length && value.kind === 'mapping') {
31
+ const child = value.entries.get(segments[index]);
32
+ if (child === undefined)
33
+ return undefined;
34
+ value = child;
35
+ index++;
36
+ }
37
+ return { root: value, tail: segments.slice(index) };
28
38
  };
29
39
  const lookupPartial = (partials, path) => {
30
40
  const dot = path.indexOf('.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limaformat/lima",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Lima frontmatter parser — LIMA Is Metadata Annotation",
5
5
  "keywords": ["frontmatter", "parser", "yaml", "markdown", "metadata"],
6
6
  "homepage": "https://limaformat.dev",
@@ -20,25 +20,27 @@
20
20
  }
21
21
  },
22
22
  "files": ["dist", "README.md", "LICENSE", "CHANGELOG.md"],
23
- "engines": { "node": ">=18" },
24
- "scripts": {
25
- "build": "tsc -p tsconfig.build.json",
26
- "pretest": "bun run build",
27
- "test": "bun test",
28
- "typecheck": "tsc --noEmit",
29
- "prepublishOnly": "bun run typecheck && bun test",
30
- "bench": "bun run bench/index.ts",
31
- "bench:vs-yaml": "bun run bench/vs-yaml.ts",
32
- "bench:vs-yaml:node": "node bench/vs-yaml-node.mjs",
33
- "bench:cross-language": "bun run bench/cross-language.ts",
34
- "bench:differential": "bun run bench/differential.ts",
35
- "wordcount": "bun run scripts/wordcount.ts"
36
- },
37
- "devDependencies": {
38
- "@types/bun": "^1.3.14",
39
- "@types/js-yaml": "^4.0.9",
40
- "js-yaml": "^5.2.3",
41
- "typescript": "^7.0.2",
42
- "typescript-classic": "npm:typescript@^5.9.3"
43
- }
23
+ "engines": {
24
+ "node": ">=18"
25
+ },
26
+ "scripts": {
27
+ "build": "tsc -p tsconfig.build.json",
28
+ "pretest": "bun run build",
29
+ "test": "bun test",
30
+ "typecheck": "tsc --noEmit",
31
+ "prepublishOnly": "bun run typecheck && bun test",
32
+ "bench": "bun run bench/index.ts",
33
+ "bench:vs-yaml": "bun run bench/vs-yaml.ts",
34
+ "bench:vs-yaml:node": "node bench/vs-yaml-node.mjs",
35
+ "bench:cross-language": "bun run bench/cross-language.ts",
36
+ "bench:differential": "bun run bench/differential.ts",
37
+ "wordcount": "bun run scripts/wordcount.ts"
38
+ },
39
+ "devDependencies": {
40
+ "@types/bun": "^1.3.14",
41
+ "@types/js-yaml": "^4.0.9",
42
+ "js-yaml": "^5.2.3",
43
+ "typescript": "^7.0.2",
44
+ "typescript-classic": "npm:typescript@^5.9.3"
45
+ }
44
46
  }