You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| lineCounter |`LineCounter`|| If set, newlines will be tracked, to allow for `lineCounter.linePos(offset)` to provide the `{ line, col }` positions within the input. |
30
30
| prettyErrors |`boolean`|`true`| Include line/col position in errors, along with an extract of the source string. |
31
31
| strict |`boolean`|`true`| When parsing, do not ignore errors [required](#silencing-errors-and-warnings) by the YAML 1.2 spec, but caused by unambiguous content. |
32
+
| stringKeys |`boolean`|`false`| Parse all mapping keys as strings. Treat all non-scalar keys as errors. |
32
33
| uniqueKeys |`boolean ⎮ (a, b) => boolean`|`true`| Whether key uniqueness is checked, or customised. If set to be a function, it will be passed two parsed nodes and should return a boolean value indicating their equality. |
|`ALIAS_PROPS`| Unlike scalars and collections, alias nodes cannot have an anchor or tag associated with it. |
28
28
|`BAD_ALIAS`| An alias identifier must be a non-empty sequence of valid characters. |
29
+
|`BAD_COLLECTION_TYPE`| Explicit collection tag used on a collection type it does not support. |
29
30
|`BAD_DIRECTIVE`| Only the `%YAML` and `%TAG` directives are supported, and they need to follow the specified structure. |
30
31
|`BAD_DQ_ESCAPE`| Double-quotes strings may include `\` escaped content, but that needs to be valid. |
31
32
|`BAD_INDENT`| Indentation is important in YAML, and collection items need to all start at the same level. Block scalars are also picky about their leading content. |
@@ -36,12 +37,12 @@ To identify errors for special handling, you should primarily use `code` to diff
36
37
|`DUPLICATE_KEY`| Map keys must be unique. Use the `uniqueKeys` option to disable or customise this check when parsing. |
37
38
|`IMPOSSIBLE`| This really should not happen. If you encounter this error code, please file a bug. |
38
39
|`KEY_OVER_1024_CHARS`| Due to legacy reasons, implicit keys must have their following `:` indicator after at most 1k characters. |
39
-
|`MISSING_ANCHOR`| Aliases can only dereference anchors that are before them in the document. |
40
40
|`MISSING_CHAR`| Some character or characters are missing here. See the error message for what you need to add. |
41
41
|`MULTILINE_IMPLICIT_KEY`| Implicit keys need to be on a single line. Does the input include a plain scalar with a `:` followed by whitespace, which is getting parsed as a map key? |
42
42
|`MULTIPLE_ANCHORS`| A node is only allowed to have one anchor. |
43
43
|`MULTIPLE_DOCS`| A YAML stream may include multiple documents. If yours does, you'll need to use `parseAllDocuments()` to work with it. |
44
44
|`MULTIPLE_TAGS`| A node is only allowed to have one tag. |
45
+
|`NON_STRING_KEY`| With the `stringKeys` option, all mapping keys must be strings |
45
46
|`TAB_AS_INDENT`| Only spaces are allowed as indentation. |
46
47
|`TAG_RESOLVE_FAILED`| Something went wrong when resolving a node's tag with the current schema. |
47
48
|`UNEXPECTED_TOKEN`| A token was encountered in a place where it wasn't expected. |
0 commit comments