Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Message, SourceLocation, Channel } from '../message';
import { NewEmptyObject } from "../parsing/stable-object";
/**
* reexport required elements
*/
export { newScalar } from "yaml-ast-parser";
export const Kind: { SCALAR: number, MAPPING: number, MAP: number, SEQ: number, ANCHOR_REF: number, INCLUDE_REF: number } = yamlAst.Kind;
export type YAMLNode = yamlAst.YAMLNode;
export type YAMLScalar = yamlAst.YAMLScalar;
export type YAMLMapping = yamlAst.YAMLMapping;
export type YAMLMap = yamlAst.YamlMap;
export type YAMLSequence = yamlAst.YAMLSequence;
export type YAMLAnchorReference = yamlAst.YAMLAnchorReference;
export const CreateYAMLMapping: (key: YAMLScalar, value: YAMLNode) => YAMLMapping = yamlAst.newMapping;
export const CreateYAMLScalar: (value: string) => YAMLScalar = yamlAst.newScalar;
export interface YAMLNodeWithPath {
path: JsonPath;
node: YAMLNode;
}
/**
* Parsing
*/
export function ParseToAst(rawYaml: string): YAMLNode {
return yamlAst.safeLoad(rawYaml, null) as YAMLNode;
}
export function* Descendants(yamlAstNode: YAMLNode, currentPath: JsonPath = [], deferResolvingMappings: boolean = false): Iterable {
const todos: YAMLNodeWithPath[] = [{ path: currentPath, node: yamlAstNode }];