get-file-content.js 328 B

12345678910
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. function getFileContent(tree, path) {
  4. const fileEntry = tree.get(path);
  5. if (!fileEntry) {
  6. throw new Error(`The file (${path}) does not exist.`);
  7. }
  8. return fileEntry.content.toString();
  9. }
  10. exports.getFileContent = getFileContent;