Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
demoAddLatency(deMax, deMin, deAvg);
}
}
demoRefreshX();
// if(started) {
console.log('[Transaction Info] - Submitted: ' + demoData.summary.txSub
+ ' Succ: ' + demoData.summary.txSucc
+ ' Fail:' + demoData.summary.txFail
+ ' Unfinished:' + (demoData.summary.txSub - demoData.summary.txSucc - demoData.summary.txFail));
// }
var fs = require('fs');
fs.writeFileSync(demoFile, JSON.stringify(demoData));
}
public jasmineDone() {
const duration = Date.now() - this.jasmineStartTime;
writeFileSync(
this.outputFile,
xml({
testsuites: [
{
testsuite: [{ _attr: { time: duration / 1000 } }, ...this.testcases]
}
]
}),
'utf8'
);
}
let content, srcHtmlPath, destHtmlPath;
const oldSemanticUIVersion = process.argv[2];
const newSemanticUIVersion = process.argv[3];
for (let category of ["bootstrap", "semantic-ui"]) {
for (let template of fs.readdirSync(category)) {
console.log(
`Upgrade ${category}/${template} html semantic to from` +
` ${oldSemanticUIVersion} to ${newSemanticUIVersion}...`
);
srcHtmlPath = path.join(category, template, "html/index.html");
destHtmlPath = path.join(category, template, "html/index.html");
content = fs.readFileSync(srcHtmlPath, "utf-8");
fs.writeFileSync(
destHtmlPath,
content.replace(
`semantic-ui/${oldSemanticUIVersion}/semantic.min.css`,
`semantic-ui/${newSemanticUIVersion}/semantic.min.css`
)
);
}
}
}
function write(params, id) {
try {
fs.writeFileSync(filename(id), serialize.serializeParams(params));
if (verbose) {
console.log('Wrote parameter set ' + id + '.');
}
} catch (e) {
util.warn('Error writing parameter set ' + id + '.');
}
}
features.push({
type: 'Feature',
properties: {
number: no,
route: i,
},
geometry: {
type: 'LineString',
coordinates: route,
},
});
});
});
const filePath = 'data/3/routes.geojson';
fs.writeFileSync(filePath, JSON.stringify({
type: 'FeatureCollection',
features,
}, null, '\t'));
console.log(`Generated ${filePath}`);
### Analyzer Info
The analyzer was launched using the arguments:
${analyzerArgs.map((a) => `- ${a}`).join("\n")}
### Exception${error.isFatal ? " (fatal)" : ""}
${error.message}
${error.stackTrace.trim()}
`;
const fileName = `bug-${getRandomInt(0x1000, 0x10000).toString(16)}.md`;
const tempPath = path.join(os.tmpdir(), fileName);
fs.writeFileSync(tempPath, data.trim());
workspace.openTextDocument(tempPath).then((document) => {
window.showTextDocument(document);
});
}
}
save() {
fs.writeFileSync(this.path, JSON.stringify(this.data, null, 2));
}
}
exports[DO_COPY] = function copy(callback) {
fs.writeFileSync(`${DIST}${CONTINENTS}.${JSON_EXT}`, JSON.stringify(continents, false, JSON_TAB) + LF);
fs.writeFileSync(`${DIST}${COUNTRIES}.${JSON_EXT}`, JSON.stringify(countries, false, JSON_TAB) + LF);
fs.writeFileSync(`${DIST}${LANGUAGES}.${JSON_EXT}`, JSON.stringify(languagesInUse, false, JSON_TAB) + LF);
fs.writeFileSync(`${DIST}${LANGUAGES}.${ALL}.${JSON_EXT}`, JSON.stringify(languages, false, JSON_TAB) + LF);
callback && callback();
}
function saveKickstarter(config, kickData) {
debug('saveKickstarter()');
fs.writeFileSync(path.join(config.basePath, 'kickstarter.json'), JSON.stringify(kickData, null, 2));
}
const tid_pos_buffer = toBuffer(dic.token_info_dictionary.pos_buffer.buffer);
const tid_map_buffer = toBuffer(dic.token_info_dictionary.targetMapToBuffer());
const connection_costs_buffer = toBuffer(dic.connection_costs.buffer);
const unk_buffer = toBuffer(dic.unknown_dictionary.dictionary.buffer);
const unk_pos_buffer = toBuffer(dic.unknown_dictionary.pos_buffer.buffer);
const unk_map_buffer = toBuffer(dic.unknown_dictionary.targetMapToBuffer());
const char_map_buffer = toBuffer(dic.unknown_dictionary.character_definition.character_category_map);
const char_compat_map_buffer = toBuffer(dic.unknown_dictionary.character_definition.compatible_category_map);
const invoke_definition_map_buffer = toBuffer(dic.unknown_dictionary.character_definition.invoke_definition_map.toBuffer());
fs.writeFileSync("dict/base.dat", base_buffer);
fs.writeFileSync("dict/check.dat", check_buffer);
fs.writeFileSync("dict/tid.dat", token_info_buffer);
fs.writeFileSync("dict/tid_pos.dat", tid_pos_buffer);
fs.writeFileSync("dict/tid_map.dat", tid_map_buffer);
fs.writeFileSync("dict/cc.dat", connection_costs_buffer);
fs.writeFileSync("dict/unk.dat", unk_buffer);
fs.writeFileSync("dict/unk_pos.dat", unk_pos_buffer);
fs.writeFileSync("dict/unk_map.dat", unk_map_buffer);
fs.writeFileSync("dict/unk_char.dat", char_map_buffer);
fs.writeFileSync("dict/unk_compat.dat", char_compat_map_buffer);
fs.writeFileSync("dict/unk_invoke.dat", invoke_definition_map_buffer);
done();
});
});