MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / PrerequisiteFile

Class PrerequisiteFile

tools/mcmanifest.js:1779–1798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1777}
1778
1779export class PrerequisiteFile {
1780 constructor(path, tool) {
1781 this.path = path;
1782 this.tool = tool;
1783 this.former = tool.isDirectoryOrFile(path) ? tool.readFileString(path) : "";
1784 this.current = ""
1785 }
1786 close() {
1787 if (this.former.localeCompare(this.current))
1788 this.tool.writeFileString(this.path, this.current);
1789 }
1790 line(...strings) {
1791 for (var string of strings)
1792 this.write(string);
1793 this.write("\n");
1794 }
1795 write(string) {
1796 this.current += string;
1797 }
1798}
1799
1800export class TSConfigFile extends PrerequisiteFile {
1801 generate(tool, typescript = true, javascript = false) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected