patchright-core 1.50.1 → 1.51.0

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.
Files changed (242) hide show
  1. package/ThirdPartyNotices.txt +1 -43
  2. package/browsers.json +22 -10
  3. package/index.js +0 -1
  4. package/lib/androidServerImpl.js +4 -4
  5. package/lib/browserServerImpl.js +18 -9
  6. package/lib/cli/driver.js +6 -6
  7. package/lib/cli/program.js +9 -9
  8. package/lib/cli/programWithTestStub.js +2 -1
  9. package/lib/client/android.js +37 -58
  10. package/lib/client/artifact.js +4 -7
  11. package/lib/client/browser.js +10 -15
  12. package/lib/client/browserContext.js +77 -73
  13. package/lib/client/browserType.js +30 -64
  14. package/lib/client/channelOwner.js +23 -20
  15. package/lib/client/clientHelper.js +5 -7
  16. package/lib/client/clientStackTrace.js +65 -0
  17. package/lib/client/connection.js +46 -39
  18. package/lib/client/consoleMessage.js +4 -7
  19. package/lib/client/electron.js +10 -10
  20. package/lib/client/elementHandle.js +32 -33
  21. package/lib/client/errors.js +2 -2
  22. package/lib/client/eventEmitter.js +5 -8
  23. package/lib/client/fetch.js +60 -61
  24. package/lib/client/fileUtils.js +31 -0
  25. package/lib/client/frame.js +30 -29
  26. package/lib/client/harRouter.js +7 -9
  27. package/lib/client/jsHandle.js +3 -4
  28. package/lib/client/localUtils.js +24 -0
  29. package/lib/client/locator.js +37 -18
  30. package/lib/client/network.js +40 -40
  31. package/lib/client/page.js +59 -55
  32. package/lib/client/platform.js +71 -0
  33. package/lib/client/playwright.js +21 -1
  34. package/lib/client/selectors.js +8 -2
  35. package/lib/client/stream.js +2 -21
  36. package/lib/client/timeoutSettings.js +65 -0
  37. package/lib/client/tracing.js +10 -7
  38. package/lib/client/video.js +2 -2
  39. package/lib/client/waiter.js +5 -6
  40. package/lib/client/webSocket.js +106 -0
  41. package/lib/client/worker.js +12 -10
  42. package/lib/client/writableStream.js +2 -21
  43. package/lib/generated/consoleApiSource.js +1 -1
  44. package/lib/generated/injectedScriptSource.js +1 -1
  45. package/lib/inProcessFactory.js +6 -3
  46. package/lib/outofprocess.js +12 -8
  47. package/lib/protocol/validator.js +64 -13
  48. package/lib/protocol/validatorPrimitives.js +1 -2
  49. package/lib/remote/playwrightConnection.js +18 -10
  50. package/lib/remote/playwrightServer.js +20 -7
  51. package/lib/server/android/android.js +17 -14
  52. package/lib/server/android/backendAdb.js +14 -14
  53. package/lib/server/artifact.js +3 -3
  54. package/lib/server/bidi/bidiBrowser.js +2 -2
  55. package/lib/server/bidi/bidiChromium.js +4 -3
  56. package/lib/server/bidi/bidiConnection.js +1 -1
  57. package/lib/server/bidi/bidiExecutionContext.js +70 -40
  58. package/lib/server/bidi/bidiFirefox.js +4 -3
  59. package/lib/server/bidi/bidiInput.js +5 -8
  60. package/lib/server/bidi/bidiNetworkManager.js +3 -3
  61. package/lib/server/bidi/bidiOverCdp.js +2 -2
  62. package/lib/server/bidi/bidiPage.js +30 -46
  63. package/lib/server/bidi/third_party/firefoxPrefs.js +19 -3
  64. package/lib/server/browser.js +2 -2
  65. package/lib/server/browserContext.js +37 -40
  66. package/lib/server/browserType.js +18 -17
  67. package/lib/{utils/sequence.js → server/callLog.js} +18 -3
  68. package/lib/server/chromium/chromium.js +14 -14
  69. package/lib/server/chromium/chromiumSwitches.js +32 -1
  70. package/lib/server/chromium/crBrowser.js +15 -14
  71. package/lib/server/chromium/crConnection.js +2 -2
  72. package/lib/server/chromium/crCoverage.js +1 -1
  73. package/lib/server/chromium/crDevTools.js +1 -1
  74. package/lib/server/chromium/crDragDrop.js +1 -1
  75. package/lib/server/chromium/crExecutionContext.js +25 -17
  76. package/lib/server/chromium/crInput.js +2 -2
  77. package/lib/server/chromium/crNetworkManager.js +73 -26
  78. package/lib/server/chromium/crPage.js +22 -23
  79. package/lib/server/chromium/crPdf.js +1 -1
  80. package/lib/server/chromium/crProtocolHelper.js +3 -3
  81. package/lib/server/chromium/crServiceWorker.js +2 -2
  82. package/lib/server/chromium/videoRecorder.js +2 -2
  83. package/lib/server/clock.js +1 -1
  84. package/lib/server/codegen/javascript.js +1 -1
  85. package/lib/server/codegen/languages.js +2 -2
  86. package/lib/server/debugController.js +3 -3
  87. package/lib/server/deviceDescriptors.js +1 -1
  88. package/lib/server/deviceDescriptorsSource.json +131 -131
  89. package/lib/server/dispatchers/androidDispatcher.js +1 -1
  90. package/lib/server/dispatchers/artifactDispatcher.js +3 -3
  91. package/lib/server/dispatchers/browserContextDispatcher.js +19 -19
  92. package/lib/server/dispatchers/browserTypeDispatcher.js +1 -1
  93. package/lib/server/dispatchers/cdpSessionDispatcher.js +1 -1
  94. package/lib/server/dispatchers/dispatcher.js +27 -25
  95. package/lib/server/dispatchers/electronDispatcher.js +3 -3
  96. package/lib/server/dispatchers/elementHandlerDispatcher.js +7 -2
  97. package/lib/server/dispatchers/frameDispatcher.js +4 -4
  98. package/lib/server/dispatchers/jsHandleDispatcher.js +2 -2
  99. package/lib/server/dispatchers/jsonPipeDispatcher.js +2 -2
  100. package/lib/server/dispatchers/localUtilsDispatcher.js +25 -298
  101. package/lib/server/dispatchers/networkDispatchers.js +3 -3
  102. package/lib/server/dispatchers/pageDispatcher.js +11 -9
  103. package/lib/server/dispatchers/playwrightDispatcher.js +5 -5
  104. package/lib/server/dispatchers/streamDispatcher.js +4 -3
  105. package/lib/server/dispatchers/webSocketRouteDispatcher.js +8 -7
  106. package/lib/server/dispatchers/writableStreamDispatcher.js +5 -6
  107. package/lib/server/dom.js +18 -12
  108. package/lib/server/download.js +1 -1
  109. package/lib/server/electron/electron.js +17 -16
  110. package/lib/server/errors.js +1 -1
  111. package/lib/server/fetch.js +36 -25
  112. package/lib/server/fileUploadUtils.js +7 -4
  113. package/lib/server/firefox/ffBrowser.js +8 -2
  114. package/lib/server/firefox/ffConnection.js +1 -1
  115. package/lib/server/firefox/ffExecutionContext.js +25 -17
  116. package/lib/server/firefox/ffNetworkManager.js +2 -2
  117. package/lib/server/firefox/ffPage.js +15 -21
  118. package/lib/server/firefox/firefox.js +7 -9
  119. package/lib/server/frameSelectors.js +1 -1
  120. package/lib/server/frames.js +366 -209
  121. package/lib/server/har/harRecorder.js +4 -4
  122. package/lib/server/har/harTracer.js +7 -8
  123. package/lib/server/harBackend.js +157 -0
  124. package/lib/server/helper.js +2 -2
  125. package/lib/server/index.js +1 -8
  126. package/lib/server/input.js +1 -1
  127. package/lib/server/instrumentation.js +2 -2
  128. package/lib/server/isomorphic/utilityScriptSerializers.js +3 -0
  129. package/lib/server/javascript.js +46 -33
  130. package/lib/server/launchApp.js +2 -2
  131. package/lib/server/localUtils.js +203 -0
  132. package/lib/server/network.js +3 -3
  133. package/lib/server/page.js +41 -22
  134. package/lib/server/pipeTransport.js +1 -1
  135. package/lib/server/playwright.js +5 -5
  136. package/lib/server/progress.js +1 -1
  137. package/lib/server/protocolError.js +1 -1
  138. package/lib/server/recorder/contextRecorder.js +3 -3
  139. package/lib/server/recorder/recorderApp.js +18 -12
  140. package/lib/server/recorder/recorderCollection.js +3 -3
  141. package/lib/server/recorder/throttledFile.js +3 -4
  142. package/lib/server/recorder.js +7 -5
  143. package/lib/server/registry/browserFetcher.js +9 -7
  144. package/lib/server/registry/dependencies.js +15 -15
  145. package/lib/server/registry/index.js +38 -44
  146. package/lib/server/registry/oopDownloadBrowserMain.js +3 -3
  147. package/lib/server/screenshotter.js +1 -1
  148. package/lib/server/selectors.js +3 -3
  149. package/lib/server/socksClientCertificatesInterceptor.js +8 -8
  150. package/lib/server/socksInterceptor.js +8 -5
  151. package/lib/server/storageScript.js +160 -0
  152. package/lib/{common → server}/timeoutSettings.js +6 -5
  153. package/lib/server/trace/recorder/snapshotter.js +9 -8
  154. package/lib/server/trace/recorder/tracing.js +40 -31
  155. package/lib/server/trace/test/inMemorySnapshotter.js +4 -4
  156. package/lib/server/trace/viewer/traceViewer.js +13 -5
  157. package/lib/server/transport.js +2 -2
  158. package/lib/{utils → server/utils}/comparators.js +4 -4
  159. package/lib/{utils → server/utils}/crypto.js +4 -4
  160. package/lib/{utils → server/utils}/debug.js +4 -12
  161. package/lib/{utils → server/utils}/debugLogger.js +2 -2
  162. package/lib/{utils → server/utils}/env.js +4 -0
  163. package/lib/{utils → server/utils}/expectUtils.js +1 -1
  164. package/lib/{utils → server/utils}/fileUtils.js +4 -5
  165. package/lib/{utils/happy-eyeballs.js → server/utils/happyEyeballs.js} +22 -24
  166. package/lib/{utils → server/utils}/hostPlatform.js +1 -1
  167. package/lib/{utils → server/utils}/httpServer.js +8 -8
  168. package/lib/{utils → server/utils}/linuxUtils.js +3 -23
  169. package/lib/{utils → server/utils}/network.js +4 -4
  170. package/lib/server/utils/nodePlatform.js +140 -0
  171. package/lib/{protocol/transport.js → server/utils/pipeTransport.js} +2 -2
  172. package/lib/{utils → server/utils}/processLauncher.js +5 -5
  173. package/lib/{utils → server/utils}/profiler.js +5 -6
  174. package/lib/{common → server/utils}/socksProxy.js +10 -9
  175. package/lib/{utils → server/utils}/userAgent.js +2 -16
  176. package/lib/{utils → server/utils}/wsServer.js +3 -3
  177. package/lib/{utils → server/utils}/zipFile.js +1 -1
  178. package/lib/{utils → server/utils}/zones.js +9 -24
  179. package/lib/server/webkit/webkit.js +4 -4
  180. package/lib/server/webkit/wkBrowser.js +4 -4
  181. package/lib/server/webkit/wkConnection.js +1 -1
  182. package/lib/server/webkit/wkExecutionContext.js +25 -17
  183. package/lib/server/webkit/wkInput.js +2 -2
  184. package/lib/server/webkit/wkInterceptableRequest.js +2 -2
  185. package/lib/server/webkit/wkPage.js +41 -40
  186. package/lib/server/webkit/wkProvisionalPage.js +1 -1
  187. package/lib/server/webkit/wkWorkers.js +2 -2
  188. package/lib/utils/isomorphic/ariaSnapshot.js +2 -1
  189. package/lib/utils/isomorphic/assert.js +25 -0
  190. package/lib/utils/isomorphic/colors.js +65 -0
  191. package/lib/utils/isomorphic/cssParser.js +1 -1
  192. package/lib/utils/isomorphic/locatorGenerators.js +13 -1
  193. package/lib/utils/isomorphic/locatorParser.js +2 -2
  194. package/lib/utils/{manualPromise.js → isomorphic/manualPromise.js} +3 -5
  195. package/lib/utils/isomorphic/mimeType.js +11 -3
  196. package/lib/utils/{multimap.js → isomorphic/multimap.js} +1 -3
  197. package/lib/utils/{rtti.js → isomorphic/rtti.js} +2 -5
  198. package/lib/utils/isomorphic/stackTrace.js +169 -0
  199. package/lib/utils/isomorphic/stringUtils.js +1 -1
  200. package/lib/utils/{time.js → isomorphic/time.js} +1 -13
  201. package/lib/utils/{timeoutRunner.js → isomorphic/timeoutRunner.js} +4 -4
  202. package/lib/utils/isomorphic/traceUtils.js +23 -0
  203. package/lib/{utils/index.js → utils.js} +200 -121
  204. package/lib/utilsBundle.js +1 -25
  205. package/lib/utilsBundleImpl/index.js +114 -116
  206. package/lib/vite/htmlReport/index.html +20 -20
  207. package/lib/vite/recorder/assets/codeMirrorModule-B9YMkrwa.js +24 -0
  208. package/lib/vite/recorder/assets/index-ELPgmkwA.js +184 -0
  209. package/lib/vite/recorder/index.html +1 -1
  210. package/lib/vite/traceViewer/assets/codeMirrorModule-DpJ-EmBQ.js +24 -0
  211. package/lib/vite/traceViewer/assets/defaultSettingsView-DTenqiGw.js +259 -0
  212. package/lib/vite/traceViewer/assets/{xtermModule-c-SNdYZy.js → xtermModule-BoAIEibi.js} +7 -7
  213. package/lib/vite/traceViewer/defaultSettingsView.5fN5lw10.css +1 -0
  214. package/lib/vite/traceViewer/index.CUq7VgrV.js +2 -0
  215. package/lib/vite/traceViewer/index.html +3 -3
  216. package/lib/vite/traceViewer/sw.bundle.js +3 -3
  217. package/lib/vite/traceViewer/uiMode.CHJSAD7F.js +5 -0
  218. package/lib/vite/traceViewer/uiMode.html +3 -3
  219. package/lib/zipBundleImpl.js +4 -4
  220. package/package.json +7 -7
  221. package/types/protocol.d.ts +123 -99
  222. package/types/types.d.ts +91 -37
  223. package/lib/utils/stackTrace.js +0 -134
  224. package/lib/utils/traceUtils.js +0 -44
  225. package/lib/vite/recorder/assets/codeMirrorModule-CNAqJrkA.js +0 -24
  226. package/lib/vite/recorder/assets/index-DGS0JLxS.js +0 -184
  227. package/lib/vite/traceViewer/assets/codeMirrorModule-D55P_UuL.js +0 -24
  228. package/lib/vite/traceViewer/assets/defaultSettingsView-B-uNoFsX.js +0 -243
  229. package/lib/vite/traceViewer/defaultSettingsView.2xeEXCXv.css +0 -1
  230. package/lib/vite/traceViewer/index.BfvuujqP.js +0 -2
  231. package/lib/vite/traceViewer/uiMode.CStJu6jo.js +0 -5
  232. /package/lib/{utils → server/utils}/ascii.js +0 -0
  233. /package/lib/{utils → server/utils}/eventsHelper.js +0 -0
  234. /package/lib/{image_tools → server/utils/image_tools}/colorUtils.js +0 -0
  235. /package/lib/{image_tools → server/utils/image_tools}/compare.js +0 -0
  236. /package/lib/{image_tools → server/utils/image_tools}/imageChannel.js +0 -0
  237. /package/lib/{image_tools → server/utils/image_tools}/stats.js +0 -0
  238. /package/lib/{utils → server/utils}/spawnAsync.js +0 -0
  239. /package/lib/{utils → server/utils}/task.js +0 -0
  240. /package/lib/utils/{headers.js → isomorphic/headers.js} +0 -0
  241. /package/lib/utils/{semaphore.js → isomorphic/semaphore.js} +0 -0
  242. /package/lib/{common → utils/isomorphic}/types.js +0 -0
@@ -3,19 +3,20 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.getMimeTypeForPath = getMimeTypeForPath;
6
7
  exports.isJsonMimeType = isJsonMimeType;
7
8
  exports.isTextualMimeType = isTextualMimeType;
8
9
  /**
9
10
  * Copyright (c) Microsoft Corporation.
10
11
  *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
+ * Licensed under the Apache License, Version 2.0 (the 'License');
12
13
  * you may not use this file except in compliance with the License.
13
14
  * You may obtain a copy of the License at
14
15
  *
15
16
  * http://www.apache.org/licenses/LICENSE-2.0
16
17
  *
17
18
  * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
+ * distributed under the License is distributed on an 'AS IS' BASIS,
19
20
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
21
  * See the License for the specific language governing permissions and
21
22
  * limitations under the License.
@@ -26,4 +27,11 @@ function isJsonMimeType(mimeType) {
26
27
  }
27
28
  function isTextualMimeType(mimeType) {
28
29
  return !!mimeType.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/);
29
- }
30
+ }
31
+ function getMimeTypeForPath(path) {
32
+ const dotIndex = path.lastIndexOf('.');
33
+ if (dotIndex === -1) return null;
34
+ const extension = path.substring(dotIndex + 1);
35
+ return types.get(extension) || null;
36
+ }
37
+ const types = new Map([['ez', 'application/andrew-inset'], ['aw', 'application/applixware'], ['atom', 'application/atom+xml'], ['atomcat', 'application/atomcat+xml'], ['atomdeleted', 'application/atomdeleted+xml'], ['atomsvc', 'application/atomsvc+xml'], ['dwd', 'application/atsc-dwd+xml'], ['held', 'application/atsc-held+xml'], ['rsat', 'application/atsc-rsat+xml'], ['bdoc', 'application/bdoc'], ['xcs', 'application/calendar+xml'], ['ccxml', 'application/ccxml+xml'], ['cdfx', 'application/cdfx+xml'], ['cdmia', 'application/cdmi-capability'], ['cdmic', 'application/cdmi-container'], ['cdmid', 'application/cdmi-domain'], ['cdmio', 'application/cdmi-object'], ['cdmiq', 'application/cdmi-queue'], ['cu', 'application/cu-seeme'], ['mpd', 'application/dash+xml'], ['davmount', 'application/davmount+xml'], ['dbk', 'application/docbook+xml'], ['dssc', 'application/dssc+der'], ['xdssc', 'application/dssc+xml'], ['ecma', 'application/ecmascript'], ['es', 'application/ecmascript'], ['emma', 'application/emma+xml'], ['emotionml', 'application/emotionml+xml'], ['epub', 'application/epub+zip'], ['exi', 'application/exi'], ['exp', 'application/express'], ['fdt', 'application/fdt+xml'], ['pfr', 'application/font-tdpfr'], ['geojson', 'application/geo+json'], ['gml', 'application/gml+xml'], ['gpx', 'application/gpx+xml'], ['gxf', 'application/gxf'], ['gz', 'application/gzip'], ['hjson', 'application/hjson'], ['stk', 'application/hyperstudio'], ['ink', 'application/inkml+xml'], ['inkml', 'application/inkml+xml'], ['ipfix', 'application/ipfix'], ['its', 'application/its+xml'], ['ear', 'application/java-archive'], ['jar', 'application/java-archive'], ['war', 'application/java-archive'], ['ser', 'application/java-serialized-object'], ['class', 'application/java-vm'], ['js', 'application/javascript'], ['mjs', 'application/javascript'], ['json', 'application/json'], ['map', 'application/json'], ['json5', 'application/json5'], ['jsonml', 'application/jsonml+json'], ['jsonld', 'application/ld+json'], ['lgr', 'application/lgr+xml'], ['lostxml', 'application/lost+xml'], ['hqx', 'application/mac-binhex40'], ['cpt', 'application/mac-compactpro'], ['mads', 'application/mads+xml'], ['webmanifest', 'application/manifest+json'], ['mrc', 'application/marc'], ['mrcx', 'application/marcxml+xml'], ['ma', 'application/mathematica'], ['mb', 'application/mathematica'], ['nb', 'application/mathematica'], ['mathml', 'application/mathml+xml'], ['mbox', 'application/mbox'], ['mscml', 'application/mediaservercontrol+xml'], ['metalink', 'application/metalink+xml'], ['meta4', 'application/metalink4+xml'], ['mets', 'application/mets+xml'], ['maei', 'application/mmt-aei+xml'], ['musd', 'application/mmt-usd+xml'], ['mods', 'application/mods+xml'], ['m21', 'application/mp21'], ['mp21', 'application/mp21'], ['m4p', 'application/mp4'], ['mp4s', 'application/mp4'], ['doc', 'application/msword'], ['dot', 'application/msword'], ['mxf', 'application/mxf'], ['nq', 'application/n-quads'], ['nt', 'application/n-triples'], ['cjs', 'application/node'], ['bin', 'application/octet-stream'], ['bpk', 'application/octet-stream'], ['buffer', 'application/octet-stream'], ['deb', 'application/octet-stream'], ['deploy', 'application/octet-stream'], ['dist', 'application/octet-stream'], ['distz', 'application/octet-stream'], ['dll', 'application/octet-stream'], ['dmg', 'application/octet-stream'], ['dms', 'application/octet-stream'], ['dump', 'application/octet-stream'], ['elc', 'application/octet-stream'], ['exe', 'application/octet-stream'], ['img', 'application/octet-stream'], ['iso', 'application/octet-stream'], ['lrf', 'application/octet-stream'], ['mar', 'application/octet-stream'], ['msi', 'application/octet-stream'], ['msm', 'application/octet-stream'], ['msp', 'application/octet-stream'], ['pkg', 'application/octet-stream'], ['so', 'application/octet-stream'], ['oda', 'application/oda'], ['opf', 'application/oebps-package+xml'], ['ogx', 'application/ogg'], ['omdoc', 'application/omdoc+xml'], ['onepkg', 'application/onenote'], ['onetmp', 'application/onenote'], ['onetoc', 'application/onenote'], ['onetoc2', 'application/onenote'], ['oxps', 'application/oxps'], ['relo', 'application/p2p-overlay+xml'], ['xer', 'application/patch-ops-error+xml'], ['pdf', 'application/pdf'], ['pgp', 'application/pgp-encrypted'], ['asc', 'application/pgp-signature'], ['sig', 'application/pgp-signature'], ['prf', 'application/pics-rules'], ['p10', 'application/pkcs10'], ['p7c', 'application/pkcs7-mime'], ['p7m', 'application/pkcs7-mime'], ['p7s', 'application/pkcs7-signature'], ['p8', 'application/pkcs8'], ['ac', 'application/pkix-attr-cert'], ['cer', 'application/pkix-cert'], ['crl', 'application/pkix-crl'], ['pkipath', 'application/pkix-pkipath'], ['pki', 'application/pkixcmp'], ['pls', 'application/pls+xml'], ['ai', 'application/postscript'], ['eps', 'application/postscript'], ['ps', 'application/postscript'], ['provx', 'application/provenance+xml'], ['pskcxml', 'application/pskc+xml'], ['raml', 'application/raml+yaml'], ['owl', 'application/rdf+xml'], ['rdf', 'application/rdf+xml'], ['rif', 'application/reginfo+xml'], ['rnc', 'application/relax-ng-compact-syntax'], ['rl', 'application/resource-lists+xml'], ['rld', 'application/resource-lists-diff+xml'], ['rs', 'application/rls-services+xml'], ['rapd', 'application/route-apd+xml'], ['sls', 'application/route-s-tsid+xml'], ['rusd', 'application/route-usd+xml'], ['gbr', 'application/rpki-ghostbusters'], ['mft', 'application/rpki-manifest'], ['roa', 'application/rpki-roa'], ['rsd', 'application/rsd+xml'], ['rss', 'application/rss+xml'], ['rtf', 'application/rtf'], ['sbml', 'application/sbml+xml'], ['scq', 'application/scvp-cv-request'], ['scs', 'application/scvp-cv-response'], ['spq', 'application/scvp-vp-request'], ['spp', 'application/scvp-vp-response'], ['sdp', 'application/sdp'], ['senmlx', 'application/senml+xml'], ['sensmlx', 'application/sensml+xml'], ['setpay', 'application/set-payment-initiation'], ['setreg', 'application/set-registration-initiation'], ['shf', 'application/shf+xml'], ['sieve', 'application/sieve'], ['siv', 'application/sieve'], ['smi', 'application/smil+xml'], ['smil', 'application/smil+xml'], ['rq', 'application/sparql-query'], ['srx', 'application/sparql-results+xml'], ['gram', 'application/srgs'], ['grxml', 'application/srgs+xml'], ['sru', 'application/sru+xml'], ['ssdl', 'application/ssdl+xml'], ['ssml', 'application/ssml+xml'], ['swidtag', 'application/swid+xml'], ['tei', 'application/tei+xml'], ['teicorpus', 'application/tei+xml'], ['tfi', 'application/thraud+xml'], ['tsd', 'application/timestamped-data'], ['toml', 'application/toml'], ['trig', 'application/trig'], ['ttml', 'application/ttml+xml'], ['ubj', 'application/ubjson'], ['rsheet', 'application/urc-ressheet+xml'], ['td', 'application/urc-targetdesc+xml'], ['vxml', 'application/voicexml+xml'], ['wasm', 'application/wasm'], ['wgt', 'application/widget'], ['hlp', 'application/winhlp'], ['wsdl', 'application/wsdl+xml'], ['wspolicy', 'application/wspolicy+xml'], ['xaml', 'application/xaml+xml'], ['xav', 'application/xcap-att+xml'], ['xca', 'application/xcap-caps+xml'], ['xdf', 'application/xcap-diff+xml'], ['xel', 'application/xcap-el+xml'], ['xns', 'application/xcap-ns+xml'], ['xenc', 'application/xenc+xml'], ['xht', 'application/xhtml+xml'], ['xhtml', 'application/xhtml+xml'], ['xlf', 'application/xliff+xml'], ['rng', 'application/xml'], ['xml', 'application/xml'], ['xsd', 'application/xml'], ['xsl', 'application/xml'], ['dtd', 'application/xml-dtd'], ['xop', 'application/xop+xml'], ['xpl', 'application/xproc+xml'], ['*xsl', 'application/xslt+xml'], ['xslt', 'application/xslt+xml'], ['xspf', 'application/xspf+xml'], ['mxml', 'application/xv+xml'], ['xhvml', 'application/xv+xml'], ['xvm', 'application/xv+xml'], ['xvml', 'application/xv+xml'], ['yang', 'application/yang'], ['yin', 'application/yin+xml'], ['zip', 'application/zip'], ['*3gpp', 'audio/3gpp'], ['adp', 'audio/adpcm'], ['amr', 'audio/amr'], ['au', 'audio/basic'], ['snd', 'audio/basic'], ['kar', 'audio/midi'], ['mid', 'audio/midi'], ['midi', 'audio/midi'], ['rmi', 'audio/midi'], ['mxmf', 'audio/mobile-xmf'], ['*mp3', 'audio/mp3'], ['m4a', 'audio/mp4'], ['mp4a', 'audio/mp4'], ['m2a', 'audio/mpeg'], ['m3a', 'audio/mpeg'], ['mp2', 'audio/mpeg'], ['mp2a', 'audio/mpeg'], ['mp3', 'audio/mpeg'], ['mpga', 'audio/mpeg'], ['oga', 'audio/ogg'], ['ogg', 'audio/ogg'], ['opus', 'audio/ogg'], ['spx', 'audio/ogg'], ['s3m', 'audio/s3m'], ['sil', 'audio/silk'], ['wav', 'audio/wav'], ['*wav', 'audio/wave'], ['weba', 'audio/webm'], ['xm', 'audio/xm'], ['ttc', 'font/collection'], ['otf', 'font/otf'], ['ttf', 'font/ttf'], ['woff', 'font/woff'], ['woff2', 'font/woff2'], ['exr', 'image/aces'], ['apng', 'image/apng'], ['avif', 'image/avif'], ['bmp', 'image/bmp'], ['cgm', 'image/cgm'], ['drle', 'image/dicom-rle'], ['emf', 'image/emf'], ['fits', 'image/fits'], ['g3', 'image/g3fax'], ['gif', 'image/gif'], ['heic', 'image/heic'], ['heics', 'image/heic-sequence'], ['heif', 'image/heif'], ['heifs', 'image/heif-sequence'], ['hej2', 'image/hej2k'], ['hsj2', 'image/hsj2'], ['ief', 'image/ief'], ['jls', 'image/jls'], ['jp2', 'image/jp2'], ['jpg2', 'image/jp2'], ['jpe', 'image/jpeg'], ['jpeg', 'image/jpeg'], ['jpg', 'image/jpeg'], ['jph', 'image/jph'], ['jhc', 'image/jphc'], ['jpm', 'image/jpm'], ['jpf', 'image/jpx'], ['jpx', 'image/jpx'], ['jxr', 'image/jxr'], ['jxra', 'image/jxra'], ['jxrs', 'image/jxrs'], ['jxs', 'image/jxs'], ['jxsc', 'image/jxsc'], ['jxsi', 'image/jxsi'], ['jxss', 'image/jxss'], ['ktx', 'image/ktx'], ['ktx2', 'image/ktx2'], ['png', 'image/png'], ['sgi', 'image/sgi'], ['svg', 'image/svg+xml'], ['svgz', 'image/svg+xml'], ['t38', 'image/t38'], ['tif', 'image/tiff'], ['tiff', 'image/tiff'], ['tfx', 'image/tiff-fx'], ['webp', 'image/webp'], ['wmf', 'image/wmf'], ['disposition-notification', 'message/disposition-notification'], ['u8msg', 'message/global'], ['u8dsn', 'message/global-delivery-status'], ['u8mdn', 'message/global-disposition-notification'], ['u8hdr', 'message/global-headers'], ['eml', 'message/rfc822'], ['mime', 'message/rfc822'], ['3mf', 'model/3mf'], ['gltf', 'model/gltf+json'], ['glb', 'model/gltf-binary'], ['iges', 'model/iges'], ['igs', 'model/iges'], ['mesh', 'model/mesh'], ['msh', 'model/mesh'], ['silo', 'model/mesh'], ['mtl', 'model/mtl'], ['obj', 'model/obj'], ['stpx', 'model/step+xml'], ['stpz', 'model/step+zip'], ['stpxz', 'model/step-xml+zip'], ['stl', 'model/stl'], ['vrml', 'model/vrml'], ['wrl', 'model/vrml'], ['*x3db', 'model/x3d+binary'], ['x3dbz', 'model/x3d+binary'], ['x3db', 'model/x3d+fastinfoset'], ['*x3dv', 'model/x3d+vrml'], ['x3dvz', 'model/x3d+vrml'], ['x3d', 'model/x3d+xml'], ['x3dz', 'model/x3d+xml'], ['x3dv', 'model/x3d-vrml'], ['appcache', 'text/cache-manifest'], ['manifest', 'text/cache-manifest'], ['ics', 'text/calendar'], ['ifb', 'text/calendar'], ['coffee', 'text/coffeescript'], ['litcoffee', 'text/coffeescript'], ['css', 'text/css'], ['csv', 'text/csv'], ['htm', 'text/html'], ['html', 'text/html'], ['shtml', 'text/html'], ['jade', 'text/jade'], ['jsx', 'text/jsx'], ['less', 'text/less'], ['markdown', 'text/markdown'], ['md', 'text/markdown'], ['mml', 'text/mathml'], ['mdx', 'text/mdx'], ['n3', 'text/n3'], ['conf', 'text/plain'], ['def', 'text/plain'], ['in', 'text/plain'], ['ini', 'text/plain'], ['list', 'text/plain'], ['log', 'text/plain'], ['text', 'text/plain'], ['txt', 'text/plain'], ['rtx', 'text/richtext'], ['*rtf', 'text/rtf'], ['sgm', 'text/sgml'], ['sgml', 'text/sgml'], ['shex', 'text/shex'], ['slim', 'text/slim'], ['slm', 'text/slim'], ['spdx', 'text/spdx'], ['styl', 'text/stylus'], ['stylus', 'text/stylus'], ['tsv', 'text/tab-separated-values'], ['man', 'text/troff'], ['me', 'text/troff'], ['ms', 'text/troff'], ['roff', 'text/troff'], ['t', 'text/troff'], ['tr', 'text/troff'], ['ttl', 'text/turtle'], ['uri', 'text/uri-list'], ['uris', 'text/uri-list'], ['urls', 'text/uri-list'], ['vcard', 'text/vcard'], ['vtt', 'text/vtt'], ['*xml', 'text/xml'], ['yaml', 'text/yaml'], ['yml', 'text/yaml'], ['3gp', 'video/3gpp'], ['3gpp', 'video/3gpp'], ['3g2', 'video/3gpp2'], ['h261', 'video/h261'], ['h263', 'video/h263'], ['h264', 'video/h264'], ['m4s', 'video/iso.segment'], ['jpgv', 'video/jpeg'], ['jpm', 'video/jpm'], ['jpgm', 'video/jpm'], ['mj2', 'video/mj2'], ['mjp2', 'video/mj2'], ['ts', 'video/mp2t'], ['mp4', 'video/mp4'], ['mp4v', 'video/mp4'], ['mpg4', 'video/mp4'], ['m1v', 'video/mpeg'], ['m2v', 'video/mpeg'], ['mpe', 'video/mpeg'], ['mpeg', 'video/mpeg'], ['mpg', 'video/mpeg'], ['ogv', 'video/ogg'], ['mov', 'video/quicktime'], ['qt', 'video/quicktime'], ['webm', 'video/webm']]);
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.MultiMap = void 0;
7
- let _Symbol$iterator;
8
- _Symbol$iterator = Symbol.iterator;
9
7
  /**
10
8
  * Copyright (c) Microsoft Corporation.
11
9
  *
@@ -57,7 +55,7 @@ class MultiMap {
57
55
  get size() {
58
56
  return this._map.size;
59
57
  }
60
- [_Symbol$iterator]() {
58
+ [Symbol.iterator]() {
61
59
  return this._map[Symbol.iterator]();
62
60
  }
63
61
  keys() {
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isError = isError;
7
- exports.isLikelyNpxGlobal = void 0;
8
7
  exports.isObject = isObject;
9
8
  exports.isRegExp = isRegExp;
10
9
  Object.defineProperty(exports, "isString", {
@@ -13,7 +12,7 @@ Object.defineProperty(exports, "isString", {
13
12
  return _stringUtils.isString;
14
13
  }
15
14
  });
16
- var _stringUtils = require("./isomorphic/stringUtils");
15
+ var _stringUtils = require("./stringUtils");
17
16
  /**
18
17
  * Copyright (c) Microsoft Corporation.
19
18
  *
@@ -39,6 +38,4 @@ function isObject(obj) {
39
38
  function isError(obj) {
40
39
  var _Object$getPrototypeO;
41
40
  return obj instanceof Error || obj && ((_Object$getPrototypeO = Object.getPrototypeOf(obj)) === null || _Object$getPrototypeO === void 0 ? void 0 : _Object$getPrototypeO.name) === 'Error';
42
- }
43
- const isLikelyNpxGlobal = () => process.argv.length >= 2 && process.argv[1].includes('_npx');
44
- exports.isLikelyNpxGlobal = isLikelyNpxGlobal;
41
+ }
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.captureRawStack = captureRawStack;
7
+ exports.parseErrorStack = parseErrorStack;
8
+ exports.parseStackFrame = parseStackFrame;
9
+ exports.rewriteErrorMessage = rewriteErrorMessage;
10
+ exports.splitErrorMessage = splitErrorMessage;
11
+ exports.stringifyStackFrames = stringifyStackFrames;
12
+ /**
13
+ * The MIT License (MIT)
14
+ * Modifications copyright (c) Microsoft Corporation.
15
+ *
16
+ * Copyright (c) 2016-2023 Isaac Z. Schlueter i@izs.me, James Talmage james@talmage.io (github.com/jamestalmage), and
17
+ * Contributors
18
+ *
19
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
20
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
21
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
22
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
23
+ *
24
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
25
+ * Software.
26
+ *
27
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
28
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
29
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
30
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31
+ */
32
+
33
+ function captureRawStack() {
34
+ const stackTraceLimit = Error.stackTraceLimit;
35
+ Error.stackTraceLimit = 50;
36
+ const error = new Error();
37
+ const stack = error.stack || '';
38
+ Error.stackTraceLimit = stackTraceLimit;
39
+ return stack.split('\n');
40
+ }
41
+ function parseStackFrame(text, pathSeparator, showInternalStackFrames) {
42
+ const match = text && text.match(re);
43
+ if (!match) return null;
44
+ let fname = match[2];
45
+ let file = match[7];
46
+ if (!file) return null;
47
+ if (!showInternalStackFrames && (file.startsWith('internal') || file.startsWith('node:'))) return null;
48
+ const line = match[8];
49
+ const column = match[9];
50
+ const closeParen = match[11] === ')';
51
+ const frame = {
52
+ file: '',
53
+ line: 0,
54
+ column: 0
55
+ };
56
+ if (line) frame.line = Number(line);
57
+ if (column) frame.column = Number(column);
58
+ if (closeParen && file) {
59
+ // make sure parens are balanced
60
+ // if we have a file like "asdf) [as foo] (xyz.js", then odds are
61
+ // that the fname should be += " (asdf) [as foo]" and the file
62
+ // should be just "xyz.js"
63
+ // walk backwards from the end to find the last unbalanced (
64
+ let closes = 0;
65
+ for (let i = file.length - 1; i > 0; i--) {
66
+ if (file.charAt(i) === ')') {
67
+ closes++;
68
+ } else if (file.charAt(i) === '(' && file.charAt(i - 1) === ' ') {
69
+ closes--;
70
+ if (closes === -1 && file.charAt(i - 1) === ' ') {
71
+ const before = file.slice(0, i - 1);
72
+ const after = file.slice(i + 1);
73
+ file = after;
74
+ fname += ` (${before}`;
75
+ break;
76
+ }
77
+ }
78
+ }
79
+ }
80
+ if (fname) {
81
+ const methodMatch = fname.match(methodRe);
82
+ if (methodMatch) fname = methodMatch[1];
83
+ }
84
+ if (file) {
85
+ if (file.startsWith('file://')) file = fileURLToPath(file, pathSeparator);
86
+ frame.file = file;
87
+ }
88
+ if (fname) frame.function = fname;
89
+ return frame;
90
+ }
91
+ function rewriteErrorMessage(e, newMessage) {
92
+ var _e$stack;
93
+ const lines = (((_e$stack = e.stack) === null || _e$stack === void 0 ? void 0 : _e$stack.split('\n')) || []).filter(l => l.startsWith(' at '));
94
+ e.message = newMessage;
95
+ const errorTitle = `${e.name}: ${e.message}`;
96
+ if (lines.length) e.stack = `${errorTitle}\n${lines.join('\n')}`;
97
+ return e;
98
+ }
99
+ function stringifyStackFrames(frames) {
100
+ const stackLines = [];
101
+ for (const frame of frames) {
102
+ if (frame.function) stackLines.push(` at ${frame.function} (${frame.file}:${frame.line}:${frame.column})`);else stackLines.push(` at ${frame.file}:${frame.line}:${frame.column}`);
103
+ }
104
+ return stackLines;
105
+ }
106
+ function splitErrorMessage(message) {
107
+ const separationIdx = message.indexOf(':');
108
+ return {
109
+ name: separationIdx !== -1 ? message.slice(0, separationIdx) : '',
110
+ message: separationIdx !== -1 && separationIdx + 2 <= message.length ? message.substring(separationIdx + 2) : message
111
+ };
112
+ }
113
+ function parseErrorStack(stack, pathSeparator, showInternalStackFrames = false) {
114
+ const lines = stack.split('\n');
115
+ let firstStackLine = lines.findIndex(line => line.startsWith(' at '));
116
+ if (firstStackLine === -1) firstStackLine = lines.length;
117
+ const message = lines.slice(0, firstStackLine).join('\n');
118
+ const stackLines = lines.slice(firstStackLine);
119
+ let location;
120
+ for (const line of stackLines) {
121
+ const frame = parseStackFrame(line, pathSeparator, showInternalStackFrames);
122
+ if (!frame || !frame.file) continue;
123
+ if (belongsToNodeModules(frame.file, pathSeparator)) continue;
124
+ location = {
125
+ file: frame.file,
126
+ column: frame.column || 0,
127
+ line: frame.line || 0
128
+ };
129
+ break;
130
+ }
131
+ return {
132
+ message,
133
+ stackLines,
134
+ location
135
+ };
136
+ }
137
+ function belongsToNodeModules(file, pathSeparator) {
138
+ return file.includes(`${pathSeparator}node_modules${pathSeparator}`);
139
+ }
140
+ const re = new RegExp('^' +
141
+ // Sometimes we strip out the ' at' because it's noisy
142
+ '(?:\\s*at )?' +
143
+ // $1 = ctor if 'new'
144
+ '(?:(new) )?' +
145
+ // $2 = function name (can be literally anything)
146
+ // May contain method at the end as [as xyz]
147
+ '(?:(.*?) \\()?' +
148
+ // (eval at <anonymous> (file.js:1:1),
149
+ // $3 = eval origin
150
+ // $4:$5:$6 are eval file/line/col, but not normally reported
151
+ '(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?' +
152
+ // file:line:col
153
+ // $7:$8:$9
154
+ // $10 = 'native' if native
155
+ '(?:(.+?):(\\d+):(\\d+)|(native))' +
156
+ // maybe close the paren, then end
157
+ // if $11 is ), then we only allow balanced parens in the filename
158
+ // any imbalance is placed on the fname. This is a heuristic, and
159
+ // bound to be incorrect in some edge cases. The bet is that
160
+ // having weird characters in method names is more common than
161
+ // having weird characters in filenames, which seems reasonable.
162
+ '(\\)?)$');
163
+ const methodRe = /^(.*?) \[as (.*?)\]$/;
164
+ function fileURLToPath(fileUrl, pathSeparator) {
165
+ if (!fileUrl.startsWith('file://')) return fileUrl;
166
+ let path = decodeURIComponent(fileUrl.slice(7));
167
+ if (path.startsWith('/') && /^[a-zA-Z]:/.test(path.slice(1))) path = path.slice(1);
168
+ return path.replace(/\//g, pathSeparator);
169
+ }
@@ -85,7 +85,7 @@ function normalizeWhiteSpace(text) {
85
85
  let result = (_normalizedWhitespace = normalizedWhitespaceCache) === null || _normalizedWhitespace === void 0 ? void 0 : _normalizedWhitespace.get(text);
86
86
  if (result === undefined) {
87
87
  var _normalizedWhitespace2;
88
- result = text.replace(/\u200b/g, '').trim().replace(/\s+/g, ' ');
88
+ result = text.replace(/[\u200b\u00ad]/g, '').trim().replace(/\s+/g, ' ');
89
89
  (_normalizedWhitespace2 = normalizedWhitespaceCache) === null || _normalizedWhitespace2 === void 0 || _normalizedWhitespace2.set(text, result);
90
90
  }
91
91
  return result;
@@ -20,18 +20,6 @@ exports.monotonicTime = monotonicTime;
20
20
  * limitations under the License.
21
21
  */
22
22
 
23
- // The `process.hrtime()` returns a time from some arbitrary
24
- // date in the past; on certain systems, this is the time from the system boot.
25
- // The `monotonicTime()` converts this to milliseconds.
26
- //
27
- // For a Linux server with uptime of 36 days, the `monotonicTime()` value
28
- // will be 36 * 86400 * 1000 = 3_110_400_000, which is larger than
29
- // the maximum value that `setTimeout` accepts as an argument: 2_147_483_647.
30
- //
31
- // To make the `monotonicTime()` a reasonable value, we anchor
32
- // it to the time of the first import of this utility.
33
- const initialTime = process.hrtime();
34
23
  function monotonicTime() {
35
- const [seconds, nanoseconds] = process.hrtime(initialTime);
36
- return seconds * 1000 + (nanoseconds / 1000 | 0) / 1000;
24
+ return (performance.now() * 1000 | 0) / 1000;
37
25
  }
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.pollAgainstDeadline = pollAgainstDeadline;
7
7
  exports.raceAgainstDeadline = raceAgainstDeadline;
8
- var _ = require("./");
8
+ var _time = require("./time");
9
9
  /**
10
10
  * Copyright (c) Microsoft Corporation.
11
11
  *
@@ -31,7 +31,7 @@ async function raceAgainstDeadline(cb, deadline) {
31
31
  };
32
32
  }), new Promise(resolve => {
33
33
  const kMaxDeadline = 2147483647; // 2^31-1
34
- const timeout = (deadline || kMaxDeadline) - (0, _.monotonicTime)();
34
+ const timeout = (deadline || kMaxDeadline) - (0, _time.monotonicTime)();
35
35
  timer = setTimeout(() => resolve({
36
36
  timedOut: true
37
37
  }), timeout);
@@ -46,7 +46,7 @@ async function pollAgainstDeadline(callback, deadline, pollIntervals = [100, 250
46
46
  const wrappedCallback = () => Promise.resolve().then(callback);
47
47
  while (true) {
48
48
  var _shift;
49
- const time = (0, _.monotonicTime)();
49
+ const time = (0, _time.monotonicTime)();
50
50
  if (deadline && time >= deadline) break;
51
51
  const received = await raceAgainstDeadline(wrappedCallback, deadline);
52
52
  if (received.timedOut) break;
@@ -56,7 +56,7 @@ async function pollAgainstDeadline(callback, deadline, pollIntervals = [100, 250
56
56
  timedOut: false
57
57
  };
58
58
  const interval = (_shift = pollIntervals.shift()) !== null && _shift !== void 0 ? _shift : lastPollInterval;
59
- if (deadline && deadline <= (0, _.monotonicTime)() + interval) break;
59
+ if (deadline && deadline <= (0, _time.monotonicTime)() + interval) break;
60
60
  await new Promise(x => setTimeout(x, interval));
61
61
  }
62
62
  return {
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.parseClientSideCallMetadata = parseClientSideCallMetadata;
7
+ exports.serializeClientSideCallMetadata = serializeClientSideCallMetadata;
7
8
  /**
8
9
  * Copyright (c) Microsoft Corporation.
9
10
  *
@@ -36,4 +37,26 @@ function parseClientSideCallMetadata(data) {
36
37
  })));
37
38
  }
38
39
  return result;
40
+ }
41
+ function serializeClientSideCallMetadata(metadatas) {
42
+ const fileNames = new Map();
43
+ const stacks = [];
44
+ for (const m of metadatas) {
45
+ if (!m.stack || !m.stack.length) continue;
46
+ const stack = [];
47
+ for (const frame of m.stack) {
48
+ let ordinal = fileNames.get(frame.file);
49
+ if (typeof ordinal !== 'number') {
50
+ ordinal = fileNames.size;
51
+ fileNames.set(frame.file, ordinal);
52
+ }
53
+ const stackFrame = [ordinal, frame.line || 0, frame.column || 0, frame.function || ''];
54
+ stack.push(stackFrame);
55
+ }
56
+ stacks.push([m.id, stack]);
57
+ }
58
+ return {
59
+ files: [...fileNames.keys()],
60
+ stacks
61
+ };
39
62
  }