Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
save = () => {
try {
fs.writeFileSync(configPath, CSON.stringify(this.configData, null, 2))
} catch (e) {
console.warn(e)
}
}
const format_data = (data) => new Promise((resolve, reject) => {
try {
if (settings.output === 'json') {
resolve(JSON.stringify(data, null, settings.format));
} else if (settings.output === 'yaml' || settings.output === 'yml') {
resolve(yaml.stringify(data, settings.format));
} else if (settings.output === 'cson') {
resolve(cson.stringify(data, null, settings.format));
}
} catch (e) {
reject(e);
}
});
export function saveQuestTracking(records) {
const { activeQuests } = window.getStore('info.quests')
const admiralId = window.getStore('info.basic.api_member_id')
fileWriter.write(
questTrackingPath(admiralId),
CSON.stringify(processQuestRecords(records, activeQuests)),
)
}
function csonStringify(data) {
return cson.stringify(data, null, " ")
}
public async encode(value: any) {
return cson.stringify(value, undefined, 2)
}
stringify (obj: Object, settings: Object = {}): Promise {
const indent: number = ((settings.formats || {}).cson || {}).spacing || settings.spacing
return Promise.resolve(cson.stringify(obj, null, indent))
},
})
stringify: (obj, indent = 2) => Promise.resolve(cson.stringify(obj, null, indent))
};