(cb)
| 7143 | return profile; |
| 7144 | } |
| 7145 | function disableCPUProfiler(cb) { |
| 7146 | if (activeSession && activeSession !== "stopping") { |
| 7147 | var s_1 = activeSession; |
| 7148 | activeSession.post("Profiler.stop", function (err, _a) { |
| 7149 | var _b; |
| 7150 | var profile = _a.profile; |
| 7151 | if (!err) { |
| 7152 | try { |
| 7153 | if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) { |
| 7154 | profilePath = _path.join(profilePath, "".concat((new Date()).toISOString().replace(/:/g, "-"), "+P").concat(process.pid, ".cpuprofile")); |
| 7155 | } |
| 7156 | } |
| 7157 | catch (_c) { |
| 7158 | // do nothing and ignore fallible fs operation |
| 7159 | } |
| 7160 | try { |
| 7161 | _fs.mkdirSync(_path.dirname(profilePath), { recursive: true }); |
| 7162 | } |
| 7163 | catch (_d) { |
| 7164 | // do nothing and ignore fallible fs operation |
| 7165 | } |
| 7166 | _fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile))); |
| 7167 | } |
| 7168 | activeSession = undefined; |
| 7169 | s_1.disconnect(); |
| 7170 | cb(); |
| 7171 | }); |
| 7172 | activeSession = "stopping"; |
| 7173 | return true; |
| 7174 | } |
| 7175 | else { |
| 7176 | cb(); |
| 7177 | return false; |
| 7178 | } |
| 7179 | } |
| 7180 | function bufferFrom(input, encoding) { |
| 7181 | // See https://github.com/Microsoft/TypeScript/issues/25652 |
| 7182 | return Buffer.from && Buffer.from !== Int8Array.from |
no test coverage detected
searching dependent graphs…