How to use the yaml-ast-parser.safeDump function in yaml-ast-parser

To help you get started, we’ve selected a few yaml-ast-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / autorest / src / autorest-core / dist / language-service / language-service.js View on Github external
*onHoverRef(docAnalysis, position) {
        const refValueJsonPath = docAnalysis.GetJsonPathFromJsonReferenceAt(position);
        if (refValueJsonPath) {
            for (const location of docAnalysis.GetDefinitionLocations(refValueJsonPath)) {
                yield {
                    language: "yaml",
                    value: yaml_ast_parser_1.safeDump(location.value, {})
                };
            }
        } // else {console.log("found nothing that looks like a JSON reference"); return null; }
    }
    *onHoverJsonPath(docAnalysis, position) {
github Azure / autorest / src / autorest-core / lib / ref / yaml.ts View on Github external
export function Stringify(object: T): string {
  return "---\n" + yamlAst.safeDump(object, { skipInvalid: true });
}