How to use js-yaml.safeDump:
GitHub: sourcey/spectacle
176 177 178 179 180 181 182 183 184 185
printSchema: function(value, toyaml) { if (!value) { return ''; } var schemaString = toyaml ? yaml.safeDump(value, {skipInvalid:true}) : JSON.stringify(value, null, 2) // Add an extra CRLR before the code so the postprocessor can determine // the correct line indent for the <pre> tag. var $ = cheerio.load(marked(toyaml ? "```yaml\r\n" + schemaString + "```" : "```json\r\n" + schemaString + "\n```"))
336
0
19
See more examples
How to use js-yaml.safeLoad:
GitHub: openupm/openupm
83 84 85 86 87 88 89 90 91 92
describe("verify other YAML files", function () { const files = ["backers.yml", "blocked-scopes.yml", "builtin.yml", "sponsors.yml", "topics.yml"]; for (const file of files) { let absPath = path.resolve(dataDir, file); it("verify " + file, function() { const result = yaml.safeLoad(fs.readFileSync(absPath, "utf8")); result.should.not.be.undefined(); }); } });
571
0
9
See more examples
How to use js-yaml.load:
105 106 107 108 109 110 111 112 113
if (!data && !current_cfg) { return; } if (data) { let config = yaml.load(data, { filename: cfg_path }); // Normalize config - convert all types to array config.type = config.type || {};
851
0
246
See more examples
How to use js-yaml.dump:
156 157 158 159 160 161 162 163 164
} } var ymlContent = yaml.dump(requestJson); var ymlBuffer = Buffer.from(ymlContent); requestYmlBase64 = ymlBuffer.toString('base64'); }
312
0
41
See more examples