gd-sprest-def 1.1.8 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/clean.js CHANGED
@@ -30,8 +30,11 @@ console.log("Cleaning the files...");
30
30
  // Delete the folder
31
31
  deleteDirectory("./lib");
32
32
 
33
- // Delete the file
34
- fs.unlinkSync("./graph.xml");
33
+ // See if the file exists
34
+ if (fs.existsSync("./graph.xml")) {
35
+ // Delete the file
36
+ fs.unlinkSync("./graph.xml");
37
+ }
35
38
 
36
39
  // Create the folder
37
40
  fs.mkdirSync("./lib");
@@ -51,8 +54,18 @@ https.get("https://graph.microsoft.com/v1.0/$metadata", (res) => {
51
54
 
52
55
  // Wait for the read to complete
53
56
  res.on("end", function () {
57
+ // Fix TypeScript Issues
58
+ // Rename the "case" type
59
+ // Rename the "return" type
60
+ let content = data.toString()
61
+ .replace('Name="case"', 'Name="_case"')
62
+ .replace('Name="false"', 'Name="_false"')
63
+ .replace('Name="if"', 'Name="_if"')
64
+ .replace('Name="return"', 'Name="_return"')
65
+ .replace('Name="true"', 'Name="_true"');
66
+
54
67
  // Write the file
55
- fs.writeFileSync("graph.xml", data);
68
+ fs.writeFileSync("graph.xml", content);
56
69
 
57
70
  // Log
58
71
  console.log("Graph metadata updated.");