@veryfront/ext-yaml 0.1.1289-rc.26367 → 0.1.1289-rc.26376

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.
@@ -3,8 +3,8 @@ import { type SkillDocumentParserProvider, type YamlParseOptions, type YamlParse
3
3
  * Decode one YAML document with `@std/yaml`-compatible failure behaviour.
4
4
  *
5
5
  * `yaml` reports most problems on the returned document instead of throwing,
6
- * and raises `YAMLParseError` rather than `SyntaxError` when it does throw.
7
- * Both are normalised here so call sites keep the single `SyntaxError`
6
+ * and may also throw while converting aliases into JavaScript values.
7
+ * Parse and conversion failures are normalised so call sites keep the single `SyntaxError`
8
8
  * contract they were written against.
9
9
  */
10
10
  export declare function parseYamlSource(source: string, options?: YamlParseOptions): unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/src/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AAwDrC;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAET;AAiDD,6DAA6D;AAC7D,wBAAgB,gBAAgB,IAAI,QAAQ,CAAC,kBAAkB,CAAC,CAE/D;AAED;;;;;;GAMG;AACH,wBAAgB,wCAAwC,IAAI,QAAQ,CAClE,2BAA2B,CAC5B,CAOA"}
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/src/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AAwDrC;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAET;AAqDD,6DAA6D;AAC7D,wBAAgB,gBAAgB,IAAI,QAAQ,CAAC,kBAAkB,CAAC,CAE/D;AAED;;;;;;GAMG;AACH,wBAAgB,wCAAwC,IAAI,QAAQ,CAClE,2BAA2B,CAC5B,CAOA"}
@@ -57,8 +57,8 @@ function withoutPollutedValuePrototype(run) {
57
57
  * Decode one YAML document with `@std/yaml`-compatible failure behaviour.
58
58
  *
59
59
  * `yaml` reports most problems on the returned document instead of throwing,
60
- * and raises `YAMLParseError` rather than `SyntaxError` when it does throw.
61
- * Both are normalised here so call sites keep the single `SyntaxError`
60
+ * and may also throw while converting aliases into JavaScript values.
61
+ * Parse and conversion failures are normalised so call sites keep the single `SyntaxError`
62
62
  * contract they were written against.
63
63
  */
64
64
  export function parseYamlSource(source, options = {}) {
@@ -103,7 +103,12 @@ function decodeDocument(source, options) {
103
103
  throw new SyntaxError(problem.message, { cause: problem });
104
104
  if (jsonSchema)
105
105
  assertJsonRepresentableTags(document);
106
- return document.toJS();
106
+ try {
107
+ return document.toJS();
108
+ }
109
+ catch (cause) {
110
+ throw new SyntaxError(cause instanceof Error ? cause.message : String(cause), { cause });
111
+ }
107
112
  }
108
113
  /** Create the official `yaml`-backed general YAML parser. */
109
114
  export function createYamlParser() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veryfront/ext-yaml",
3
- "version": "0.1.1289-rc.26367",
3
+ "version": "0.1.1289-rc.26376",
4
4
  "description": "Veryfront first-party extension package for ext-yaml",
5
5
  "keywords": [
6
6
  "veryfront",
@@ -50,7 +50,7 @@
50
50
  "yaml": "2.9.0"
51
51
  },
52
52
  "peerDependencies": {
53
- "veryfront": "^0.1.1289-rc.26367"
53
+ "veryfront": "^0.1.1289-rc.26376"
54
54
  },
55
55
  "type": "module",
56
56
  "types": "./esm/src/index.d.ts",
@@ -60,5 +60,5 @@
60
60
  "NOTICE",
61
61
  "README.md"
62
62
  ],
63
- "gitHead": "89becd31c81fb0e19ab15a077e48a2ddbb791a4f"
63
+ "gitHead": "db8b761eae4fc1996e2b43a24e95d8fd2828f7ad"
64
64
  }