@sap/generator-cap-project
Version:
Creates a new SAP Cloud Application Programming Model project.
12 lines (11 loc) • 412 B
JavaScript
const DEFAULT_INDENTATION = 2;
export default function writeJSON(filepath, contents, replacer, space) {
let jsonStr;
if (typeof replacer === 'function') {
jsonStr = JSON.stringify(contents, replacer, space || DEFAULT_INDENTATION) + '\n';
}
else {
jsonStr = JSON.stringify(contents, replacer, space || DEFAULT_INDENTATION) + '\n';
}
return this.write(filepath, jsonStr);
}