UNPKG

yaml-unist-parser

Version:

A YAML parser that produces output compatible with unist

12 lines (11 loc) 443 B
import { createCommentAttachable } from "./comment-attachable.js"; import { createEndCommentAttachable } from "./end-comment-attachable.js"; import { createNode } from "./node.js"; export function createMappingValue(position, content) { return { ...createNode("mappingValue", position), ...createCommentAttachable(), ...createEndCommentAttachable(), children: !content ? [] : [content], }; }