massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / prettier-eslint / node_modules / typescript / lib / tsserverlibrary.js
index f64190056973000912c11bfb32bde63e8d103305..0ffb92ce37b5713480d03c42da1e2c94d8721fd2 100644 (file)
@@ -244,7 +244,7 @@ var ts;
     // If changing the text in this section, be sure to test `configurePrerelease` too.
     ts.versionMajorMinor = "3.9";
     /** The version of the TypeScript compiler release */
-    ts.version = "3.9.9";
+    ts.version = "3.9.10";
     /**
      * Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
      */
@@ -5666,8 +5666,8 @@ var ts;
                 },
                 getFileSize: function (path) {
                     try {
-                        var stat = _fs.statSync(path);
-                        if (stat.isFile()) {
+                        var stat = statSync(path);
+                        if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
                             return stat.size;
                         }
                     }
@@ -5713,6 +5713,15 @@ var ts;
                 }
             };
             return nodeSystem;
+            /**
+             * `throwIfNoEntry` was added so recently that it's not in the node types.
+             * This helper encapsulates the mitigating usage of `any`.
+             * See https://github.com/nodejs/node/pull/33716
+             */
+            function statSync(path) {
+                // throwIfNoEntry will be ignored by older versions of node
+                return _fs.statSync(path, { throwIfNoEntry: false });
+            }
             /**
              * Uses the builtin inspector APIs to capture a CPU profile
              * See https://nodejs.org/api/inspector.html#inspector_example_usage for details
@@ -5767,20 +5776,21 @@ var ts;
                 if (activeSession && activeSession !== "stopping") {
                     var s_1 = activeSession;
                     activeSession.post("Profiler.stop", function (err, _a) {
+                        var _b;
                         var profile = _a.profile;
                         if (!err) {
                             try {
-                                if (_fs.statSync(profilePath).isDirectory()) {
+                                if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
                                     profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
                                 }
                             }
-                            catch (_b) {
+                            catch (_c) {
                                 // do nothing and ignore fallible fs operation
                             }
                             try {
                                 _fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
                             }
-                            catch (_c) {
+                            catch (_d) {
                                 // do nothing and ignore fallible fs operation
                             }
                             _fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
@@ -6019,7 +6029,10 @@ var ts;
                         if (typeof dirent === "string" || dirent.isSymbolicLink()) {
                             var name = ts.combinePaths(path, entry);
                             try {
-                                stat = _fs.statSync(name);
+                                stat = statSync(name);
+                                if (!stat) {
+                                    continue;
+                                }
                             }
                             catch (e) {
                                 continue;
@@ -6048,7 +6061,10 @@ var ts;
             }
             function fileSystemEntryExists(path, entryKind) {
                 try {
-                    var stat = _fs.statSync(path);
+                    var stat = statSync(path);
+                    if (!stat) {
+                        return false;
+                    }
                     switch (entryKind) {
                         case 0 /* File */: return stat.isFile();
                         case 1 /* Directory */: return stat.isDirectory();
@@ -6077,8 +6093,9 @@ var ts;
                 }
             }
             function getModifiedTime(path) {
+                var _a;
                 try {
-                    return _fs.statSync(path).mtime;
+                    return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
                 }
                 catch (e) {
                     return undefined;