@effected/toml 0.11.0 → 0.11.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/Toml.js +8 -1
- package/index.d.ts +7 -0
- package/package.json +1 -1
package/Toml.js
CHANGED
|
@@ -27,13 +27,20 @@ var TomlStringifyOptions = class extends Schema.Class("TomlStringifyOptions")({
|
|
|
27
27
|
* array shape matches `@effected/yaml`'s aggregate contract). Raised by
|
|
28
28
|
* {@link Toml.parse} and the decode direction of the schema factories.
|
|
29
29
|
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* The `message` renders the first diagnostic's position 1-based
|
|
32
|
+
* (`line + 1:character + 1`) for human readers — a CLI printing this string
|
|
33
|
+
* shows the line/column a person counts in their editor. The structured
|
|
34
|
+
* {@link TomlDiagnostic} `line`/`character` fields stay 0-based (LSP
|
|
35
|
+
* convention); the offset applies to the rendered message only.
|
|
36
|
+
*
|
|
30
37
|
* @public
|
|
31
38
|
*/
|
|
32
39
|
var TomlParseError = class extends Schema.TaggedError()("TomlParseError", { diagnostics: Schema.Array(TomlDiagnostic) }) {
|
|
33
40
|
get message() {
|
|
34
41
|
const count = this.diagnostics.length;
|
|
35
42
|
const first = this.diagnostics[0];
|
|
36
|
-
const detail = first === void 0 ? "" : `: ${first.code} at ${first.line}:${first.character} ${first.message}`;
|
|
43
|
+
const detail = first === void 0 ? "" : `: ${first.code} at ${first.line + 1}:${first.character + 1} ${first.message}`;
|
|
37
44
|
return `TOML parse failed with ${count} error${count === 1 ? "" : "s"}${detail}`;
|
|
38
45
|
}
|
|
39
46
|
};
|
package/index.d.ts
CHANGED
|
@@ -127,6 +127,13 @@ declare const TomlParseError_base: Schema.Class<TomlParseError, Schema.TaggedStr
|
|
|
127
127
|
* array shape matches `@effected/yaml`'s aggregate contract). Raised by
|
|
128
128
|
* {@link Toml.parse} and the decode direction of the schema factories.
|
|
129
129
|
*
|
|
130
|
+
* @remarks
|
|
131
|
+
* The `message` renders the first diagnostic's position 1-based
|
|
132
|
+
* (`line + 1:character + 1`) for human readers — a CLI printing this string
|
|
133
|
+
* shows the line/column a person counts in their editor. The structured
|
|
134
|
+
* {@link TomlDiagnostic} `line`/`character` fields stay 0-based (LSP
|
|
135
|
+
* convention); the offset applies to the rendered message only.
|
|
136
|
+
*
|
|
130
137
|
* @public
|
|
131
138
|
*/
|
|
132
139
|
export declare class TomlParseError extends TomlParseError_base {
|
package/package.json
CHANGED