Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const description = pathOr('', [...path, 'description'], schema);
if (description) {
comments.push(' ' + description.split('\n').join('\n '), '');
}
const defaultValue = pathOr('', [...path, 'default'], schema);
if (defaultValue || defaultValue === false) {
comments.push(' Default value: ' + defaultValue, '');
}
const examples = pathOr('', [...path, 'examples'], schema);
if (examples) {
comments.push(
' Examples:',
...YAML.stringify(examples)
.split('\n')
.map(i => ` ${i}`)
); // split always returns one empty object so no need for newline
}
let hasChildren;
if (item.value.items) {
item.value.items.forEach(item => {
if (item.key) {
enhance(schema, [...parents, key])(item);
hasChildren = true;
}
});
}
if (!hasChildren) {
generateTagpack () {
return YAML.stringify({
title: 'Tagpack exported from GraphSense ' + VERSION, // eslint-disable-line no-undef
creator: this.rest.username,
lastmod: moment().format('YYYY-MM-DD'),
tags: this.store.getNotes()
})
}
generateTagsJSON () {
getRoomAndDevices(config.room, (err, rooms) => {
if (!err) config.room = rooms
writeFile(configFile, stringify(config), 'utf8', err => {
if (err) console.error(err)
if (!config.calendar) return rl.close()
rl.question(`Run schedule now? [Y/n]`, input => {
rl.close()
if (input.substr(0, 1).toLowerCase() === 'n') return
runSchedule(err => {
if (err) return console.error(err)
console.log(`👍 done!`)
})
})
})
})
})
function stringifyMosaicData(data: IMosaicData) {
return YAML.stringify(data)
}
function (key, val) {
if (key !== 'kwargClass') return val;
},
2
)}
>
<button>Copy JSON</button>
<div>
<div>
<div>
<pre> {YAML.stringify(
JSON.parse(
JSON.stringify(
combined,
function (key, val) {
if (key !== 'kwargClass') return val;
},
2
)
)
)}
</pre>
</div>
<div>
</div></div></div>
export function toYAML(obj: any): string {
const oldFold = yamlTypes.strOptions.fold.lineWidth;
try {
yamlTypes.strOptions.fold.lineWidth = 0;
return YAML.stringify(obj, { schema: 'yaml-1.1' });
} finally {
yamlTypes.strOptions.fold.lineWidth = oldFold;
}
}
function validateSchema(schema, openapi, options) {
validateMetaSchema(schema);
let errors = validateSchema.errors;
if (errors && errors.length) {
if (options.prettify) {
const errorStr = bae(schema, openapi, errors);
throw (new CLIError(errorStr));
}
throw (new JSONSchemaError('Schema invalid:\n'+ yaml.stringify(errors)));
}
options.schema = schema;
return !(errors && errors.length);
}
.then(() => {
return util.promisify(fs.writeFile)(path.join(this.path, 'triggers.yml'), YAML.stringify(triggers), 'utf8')
})
}
expandedRowRender={(account: Sdk.ClientAccount) => {YAML.stringify(account)}}/>