UNPKG

@sap/generator-cap-project

Version:

Creates a new SAP Cloud Application Programming Model project.

13 lines (12 loc) 404 B
function read(filepath, options) { options = options || { raw: false }; const file = this.store.get(filepath); if (file.contents === null) { if ('defaults' in options) { return options.defaults ?? null; } throw new Error(filepath + " doesn't exist"); } return options.raw ? file.contents : file.contents?.toString() || null; } export default read;