How YAML to JSON Conversion Works
The parser implements a subset of the YAML 1.2 spec: key-value pairs, nested mappings (objects), sequences (arrays), block and flow styles, scalar types (string, int, float, bool, null), and proper handling of quoted vs. unquoted values. The resulting JavaScript object is then serialized to JSON with 2-space indentation. If the YAML is malformed (bad indentation, unclosed quotes, tab characters), you get a parse error with the line and column number of the problem.