yaml-unist-parser
Version:
A YAML parser that produces output compatible with unist
12 lines (11 loc) • 464 B
JavaScript
import { createEndCommentAttachable } from "./end-comment-attachable.js";
import { createNode } from "./node.js";
import { createTrailingCommentAttachable } from "./trailing-comment-attachable.js";
export function createMappingKey(position, content) {
return {
...createNode("mappingKey", position),
...createTrailingCommentAttachable(),
...createEndCommentAttachable(),
children: !content ? [] : [content],
};
}