@paulirish/trace_engine 0.0.66 → 0.0.67-beta.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.
- package/README.md +19 -17
- package/analyze-trace.mjs +6 -144
- package/core/common/Base64.d.ts +12 -0
- package/core/common/CharacterIdMap.d.ts +5 -0
- package/core/common/Color.d.ts +357 -0
- package/core/common/ColorConverter.d.ts +26 -0
- package/core/common/ColorUtils.d.ts +45 -0
- package/core/common/Console.d.ts +54 -0
- package/core/common/Debouncer.d.ts +8 -0
- package/core/common/EventTarget.d.ts +22 -0
- package/core/common/Gzip.d.ts +23 -0
- package/core/common/JavaScriptMetaData.d.ts +20 -0
- package/core/common/Lazy.d.ts +4 -0
- package/core/common/MapWithDefault.d.ts +9 -0
- package/core/common/Mutex.d.ts +13 -0
- package/core/common/Object.d.ts +20 -0
- package/core/common/ParsedURL.d.ts +87 -0
- package/core/common/Progress.d.ts +47 -0
- package/core/common/ResolverBase.d.ts +29 -0
- package/core/common/ResourceType.d.ts +52 -0
- package/core/common/ReturnToPanel.d.ts +10 -0
- package/core/common/Revealer.d.ts +66 -0
- package/core/common/Runnable.d.ts +14 -0
- package/core/common/SegmentedRange.d.ts +14 -0
- package/core/common/SettingRegistration.d.ts +136 -0
- package/core/common/Settings.d.ts +226 -0
- package/core/common/SimpleHistoryManager.d.ts +20 -0
- package/core/common/Srcset.d.ts +16 -0
- package/core/common/StringOutputStream.d.ts +10 -0
- package/core/common/TextDictionary.d.ts +11 -0
- package/core/common/Throttler.d.ts +12 -0
- package/core/common/Trie.d.ts +24 -0
- package/core/common/VersionController.d.ts +85 -0
- package/core/common/common.d.ts +33 -1
- package/core/host/AidaClient.d.ts +73 -0
- package/core/host/AidaClientTypes.d.ts +355 -0
- package/core/host/AidaGcaTranslation.d.ts +10 -0
- package/core/host/DispatchHttpRequestClient.d.ts +14 -0
- package/core/host/GcaClient.d.ts +14 -0
- package/core/host/GcaTypes.d.ts +411 -0
- package/core/host/GdpClient.d.ts +84 -0
- package/core/host/InspectorFrontendHost.d.ts +29 -0
- package/core/host/InspectorFrontendHostAPI.d.ts +425 -0
- package/core/host/InspectorFrontendHostStub.d.ts +151 -0
- package/core/host/Platform.d.ts +11 -0
- package/core/host/ResourceLoader.d.ts +15 -0
- package/core/host/UserMetrics.d.ts +116 -0
- package/core/host/UserMetricsEnums.d.ts +883 -0
- package/core/host/host.d.ts +13 -1
- package/core/i18n/ByteUtilities.d.ts +11 -0
- package/core/i18n/DevToolsLocale.d.ts +41 -0
- package/core/i18n/NumberFormatter.d.ts +11 -0
- package/core/i18n/i18n.d.ts +10 -0
- package/core/i18n/i18nImpl.d.ts +64 -0
- package/core/i18n/i18nTypes.d.ts +5 -0
- package/core/i18n/locales.d.ts +15 -0
- package/core/i18n/time-utilities.d.ts +16 -0
- package/core/platform/StringUtilities.d.ts +0 -21
- package/core/protocol_client/CDPConnection.d.ts +77 -0
- package/core/protocol_client/ConnectionTransport.d.ts +9 -0
- package/core/protocol_client/DevToolsCDPConnection.d.ts +16 -0
- package/core/protocol_client/InspectorBackend.d.ts +223 -0
- package/core/protocol_client/protocol_client.d.ts +5 -0
- package/core/root/DevToolsContext.d.ts +34 -0
- package/core/root/ExperimentNames.d.ts +8 -0
- package/core/root/Runtime.d.ts +351 -0
- package/core/root/root.d.ts +4 -1
- package/core/sdk/AccessibilityModel.d.ts +76 -0
- package/core/sdk/AnimationModel.d.ts +161 -0
- package/core/sdk/AutofillModel.d.ts +23 -0
- package/core/sdk/CPUProfilerModel.d.ts +46 -0
- package/core/sdk/CPUThrottlingManager.d.ts +47 -0
- package/core/sdk/CSSContainerQuery.d.ts +42 -0
- package/core/sdk/CSSFontFace.d.ts +10 -0
- package/core/sdk/CSSLayer.d.ts +9 -0
- package/core/sdk/CSSLocation.d.ts +14 -0
- package/core/sdk/CSSMatchedStyles.d.ts +138 -0
- package/core/sdk/CSSMedia.d.ts +36 -0
- package/core/sdk/CSSMetadata.d.ts +87 -0
- package/core/sdk/CSSModel.d.ts +180 -0
- package/core/sdk/CSSNavigation.d.ts +10 -0
- package/core/sdk/CSSProperty.d.ts +53 -0
- package/core/sdk/CSSPropertyParser.d.ts +131 -0
- package/core/sdk/CSSPropertyParserMatchers.d.ts +442 -0
- package/core/sdk/CSSQuery.d.ts +22 -0
- package/core/sdk/CSSRule.d.ts +132 -0
- package/core/sdk/CSSScope.d.ts +9 -0
- package/core/sdk/CSSStartingStyle.d.ts +9 -0
- package/core/sdk/CSSStyleDeclaration.d.ts +38 -0
- package/core/sdk/CSSStyleSheetHeader.d.ts +53 -0
- package/core/sdk/CSSSupports.d.ts +10 -0
- package/core/sdk/CategorizedBreakpoint.d.ts +42 -0
- package/core/sdk/ChildTargetManager.d.ts +40 -0
- package/core/sdk/CompilerSourceMappingContentProvider.d.ts +12 -0
- package/core/sdk/Connections.d.ts +36 -0
- package/core/sdk/ConsoleModel.d.ts +127 -0
- package/core/sdk/ConsoleModelTypes.d.ts +6 -0
- package/core/sdk/Cookie.d.ts +68 -0
- package/core/sdk/CookieModel.d.ts +31 -0
- package/core/sdk/CookieParser.d.ts +14 -0
- package/core/sdk/CrashReportContextModel.d.ts +8 -0
- package/core/sdk/DOMDebuggerModel.d.ts +127 -0
- package/core/sdk/DOMModel.d.ts +436 -0
- package/core/sdk/DOMStorageModel.d.ts +79 -0
- package/core/sdk/DebuggerModel.d.ts +272 -0
- package/core/sdk/EmulationModel.d.ts +95 -0
- package/core/sdk/EnhancedTracesParser.d.ts +105 -0
- package/core/sdk/EventBreakpointsModel.d.ts +66 -0
- package/core/sdk/FrameAssociated.d.ts +6 -0
- package/core/sdk/FrameManager.d.ts +68 -0
- package/core/sdk/HeapProfilerModel.d.ts +75 -0
- package/core/sdk/HttpReasonPhraseStrings.d.ts +5 -0
- package/core/sdk/IOModel.d.ts +10 -0
- package/core/sdk/IsolateManager.d.ts +53 -0
- package/core/sdk/IssuesModel.d.ts +28 -0
- package/core/sdk/LayerTreeBase.d.ts +70 -0
- package/core/sdk/LogModel.d.ts +20 -0
- package/core/sdk/NetworkManager.d.ts +418 -0
- package/core/sdk/NetworkRequest.d.ts +469 -0
- package/core/sdk/NetworkRequestAccess.d.ts +91 -0
- package/core/sdk/OverlayColorGenerator.d.ts +14 -0
- package/core/sdk/OverlayModel.d.ts +186 -0
- package/core/sdk/OverlayPersistentHighlighter.d.ts +116 -0
- package/core/sdk/PageFunctions.d.ts +22 -0
- package/core/sdk/PageLoad.d.ts +14 -0
- package/core/sdk/PageResourceLoader.d.ts +111 -0
- package/core/sdk/PaintProfiler.d.ts +43 -0
- package/core/sdk/PerformanceMetricsModel.d.ts +12 -0
- package/core/sdk/PreloadingModel.d.ts +146 -0
- package/core/sdk/RehydratingConnection.d.ts +73 -0
- package/core/sdk/RehydratingObject.d.ts +59 -0
- package/core/sdk/RemoteObject.d.ts +210 -0
- package/core/sdk/Resource.d.ts +36 -0
- package/core/sdk/ResourceTreeModel.d.ts +278 -0
- package/core/sdk/RuntimeModel.d.ts +163 -0
- package/core/sdk/SDKModel.d.ts +30 -0
- package/core/sdk/SDKSettings.d.ts +53 -0
- package/core/sdk/ScopeTreeCache.d.ts +21 -0
- package/core/sdk/ScreenCaptureModel.d.ts +69 -0
- package/core/sdk/Script.d.ts +134 -0
- package/core/sdk/SecurityOrigin.d.ts +108 -0
- package/core/sdk/SecurityOriginManager.d.ts +23 -0
- package/core/sdk/ServerSentEvents.d.ts +18 -0
- package/core/sdk/ServerSentEventsProtocol.d.ts +18 -0
- package/core/sdk/ServerTiming.d.ts +24 -0
- package/core/sdk/ServiceWorkerCacheModel.d.ts +71 -0
- package/core/sdk/ServiceWorkerManager.d.ts +125 -0
- package/core/sdk/SourceMap.d.ts +197 -0
- package/core/sdk/SourceMapCache.d.ts +12 -0
- package/core/sdk/SourceMapFunctionRanges.d.ts +26 -0
- package/core/sdk/SourceMapManager.d.ts +46 -0
- package/core/sdk/SourceMapRangeMappings.d.ts +15 -0
- package/core/sdk/SourceMapScopeChainEntry.d.ts +23 -0
- package/core/sdk/SourceMapScopesInfo.d.ts +109 -0
- package/core/sdk/StorageBucketsModel.d.ts +48 -0
- package/core/sdk/StorageKeyManager.d.ts +38 -0
- package/core/sdk/Target.d.ts +79 -0
- package/core/sdk/TargetManager.d.ts +92 -0
- package/core/sdk/TraceObject.d.ts +43 -0
- package/core/sdk/WebAuthnModel.d.ts +29 -0
- package/core/sdk/sdk.d.ts +97 -1
- package/core/text_utils/CodeMirrorUtils.d.ts +3 -0
- package/core/text_utils/ContentData.d.ts +94 -0
- package/core/text_utils/ContentProvider.d.ts +42 -0
- package/core/text_utils/StaticContentProvider.d.ts +13 -0
- package/core/text_utils/StreamingContentData.d.ts +49 -0
- package/core/text_utils/Text.d.ts +19 -0
- package/core/text_utils/TextCursor.d.ts +9 -0
- package/core/text_utils/TextRange.d.ts +81 -0
- package/core/text_utils/TextUtils.d.ts +97 -0
- package/core/text_utils/WasmDisassembly.d.ts +29 -0
- package/core/text_utils/text_utils.d.ts +11 -0
- package/entrypoints/formatter_actions/formatter_actions.d.ts +48 -0
- package/generated/InspectorBackendCommands.d.ts +14 -0
- package/generated/SupportedCSSProperties.d.ts +18 -0
- package/generated/protocol-mapping.d.ts +5930 -0
- package/generated/protocol-proxy-api.d.ts +5396 -0
- package/generated/protocol.d.ts +26 -72
- package/index.js +6 -0
- package/locales/af.json +171 -174
- package/locales/am.json +351 -354
- package/locales/ar.json +352 -355
- package/locales/as.json +350 -353
- package/locales/az.json +341 -344
- package/locales/be.json +351 -354
- package/locales/bg.json +351 -354
- package/locales/bn.json +351 -354
- package/locales/bs.json +253 -256
- package/locales/ca.json +283 -286
- package/locales/cs.json +336 -339
- package/locales/cy.json +144 -147
- package/locales/da.json +232 -235
- package/locales/de.json +251 -254
- package/locales/el.json +336 -339
- package/locales/en-GB.json +132 -135
- package/locales/es-419.json +282 -285
- package/locales/es.json +282 -285
- package/locales/et.json +236 -239
- package/locales/eu.json +131 -134
- package/locales/fa.json +351 -354
- package/locales/fi.json +283 -286
- package/locales/fil.json +128 -131
- package/locales/fr-CA.json +310 -313
- package/locales/fr.json +309 -312
- package/locales/gl.json +264 -267
- package/locales/gu.json +352 -355
- package/locales/he.json +352 -355
- package/locales/hi.json +336 -339
- package/locales/hr.json +257 -260
- package/locales/hu.json +342 -345
- package/locales/hy.json +351 -354
- package/locales/id.json +128 -131
- package/locales/is.json +304 -307
- package/locales/it.json +221 -224
- package/locales/ja.json +351 -354
- package/locales/ka.json +352 -355
- package/locales/kk.json +352 -355
- package/locales/km.json +351 -354
- package/locales/kn.json +352 -355
- package/locales/ko.json +351 -354
- package/locales/ky.json +350 -353
- package/locales/lo.json +352 -355
- package/locales/lt.json +323 -326
- package/locales/lv.json +317 -320
- package/locales/mk.json +352 -355
- package/locales/ml.json +351 -354
- package/locales/mn.json +351 -354
- package/locales/mr.json +351 -354
- package/locales/ms.json +128 -131
- package/locales/my.json +350 -353
- package/locales/ne.json +336 -339
- package/locales/nl.json +183 -186
- package/locales/no.json +238 -241
- package/locales/or.json +351 -354
- package/locales/pa.json +351 -354
- package/locales/pl.json +307 -310
- package/locales/pt-PT.json +273 -276
- package/locales/pt.json +270 -273
- package/locales/ro.json +309 -312
- package/locales/ru.json +351 -354
- package/locales/si.json +352 -355
- package/locales/sk.json +333 -336
- package/locales/sl.json +273 -276
- package/locales/sq.json +316 -319
- package/locales/sr-Latn.json +256 -259
- package/locales/sr.json +352 -355
- package/locales/sv.json +296 -299
- package/locales/sw.json +128 -131
- package/locales/ta.json +352 -355
- package/locales/te.json +350 -353
- package/locales/th.json +352 -355
- package/locales/tr.json +327 -330
- package/locales/uk.json +351 -354
- package/locales/ur.json +352 -355
- package/locales/uz.json +232 -235
- package/locales/vi.json +352 -355
- package/locales/zh-HK.json +352 -355
- package/locales/zh-TW.json +351 -354
- package/locales/zh.json +351 -354
- package/locales/zu.json +127 -130
- package/models/crux-manager/CrUXManager.d.ts +107 -0
- package/models/crux-manager/crux-manager.d.ts +1 -0
- package/models/emulation/DeviceModeModel.d.ts +156 -0
- package/models/emulation/EmulatedDevices.d.ts +148 -0
- package/models/emulation/emulation.d.ts +3 -0
- package/models/formatter/FormatterWorkerPool.d.ts +58 -0
- package/models/formatter/ScriptFormatter.d.ts +11 -0
- package/models/formatter/formatter.d.ts +3 -0
- package/models/trace/ModelImpl.d.ts +1 -1
- package/models/trace/extras/extras.d.ts +2 -7
- package/models/trace/handlers/ScriptsHandler.d.ts +2 -2
- package/models/trace/insights/CLSCulprits.d.ts +14 -14
- package/models/trace/insights/Cache.d.ts +8 -8
- package/models/trace/insights/CharacterSet.d.ts +10 -10
- package/models/trace/insights/Common.d.ts +4 -4
- package/models/trace/insights/DOMSize.d.ts +15 -15
- package/models/trace/insights/DocumentLatency.d.ts +13 -13
- package/models/trace/insights/DuplicatedJavaScript.d.ts +7 -7
- package/models/trace/insights/FontDisplay.d.ts +7 -7
- package/models/trace/insights/ForcedReflow.d.ts +9 -9
- package/models/trace/insights/INPBreakdown.d.ts +10 -10
- package/models/trace/insights/ImageDelivery.d.ts +12 -13
- package/models/trace/insights/LCPBreakdown.d.ts +13 -13
- package/models/trace/insights/LCPDiscovery.d.ts +12 -12
- package/models/trace/insights/LegacyJavaScript.d.ts +7 -7
- package/models/trace/insights/ModernHTTP.d.ts +7 -7
- package/models/trace/insights/NetworkDependencyTree.d.ts +21 -104
- package/models/trace/insights/RenderBlocking.d.ts +7 -7
- package/models/trace/insights/SlowCSSSelector.d.ts +12 -12
- package/models/trace/insights/ThirdParties.d.ts +8 -8
- package/models/trace/insights/Viewport.d.ts +5 -5
- package/models/trace/insights/types.d.ts +1 -1
- package/models/trace/lantern/core/NetworkAnalyzer.d.ts +0 -1
- package/models/trace/lantern/graph/BaseNode.d.ts +2 -2
- package/models/trace/lantern/graph/CPUNode.d.ts +2 -4
- package/models/trace/lantern/lantern.js +6 -8
- package/models/trace/lantern/simulation/TCPConnection.d.ts +4 -4
- package/models/trace/lantern/types/Lantern.d.ts +19 -27
- package/models/trace/trace.js +529 -18
- package/models/trace/types/Configuration.d.ts +1 -1
- package/models/trace/types/Extensions.d.ts +1 -1
- package/models/trace/types/File.d.ts +5 -5
- package/models/trace/types/Timing.js +6 -14
- package/models/trace/types/TraceEvents.d.ts +24 -24
- package/models/trace/types/TraceEvents.js +187 -984
- package/models/trace/types/types.js +6 -8
- package/package.json +30 -8
- package/third_party/codemirror.next/codemirror.next.d.ts +9196 -0
- package/third_party/i18n/i18n-impl.d.ts +25 -0
- package/third_party/i18n/i18n.d.ts +3 -0
- package/third_party/i18n/localized-string-set.d.ts +49 -0
- package/third_party/intl-messageformat/intl-messageformat.d.ts +1 -0
- package/third_party/source-map-scopes-codec/package/src/builder/builder.d.ts +67 -0
- package/third_party/source-map-scopes-codec/package/src/builder/safe_builder.d.ts +38 -0
- package/third_party/source-map-scopes-codec/package/src/codec.d.ts +48 -0
- package/third_party/source-map-scopes-codec/package/src/decode/decode.d.ts +31 -0
- package/third_party/source-map-scopes-codec/package/src/encode/encode.d.ts +8 -0
- package/third_party/source-map-scopes-codec/package/src/encode/encoder.d.ts +6 -0
- package/third_party/source-map-scopes-codec/package/src/mod.d.ts +5 -0
- package/third_party/source-map-scopes-codec/package/src/scopes.d.ts +168 -0
- package/third_party/source-map-scopes-codec/package/src/util.d.ts +5 -0
- package/third_party/source-map-scopes-codec/package/src/vlq.d.ts +14 -0
- package/third_party/source-map-scopes-codec/source-map-scopes-codec.d.ts +1 -0
- package/third_party/third-party-web/lib/nostats-subset.d.ts +2 -0
- package/third_party/third-party-web/package/lib/index.d.ts +34 -0
- package/third_party/third-party-web/package/lib/subsets/nostats.d.ts +1 -0
- package/third_party/third-party-web/third-party-web.d.ts +2 -1
- package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts +0 -13
- package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts.map +0 -1
- package/.tmp/tsbuildinfo/analyze-trace.d.mts +0 -17
- package/.tmp/tsbuildinfo/analyze-trace.d.mts.map +0 -1
- package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts +0 -4
- package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts.map +0 -1
- package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts +0 -2
- package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts.map +0 -1
- package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts +0 -3
- package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts.map +0 -1
- package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +0 -1
- package/analyze-inspector-issues.mjs +0 -60
- package/core/common/common.js +0 -1
- package/core/host/host.js +0 -1
- package/core/platform/ArrayUtilities.js +0 -224
- package/core/platform/ArrayUtilities.js.map +0 -1
- package/core/platform/Brand.js +0 -5
- package/core/platform/Brand.js.map +0 -1
- package/core/platform/Constructor.js +0 -5
- package/core/platform/Constructor.js.map +0 -1
- package/core/platform/DateUtilities.js +0 -14
- package/core/platform/DateUtilities.js.map +0 -1
- package/core/platform/DevToolsPath.js +0 -28
- package/core/platform/DevToolsPath.js.map +0 -1
- package/core/platform/HostRuntime.js +0 -31
- package/core/platform/HostRuntime.js.map +0 -1
- package/core/platform/KeyboardUtilities.js +0 -34
- package/core/platform/KeyboardUtilities.js.map +0 -1
- package/core/platform/MapUtilities.js +0 -80
- package/core/platform/MapUtilities.js.map +0 -1
- package/core/platform/MimeType.js +0 -157
- package/core/platform/MimeType.js.map +0 -1
- package/core/platform/NumberUtilities.js +0 -73
- package/core/platform/NumberUtilities.js.map +0 -1
- package/core/platform/Size.js +0 -36
- package/core/platform/Size.js.map +0 -1
- package/core/platform/StringUtilities.js +0 -731
- package/core/platform/StringUtilities.js.map +0 -1
- package/core/platform/Timing.js +0 -10
- package/core/platform/Timing.js.map +0 -1
- package/core/platform/TypedArrayUtilities.js +0 -158
- package/core/platform/TypedArrayUtilities.js.map +0 -1
- package/core/platform/TypescriptUtilities.js +0 -17
- package/core/platform/TypescriptUtilities.js.map +0 -1
- package/core/platform/UIString.js +0 -5
- package/core/platform/UIString.js.map +0 -1
- package/core/platform/UserVisibleError.js +0 -23
- package/core/platform/UserVisibleError.js.map +0 -1
- package/core/platform/api/HostRuntime.js +0 -5
- package/core/platform/api/HostRuntime.js.map +0 -1
- package/core/platform/api/api-tsconfig.json +0 -58
- package/core/platform/api/api-tsconfig.ref.json +0 -26
- package/core/platform/api/api.js +0 -6
- package/core/platform/api/api.js.map +0 -1
- package/core/platform/browser/HostRuntime.js +0 -165
- package/core/platform/browser/HostRuntime.js.map +0 -1
- package/core/platform/browser/browser-tsconfig.json +0 -59
- package/core/platform/browser/browser-tsconfig.ref.json +0 -27
- package/core/platform/browser/browser.js +0 -6
- package/core/platform/browser/browser.js.map +0 -1
- package/core/platform/browser/bundle-tsconfig.json +0 -59
- package/core/platform/browser/bundle-tsconfig.ref.json +0 -27
- package/core/platform/bundle-tsconfig.json +0 -59
- package/core/platform/bundle-tsconfig.ref.json +0 -27
- package/core/platform/foundation_unittests-tsconfig.json +0 -73
- package/core/platform/foundation_unittests-tsconfig.ref.json +0 -40
- package/core/platform/foundation_unittests_node_typecheck-tsconfig.json +0 -70
- package/core/platform/node/HostRuntime.js +0 -127
- package/core/platform/node/HostRuntime.js.map +0 -1
- package/core/platform/node/bundle-tsconfig.json +0 -59
- package/core/platform/node/bundle-tsconfig.ref.json +0 -27
- package/core/platform/node/node-tsconfig.json +0 -59
- package/core/platform/node/node-tsconfig.ref.json +0 -27
- package/core/platform/node/node.js +0 -6
- package/core/platform/node/node.js.map +0 -1
- package/core/platform/platform-tsconfig.json +0 -81
- package/core/platform/platform-tsconfig.ref.json +0 -49
- package/core/platform/platform.js +0 -28
- package/core/platform/platform.js.map +0 -1
- package/core/platform/platform_node_typecheck-tsconfig.json +0 -78
- package/core/platform/platform_node_typecheck.stamp +0 -0
- package/core/root/root.js +0 -1
- package/core/sdk/sdk.js +0 -1
- package/generated/protocol.js +0 -3304
- package/locales/en-US.json +0 -1058
- package/locales/en-XL.json +0 -1058
- package/models/cpu_profile/CPUProfileDataModel.js +0 -517
- package/models/cpu_profile/CPUProfileDataModel.js.map +0 -1
- package/models/cpu_profile/ProfileTreeModel.js +0 -90
- package/models/cpu_profile/ProfileTreeModel.js.map +0 -1
- package/models/cpu_profile/bundle-tsconfig.json +0 -59
- package/models/cpu_profile/bundle-tsconfig.ref.json +0 -27
- package/models/cpu_profile/cpu_profile-tsconfig.json +0 -63
- package/models/cpu_profile/cpu_profile-tsconfig.ref.json +0 -31
- package/models/cpu_profile/cpu_profile.js +0 -7
- package/models/cpu_profile/cpu_profile.js.map +0 -1
- package/models/cpu_profile/cpu_profile_node_typecheck-tsconfig.json +0 -60
- package/models/cpu_profile/cpu_profile_node_typecheck.stamp +0 -0
- package/models/cpu_profile/foundation_unittests-tsconfig.json +0 -63
- package/models/cpu_profile/foundation_unittests-tsconfig.ref.json +0 -30
- package/models/cpu_profile/foundation_unittests_node_typecheck-tsconfig.json +0 -60
- package/models/issues_manager/CheckFormsIssuesTrigger.d.ts +0 -1
- package/models/issues_manager/CheckFormsIssuesTrigger.js +0 -1
- package/models/issues_manager/ContrastCheckTrigger.d.ts +0 -1
- package/models/issues_manager/ContrastCheckTrigger.js +0 -1
- package/models/issues_manager/DeprecationIssue.d.ts +0 -1
- package/models/issues_manager/DeprecationIssue.js +0 -1
- package/models/issues_manager/IssueResolver.d.ts +0 -1
- package/models/issues_manager/IssueResolver.js +0 -1
- package/models/issues_manager/RelatedIssue.d.ts +0 -1
- package/models/issues_manager/RelatedIssue.js +0 -1
- package/models/issues_manager/SourceFrameIssuesManager.d.ts +0 -1
- package/models/issues_manager/SourceFrameIssuesManager.js +0 -1
- package/models/trace/EntityMapper.js +0 -133
- package/models/trace/EntityMapper.js.map +0 -1
- package/models/trace/EventsSerializer.js +0 -90
- package/models/trace/EventsSerializer.js.map +0 -1
- package/models/trace/LanternComputationData.js +0 -374
- package/models/trace/LanternComputationData.js.map +0 -1
- package/models/trace/LegacyTracingModel.d.ts +0 -1
- package/models/trace/LegacyTracingModel.js +0 -1
- package/models/trace/ModelImpl.js +0 -181
- package/models/trace/ModelImpl.js.map +0 -1
- package/models/trace/Name.js +0 -115
- package/models/trace/Name.js.map +0 -1
- package/models/trace/Processor.js +0 -618
- package/models/trace/Processor.js.map +0 -1
- package/models/trace/Styles.js +0 -836
- package/models/trace/Styles.js.map +0 -1
- package/models/trace/TracingManager.d.ts +0 -1
- package/models/trace/TracingManager.js +0 -1
- package/models/trace/bundle-tsconfig.json +0 -77
- package/models/trace/bundle-tsconfig.ref.json +0 -45
- package/models/trace/extras/FilmStrip.js +0 -45
- package/models/trace/extras/FilmStrip.js.map +0 -1
- package/models/trace/extras/Initiators.js +0 -47
- package/models/trace/extras/Initiators.js.map +0 -1
- package/models/trace/extras/MainThreadActivity.js +0 -77
- package/models/trace/extras/MainThreadActivity.js.map +0 -1
- package/models/trace/extras/ScriptDuplication.js +0 -163
- package/models/trace/extras/ScriptDuplication.js.map +0 -1
- package/models/trace/extras/StackTraceForEvent.js +0 -192
- package/models/trace/extras/StackTraceForEvent.js.map +0 -1
- package/models/trace/extras/ThirdParties.js +0 -119
- package/models/trace/extras/ThirdParties.js.map +0 -1
- package/models/trace/extras/TraceFilter.js +0 -51
- package/models/trace/extras/TraceFilter.js.map +0 -1
- package/models/trace/extras/TraceTree.js +0 -621
- package/models/trace/extras/TraceTree.js.map +0 -1
- package/models/trace/extras/bundle-tsconfig.json +0 -59
- package/models/trace/extras/bundle-tsconfig.ref.json +0 -27
- package/models/trace/extras/extras-tsconfig.json +0 -81
- package/models/trace/extras/extras-tsconfig.ref.json +0 -49
- package/models/trace/extras/extras.js +0 -13
- package/models/trace/extras/extras.js.map +0 -1
- package/models/trace/extras/extras_node_typecheck-tsconfig.json +0 -78
- package/models/trace/extras/extras_node_typecheck.stamp +0 -0
- package/models/trace/extras/foundation_unittests-tsconfig.json +0 -91
- package/models/trace/extras/foundation_unittests-tsconfig.ref.json +0 -58
- package/models/trace/extras/foundation_unittests_node_typecheck-tsconfig.json +0 -88
- package/models/trace/foundation_unittests-tsconfig.json +0 -70
- package/models/trace/foundation_unittests-tsconfig.ref.json +0 -37
- package/models/trace/foundation_unittests_node_typecheck-tsconfig.json +0 -67
- package/models/trace/handlers/AnimationFramesHandler.js +0 -110
- package/models/trace/handlers/AnimationFramesHandler.js.map +0 -1
- package/models/trace/handlers/AnimationHandler.js +0 -27
- package/models/trace/handlers/AnimationHandler.js.map +0 -1
- package/models/trace/handlers/AsyncJSCallsHandler.js +0 -188
- package/models/trace/handlers/AsyncJSCallsHandler.js.map +0 -1
- package/models/trace/handlers/DOMStatsHandler.js +0 -22
- package/models/trace/handlers/DOMStatsHandler.js.map +0 -1
- package/models/trace/handlers/ExtensionTraceDataHandler.js +0 -264
- package/models/trace/handlers/ExtensionTraceDataHandler.js.map +0 -1
- package/models/trace/handlers/FlowsHandler.js +0 -149
- package/models/trace/handlers/FlowsHandler.js.map +0 -1
- package/models/trace/handlers/FramesHandler.js +0 -491
- package/models/trace/handlers/FramesHandler.js.map +0 -1
- package/models/trace/handlers/GPUHandler.js +0 -36
- package/models/trace/handlers/GPUHandler.js.map +0 -1
- package/models/trace/handlers/ImagePaintingHandler.js +0 -148
- package/models/trace/handlers/ImagePaintingHandler.js.map +0 -1
- package/models/trace/handlers/InitiatorsHandler.js +0 -181
- package/models/trace/handlers/InitiatorsHandler.js.map +0 -1
- package/models/trace/handlers/InvalidationsHandler.js +0 -127
- package/models/trace/handlers/InvalidationsHandler.js.map +0 -1
- package/models/trace/handlers/LargestImagePaintHandler.js +0 -86
- package/models/trace/handlers/LargestImagePaintHandler.js.map +0 -1
- package/models/trace/handlers/LargestTextPaintHandler.js +0 -28
- package/models/trace/handlers/LargestTextPaintHandler.js.map +0 -1
- package/models/trace/handlers/LayerTreeHandler.js +0 -104
- package/models/trace/handlers/LayerTreeHandler.js.map +0 -1
- package/models/trace/handlers/LayoutShiftsHandler.js +0 -457
- package/models/trace/handlers/LayoutShiftsHandler.js.map +0 -1
- package/models/trace/handlers/MemoryHandler.js +0 -22
- package/models/trace/handlers/MemoryHandler.js.map +0 -1
- package/models/trace/handlers/MetaHandler.js +0 -442
- package/models/trace/handlers/MetaHandler.js.map +0 -1
- package/models/trace/handlers/ModelHandlers.js +0 -33
- package/models/trace/handlers/ModelHandlers.js.map +0 -1
- package/models/trace/handlers/NetworkRequestsHandler.js +0 -578
- package/models/trace/handlers/NetworkRequestsHandler.js.map +0 -1
- package/models/trace/handlers/PageFramesHandler.js +0 -43
- package/models/trace/handlers/PageFramesHandler.js.map +0 -1
- package/models/trace/handlers/PageLoadMetricsHandler.js +0 -462
- package/models/trace/handlers/PageLoadMetricsHandler.js.map +0 -1
- package/models/trace/handlers/RendererHandler.js +0 -346
- package/models/trace/handlers/RendererHandler.js.map +0 -1
- package/models/trace/handlers/SamplesHandler.js +0 -261
- package/models/trace/handlers/SamplesHandler.js.map +0 -1
- package/models/trace/handlers/ScreenshotsHandler.js +0 -56
- package/models/trace/handlers/ScreenshotsHandler.js.map +0 -1
- package/models/trace/handlers/ScriptsHandler.js +0 -286
- package/models/trace/handlers/ScriptsHandler.js.map +0 -1
- package/models/trace/handlers/SelectorStatsHandler.js +0 -72
- package/models/trace/handlers/SelectorStatsHandler.js.map +0 -1
- package/models/trace/handlers/Threads.js +0 -108
- package/models/trace/handlers/Threads.js.map +0 -1
- package/models/trace/handlers/UserInteractionsHandler.js +0 -319
- package/models/trace/handlers/UserInteractionsHandler.js.map +0 -1
- package/models/trace/handlers/UserTimingsHandler.js +0 -194
- package/models/trace/handlers/UserTimingsHandler.js.map +0 -1
- package/models/trace/handlers/WarningsHandler.js +0 -135
- package/models/trace/handlers/WarningsHandler.js.map +0 -1
- package/models/trace/handlers/WorkersHandler.js +0 -34
- package/models/trace/handlers/WorkersHandler.js.map +0 -1
- package/models/trace/handlers/bundle-tsconfig.json +0 -59
- package/models/trace/handlers/bundle-tsconfig.ref.json +0 -27
- package/models/trace/handlers/foundation_unittests-tsconfig.json +0 -102
- package/models/trace/handlers/foundation_unittests-tsconfig.ref.json +0 -69
- package/models/trace/handlers/foundation_unittests_node_typecheck-tsconfig.json +0 -99
- package/models/trace/handlers/handlers-tsconfig.json +0 -112
- package/models/trace/handlers/handlers-tsconfig.ref.json +0 -80
- package/models/trace/handlers/handlers.js +0 -8
- package/models/trace/handlers/handlers.js.map +0 -1
- package/models/trace/handlers/handlers_node_typecheck-tsconfig.json +0 -109
- package/models/trace/handlers/handlers_node_typecheck.stamp +0 -0
- package/models/trace/handlers/helpers.js +0 -164
- package/models/trace/handlers/helpers.js.map +0 -1
- package/models/trace/handlers/types.js +0 -2
- package/models/trace/handlers/types.js.map +0 -1
- package/models/trace/helpers/Extensions.js +0 -42
- package/models/trace/helpers/Extensions.js.map +0 -1
- package/models/trace/helpers/Network.js +0 -103
- package/models/trace/helpers/Network.js.map +0 -1
- package/models/trace/helpers/SamplesIntegrator.js +0 -512
- package/models/trace/helpers/SamplesIntegrator.js.map +0 -1
- package/models/trace/helpers/SyntheticEvents.js +0 -94
- package/models/trace/helpers/SyntheticEvents.js.map +0 -1
- package/models/trace/helpers/Timing.js +0 -207
- package/models/trace/helpers/Timing.js.map +0 -1
- package/models/trace/helpers/Trace.js +0 -817
- package/models/trace/helpers/Trace.js.map +0 -1
- package/models/trace/helpers/TreeHelpers.js +0 -255
- package/models/trace/helpers/TreeHelpers.js.map +0 -1
- package/models/trace/helpers/bundle-tsconfig.json +0 -59
- package/models/trace/helpers/bundle-tsconfig.ref.json +0 -27
- package/models/trace/helpers/foundation_unittests-tsconfig.json +0 -73
- package/models/trace/helpers/foundation_unittests-tsconfig.ref.json +0 -40
- package/models/trace/helpers/foundation_unittests_node_typecheck-tsconfig.json +0 -70
- package/models/trace/helpers/helpers-tsconfig.json +0 -77
- package/models/trace/helpers/helpers-tsconfig.ref.json +0 -45
- package/models/trace/helpers/helpers.js +0 -11
- package/models/trace/helpers/helpers.js.map +0 -1
- package/models/trace/helpers/helpers_node_typecheck-tsconfig.json +0 -74
- package/models/trace/helpers/helpers_node_typecheck.stamp +0 -0
- package/models/trace/insights/CLSCulprits.js +0 -519
- package/models/trace/insights/CLSCulprits.js.map +0 -1
- package/models/trace/insights/Cache.js +0 -210
- package/models/trace/insights/Cache.js.map +0 -1
- package/models/trace/insights/CharacterSet.js +0 -132
- package/models/trace/insights/CharacterSet.js.map +0 -1
- package/models/trace/insights/Common.js +0 -366
- package/models/trace/insights/Common.js.map +0 -1
- package/models/trace/insights/DOMSize.js +0 -182
- package/models/trace/insights/DOMSize.js.map +0 -1
- package/models/trace/insights/DocumentLatency.js +0 -259
- package/models/trace/insights/DocumentLatency.js.map +0 -1
- package/models/trace/insights/DuplicatedJavaScript.js +0 -99
- package/models/trace/insights/DuplicatedJavaScript.js.map +0 -1
- package/models/trace/insights/FontDisplay.js +0 -93
- package/models/trace/insights/FontDisplay.js.map +0 -1
- package/models/trace/insights/ForcedReflow.js +0 -162
- package/models/trace/insights/ForcedReflow.js.map +0 -1
- package/models/trace/insights/INPBreakdown.js +0 -130
- package/models/trace/insights/INPBreakdown.js.map +0 -1
- package/models/trace/insights/ImageDelivery.js +0 -264
- package/models/trace/insights/ImageDelivery.js.map +0 -1
- package/models/trace/insights/LCPBreakdown.js +0 -200
- package/models/trace/insights/LCPBreakdown.js.map +0 -1
- package/models/trace/insights/LCPDiscovery.js +0 -190
- package/models/trace/insights/LCPDiscovery.js.map +0 -1
- package/models/trace/insights/LegacyJavaScript.js +0 -99
- package/models/trace/insights/LegacyJavaScript.js.map +0 -1
- package/models/trace/insights/Models.js +0 -23
- package/models/trace/insights/Models.js.map +0 -1
- package/models/trace/insights/ModernHTTP.js +0 -205
- package/models/trace/insights/ModernHTTP.js.map +0 -1
- package/models/trace/insights/NetworkDependencyTree.js +0 -972
- package/models/trace/insights/NetworkDependencyTree.js.map +0 -1
- package/models/trace/insights/RenderBlocking.js +0 -191
- package/models/trace/insights/RenderBlocking.js.map +0 -1
- package/models/trace/insights/SlowCSSSelector.js +0 -140
- package/models/trace/insights/SlowCSSSelector.js.map +0 -1
- package/models/trace/insights/Statistics.js +0 -93
- package/models/trace/insights/Statistics.js.map +0 -1
- package/models/trace/insights/ThirdParties.js +0 -110
- package/models/trace/insights/ThirdParties.js.map +0 -1
- package/models/trace/insights/Viewport.js +0 -105
- package/models/trace/insights/Viewport.js.map +0 -1
- package/models/trace/insights/bundle-tsconfig.json +0 -59
- package/models/trace/insights/bundle-tsconfig.ref.json +0 -27
- package/models/trace/insights/foundation_unittests-tsconfig.json +0 -98
- package/models/trace/insights/foundation_unittests-tsconfig.ref.json +0 -65
- package/models/trace/insights/foundation_unittests_node_typecheck-tsconfig.json +0 -95
- package/models/trace/insights/insights-tsconfig.json +0 -114
- package/models/trace/insights/insights-tsconfig.ref.json +0 -82
- package/models/trace/insights/insights.js +0 -10
- package/models/trace/insights/insights.js.map +0 -1
- package/models/trace/insights/insights_node_typecheck-tsconfig.json +0 -111
- package/models/trace/insights/insights_node_typecheck.stamp +0 -0
- package/models/trace/insights/types.js +0 -41
- package/models/trace/insights/types.js.map +0 -1
- package/models/trace/lantern/bundle-tsconfig.json +0 -71
- package/models/trace/lantern/bundle-tsconfig.ref.json +0 -39
- package/models/trace/lantern/core/LanternError.js +0 -7
- package/models/trace/lantern/core/LanternError.js.map +0 -1
- package/models/trace/lantern/core/NetworkAnalyzer.js +0 -488
- package/models/trace/lantern/core/NetworkAnalyzer.js.map +0 -1
- package/models/trace/lantern/core/bundle-tsconfig.json +0 -59
- package/models/trace/lantern/core/bundle-tsconfig.ref.json +0 -27
- package/models/trace/lantern/core/core-tsconfig.json +0 -60
- package/models/trace/lantern/core/core-tsconfig.ref.json +0 -28
- package/models/trace/lantern/core/core.js +0 -6
- package/models/trace/lantern/core/core.js.map +0 -1
- package/models/trace/lantern/core/core_node_typecheck-tsconfig.json +0 -57
- package/models/trace/lantern/core/core_node_typecheck.stamp +0 -0
- package/models/trace/lantern/core/foundation_unittests-tsconfig.json +0 -69
- package/models/trace/lantern/core/foundation_unittests-tsconfig.ref.json +0 -36
- package/models/trace/lantern/core/foundation_unittests_node_typecheck-tsconfig.json +0 -66
- package/models/trace/lantern/graph/BaseNode.js +0 -277
- package/models/trace/lantern/graph/BaseNode.js.map +0 -1
- package/models/trace/lantern/graph/CPUNode.js +0 -80
- package/models/trace/lantern/graph/CPUNode.js.map +0 -1
- package/models/trace/lantern/graph/NetworkNode.js +0 -95
- package/models/trace/lantern/graph/NetworkNode.js.map +0 -1
- package/models/trace/lantern/graph/PageDependencyGraph.js +0 -574
- package/models/trace/lantern/graph/PageDependencyGraph.js.map +0 -1
- package/models/trace/lantern/graph/bundle-tsconfig.json +0 -59
- package/models/trace/lantern/graph/bundle-tsconfig.ref.json +0 -27
- package/models/trace/lantern/graph/foundation_unittests-tsconfig.json +0 -61
- package/models/trace/lantern/graph/foundation_unittests-tsconfig.ref.json +0 -28
- package/models/trace/lantern/graph/foundation_unittests_node_typecheck-tsconfig.json +0 -58
- package/models/trace/lantern/graph/graph-tsconfig.json +0 -65
- package/models/trace/lantern/graph/graph-tsconfig.ref.json +0 -33
- package/models/trace/lantern/graph/graph.js +0 -8
- package/models/trace/lantern/graph/graph.js.map +0 -1
- package/models/trace/lantern/graph/graph_node_typecheck-tsconfig.json +0 -62
- package/models/trace/lantern/graph/graph_node_typecheck.stamp +0 -0
- package/models/trace/lantern/lantern.js.map +0 -1
- package/models/trace/lantern/metrics/FirstContentfulPaint.js +0 -137
- package/models/trace/lantern/metrics/FirstContentfulPaint.js.map +0 -1
- package/models/trace/lantern/metrics/Interactive.js +0 -68
- package/models/trace/lantern/metrics/Interactive.js.map +0 -1
- package/models/trace/lantern/metrics/LargestContentfulPaint.js +0 -69
- package/models/trace/lantern/metrics/LargestContentfulPaint.js.map +0 -1
- package/models/trace/lantern/metrics/MaxPotentialFID.js +0 -49
- package/models/trace/lantern/metrics/MaxPotentialFID.js.map +0 -1
- package/models/trace/lantern/metrics/Metric.js +0 -69
- package/models/trace/lantern/metrics/Metric.js.map +0 -1
- package/models/trace/lantern/metrics/SpeedIndex.js +0 -102
- package/models/trace/lantern/metrics/SpeedIndex.js.map +0 -1
- package/models/trace/lantern/metrics/TBTUtils.js +0 -65
- package/models/trace/lantern/metrics/TBTUtils.js.map +0 -1
- package/models/trace/lantern/metrics/TotalBlockingTime.js +0 -79
- package/models/trace/lantern/metrics/TotalBlockingTime.js.map +0 -1
- package/models/trace/lantern/metrics/bundle-tsconfig.json +0 -59
- package/models/trace/lantern/metrics/bundle-tsconfig.ref.json +0 -27
- package/models/trace/lantern/metrics/foundation_unittests-tsconfig.json +0 -76
- package/models/trace/lantern/metrics/foundation_unittests-tsconfig.ref.json +0 -43
- package/models/trace/lantern/metrics/foundation_unittests_node_typecheck-tsconfig.json +0 -73
- package/models/trace/lantern/metrics/metrics-tsconfig.json +0 -75
- package/models/trace/lantern/metrics/metrics-tsconfig.ref.json +0 -43
- package/models/trace/lantern/metrics/metrics.js +0 -12
- package/models/trace/lantern/metrics/metrics.js.map +0 -1
- package/models/trace/lantern/metrics/metrics_node_typecheck-tsconfig.json +0 -72
- package/models/trace/lantern/metrics/metrics_node_typecheck.stamp +0 -0
- package/models/trace/lantern/simulation/ConnectionPool.js +0 -116
- package/models/trace/lantern/simulation/ConnectionPool.js.map +0 -1
- package/models/trace/lantern/simulation/Constants.js +0 -45
- package/models/trace/lantern/simulation/Constants.js.map +0 -1
- package/models/trace/lantern/simulation/DNSCache.js +0 -48
- package/models/trace/lantern/simulation/DNSCache.js.map +0 -1
- package/models/trace/lantern/simulation/SimulationTimingMap.js +0 -135
- package/models/trace/lantern/simulation/SimulationTimingMap.js.map +0 -1
- package/models/trace/lantern/simulation/Simulator.js +0 -455
- package/models/trace/lantern/simulation/Simulator.js.map +0 -1
- package/models/trace/lantern/simulation/TCPConnection.js +0 -155
- package/models/trace/lantern/simulation/TCPConnection.js.map +0 -1
- package/models/trace/lantern/simulation/bundle-tsconfig.json +0 -59
- package/models/trace/lantern/simulation/bundle-tsconfig.ref.json +0 -27
- package/models/trace/lantern/simulation/foundation_unittests-tsconfig.json +0 -75
- package/models/trace/lantern/simulation/foundation_unittests-tsconfig.ref.json +0 -42
- package/models/trace/lantern/simulation/foundation_unittests_node_typecheck-tsconfig.json +0 -72
- package/models/trace/lantern/simulation/simulation-tsconfig.json +0 -70
- package/models/trace/lantern/simulation/simulation-tsconfig.ref.json +0 -38
- package/models/trace/lantern/simulation/simulation.js +0 -10
- package/models/trace/lantern/simulation/simulation.js.map +0 -1
- package/models/trace/lantern/simulation/simulation_node_typecheck-tsconfig.json +0 -67
- package/models/trace/lantern/simulation/simulation_node_typecheck.stamp +0 -0
- package/models/trace/lantern/testing/bundle-tsconfig.json +0 -60
- package/models/trace/lantern/testing/bundle-tsconfig.ref.json +0 -27
- package/models/trace/lantern/testing/testing-tsconfig.json +0 -63
- package/models/trace/lantern/testing/testing-tsconfig.ref.json +0 -30
- package/models/trace/lantern/types/Lantern.js +0 -25
- package/models/trace/lantern/types/Lantern.js.map +0 -1
- package/models/trace/lantern/types/bundle-tsconfig.json +0 -59
- package/models/trace/lantern/types/bundle-tsconfig.ref.json +0 -27
- package/models/trace/lantern/types/types-tsconfig.json +0 -59
- package/models/trace/lantern/types/types-tsconfig.ref.json +0 -27
- package/models/trace/lantern/types/types.js +0 -5
- package/models/trace/lantern/types/types.js.map +0 -1
- package/models/trace/lantern/types/types_node_typecheck-tsconfig.json +0 -56
- package/models/trace/lantern/types/types_node_typecheck.stamp +0 -0
- package/models/trace/trace-tsconfig.json +0 -89
- package/models/trace/trace-tsconfig.ref.json +0 -57
- package/models/trace/trace.js.map +0 -1
- package/models/trace/trace_node_typecheck-tsconfig.json +0 -86
- package/models/trace/trace_node_typecheck.stamp +0 -0
- package/models/trace/types/Configuration.js +0 -19
- package/models/trace/types/Configuration.js.map +0 -1
- package/models/trace/types/Extensions.js +0 -38
- package/models/trace/types/Extensions.js.map +0 -1
- package/models/trace/types/File.js +0 -82
- package/models/trace/types/File.js.map +0 -1
- package/models/trace/types/Overlays.js +0 -5
- package/models/trace/types/Overlays.js.map +0 -1
- package/models/trace/types/Timing.js.map +0 -1
- package/models/trace/types/TraceEvents.js.map +0 -1
- package/models/trace/types/bundle-tsconfig.json +0 -59
- package/models/trace/types/bundle-tsconfig.ref.json +0 -27
- package/models/trace/types/foundation_unittests-tsconfig.json +0 -67
- package/models/trace/types/foundation_unittests-tsconfig.ref.json +0 -34
- package/models/trace/types/foundation_unittests_node_typecheck-tsconfig.json +0 -64
- package/models/trace/types/types-tsconfig.json +0 -76
- package/models/trace/types/types-tsconfig.ref.json +0 -44
- package/models/trace/types/types.js.map +0 -1
- package/models/trace/types/types_node_typecheck-tsconfig.json +0 -73
- package/models/trace/types/types_node_typecheck.stamp +0 -0
- package/test/invalid-animation-events.json.gz +0 -0
- package/test/test-trace-engine.mjs +0 -191
- package/third_party/legacy-javascript/bundle-tsconfig.json +0 -59
- package/third_party/legacy-javascript/bundle-tsconfig.ref.json +0 -27
- package/third_party/legacy-javascript/legacy-javascript-tsconfig.ref.json +0 -15
- package/third_party/legacy-javascript/legacy-javascript.js +0 -3
- package/third_party/legacy-javascript/legacy-javascript.js.map +0 -1
- package/third_party/legacy-javascript/lib/legacy-javascript.js +0 -1119
- package/third_party/marked/marked.d.ts +0 -1
- package/third_party/marked/marked.js +0 -1
- package/third_party/third-party-web/third-party-web.js +0 -1
- package/tsconfig.json +0 -29
|
@@ -1,731 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
let graphemeSegmenter = null;
|
|
5
|
-
export const escapeCharacters = (inputString, charsToEscape) => {
|
|
6
|
-
let foundChar = false;
|
|
7
|
-
for (let i = 0; i < charsToEscape.length; ++i) {
|
|
8
|
-
if (inputString.indexOf(charsToEscape.charAt(i)) !== -1) {
|
|
9
|
-
foundChar = true;
|
|
10
|
-
break;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
if (!foundChar) {
|
|
14
|
-
return String(inputString);
|
|
15
|
-
}
|
|
16
|
-
let result = '';
|
|
17
|
-
for (let i = 0; i < inputString.length; ++i) {
|
|
18
|
-
if (charsToEscape.indexOf(inputString.charAt(i)) !== -1) {
|
|
19
|
-
result += '\\';
|
|
20
|
-
}
|
|
21
|
-
result += inputString.charAt(i);
|
|
22
|
-
}
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
const toHexadecimal = (charCode, padToLength) => {
|
|
26
|
-
return charCode.toString(16).toUpperCase().padStart(padToLength, '0');
|
|
27
|
-
};
|
|
28
|
-
// Remember to update the third group in the regexps patternsToEscape and
|
|
29
|
-
// patternsToEscapePlusSingleQuote when adding new entries in this map.
|
|
30
|
-
const escapedReplacements = new Map([
|
|
31
|
-
['\b', '\\b'],
|
|
32
|
-
['\f', '\\f'],
|
|
33
|
-
['\n', '\\n'],
|
|
34
|
-
['\r', '\\r'],
|
|
35
|
-
['\t', '\\t'],
|
|
36
|
-
['\v', '\\v'],
|
|
37
|
-
['\'', '\\\''],
|
|
38
|
-
['\\', '\\\\'],
|
|
39
|
-
['<!--', '\\x3C!--'],
|
|
40
|
-
['<script', '\\x3Cscript'],
|
|
41
|
-
['</script', '\\x3C/script'],
|
|
42
|
-
]);
|
|
43
|
-
const UNICODE_ESCAPE_SOURCE = '[\\p{Format}\\p{Surrogate}]';
|
|
44
|
-
const UNICODE_ESCAPE_REGEX = new RegExp(UNICODE_ESCAPE_SOURCE, 'u');
|
|
45
|
-
const UNICODE_ESCAPE_GLOBAL_REGEX = new RegExp(UNICODE_ESCAPE_SOURCE, 'gu');
|
|
46
|
-
const UNICODE_ESCAPE_EXCEPT_ZWSP_SOURCE = '(?![\\u200B\\u200C\\u200D])[\\p{Format}]|\\p{Surrogate}';
|
|
47
|
-
const UNICODE_ESCAPE_EXCEPT_ZWSP_REGEX = new RegExp(UNICODE_ESCAPE_EXCEPT_ZWSP_SOURCE, 'u');
|
|
48
|
-
const UNICODE_ESCAPE_EXCEPT_ZWSP_GLOBAL_REGEX = new RegExp(UNICODE_ESCAPE_EXCEPT_ZWSP_SOURCE, 'gu');
|
|
49
|
-
/**
|
|
50
|
-
* Escapes formatting and surrogate characters in the string into literal Unicode escape sequences (e.g. \u200B).
|
|
51
|
-
* Use this when displaying strings to developers for inspection (e.g. in the Console or Object properties)
|
|
52
|
-
* where you want hidden or invisible characters to be explicitly visible as literal text.
|
|
53
|
-
*/
|
|
54
|
-
export const escapeUnicodeAsText = (content) => {
|
|
55
|
-
if (!UNICODE_ESCAPE_REGEX.test(content)) {
|
|
56
|
-
return content;
|
|
57
|
-
}
|
|
58
|
-
return content.replaceAll(UNICODE_ESCAPE_GLOBAL_REGEX, match => {
|
|
59
|
-
return match.split('').map(char => '\\u' + toHexadecimal(char.charCodeAt(0), 4)).join('');
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Escapes dangerous formatting and surrogate characters (like bidi override characters) to prevent
|
|
64
|
-
* security and layout issues, but leaves safe, layout-critical zero-width formatting characters
|
|
65
|
-
* (Zero Width Space \u200B, Zero Width Non-Joiner \u200C, and Zero Width Joiner \u200D) untouched.
|
|
66
|
-
* Use this when rendering user-controlled content inside templates or HTML markup where you want formatting
|
|
67
|
-
* characters to function normally for word wrapping or rendering layout, rather than showing as literal text.
|
|
68
|
-
*/
|
|
69
|
-
export const safeEscapeUnicode = (content) => {
|
|
70
|
-
if (!UNICODE_ESCAPE_EXCEPT_ZWSP_REGEX.test(content)) {
|
|
71
|
-
return content;
|
|
72
|
-
}
|
|
73
|
-
return content.replaceAll(UNICODE_ESCAPE_EXCEPT_ZWSP_GLOBAL_REGEX, match => {
|
|
74
|
-
return match.split('').map(char => '\\u' + toHexadecimal(char.charCodeAt(0), 4)).join('');
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
export const formatAsJSLiteral = (content) => {
|
|
78
|
-
const patternsToEscape = /(\\|<(?:!--|\/?script))|(\p{Control}|\p{Format})|(\p{Surrogate})/giu;
|
|
79
|
-
const patternsToEscapePlusSingleQuote = /(\\|'|<(?:!--|\/?script))|(\p{Control}|\p{Format})|(\p{Surrogate})/giu;
|
|
80
|
-
const escapePattern = (match, pattern, controlChar, loneSurrogate) => {
|
|
81
|
-
if (controlChar) {
|
|
82
|
-
if (escapedReplacements.has(controlChar)) {
|
|
83
|
-
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/13086
|
|
84
|
-
return escapedReplacements.get(controlChar);
|
|
85
|
-
}
|
|
86
|
-
return controlChar.split('')
|
|
87
|
-
.map(char => {
|
|
88
|
-
const charCode = char.charCodeAt(0);
|
|
89
|
-
if (controlChar.length === 1 && charCode <= 0xFF) {
|
|
90
|
-
return '\\x' + toHexadecimal(charCode, 2);
|
|
91
|
-
}
|
|
92
|
-
return '\\u' + toHexadecimal(charCode, 4);
|
|
93
|
-
})
|
|
94
|
-
.join('');
|
|
95
|
-
}
|
|
96
|
-
if (loneSurrogate) {
|
|
97
|
-
const fourDigitHex = toHexadecimal(loneSurrogate.charCodeAt(0), 4);
|
|
98
|
-
return '\\u' + fourDigitHex;
|
|
99
|
-
}
|
|
100
|
-
if (pattern) {
|
|
101
|
-
if (pattern.startsWith('<')) {
|
|
102
|
-
return '\\x3C' + pattern.slice(1);
|
|
103
|
-
}
|
|
104
|
-
return escapedReplacements.get(pattern) || '';
|
|
105
|
-
}
|
|
106
|
-
return match;
|
|
107
|
-
};
|
|
108
|
-
let escapedContent = '';
|
|
109
|
-
let quote = '';
|
|
110
|
-
if (!content.includes('\'')) {
|
|
111
|
-
quote = '\'';
|
|
112
|
-
escapedContent = content.replaceAll(patternsToEscape, escapePattern);
|
|
113
|
-
}
|
|
114
|
-
else if (!content.includes('"')) {
|
|
115
|
-
quote = '"';
|
|
116
|
-
escapedContent = content.replaceAll(patternsToEscape, escapePattern);
|
|
117
|
-
}
|
|
118
|
-
else if (!content.includes('`') && !content.includes('${')) {
|
|
119
|
-
quote = '`';
|
|
120
|
-
escapedContent = content.replaceAll(patternsToEscape, escapePattern);
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
quote = '\'';
|
|
124
|
-
escapedContent = content.replaceAll(patternsToEscapePlusSingleQuote, escapePattern);
|
|
125
|
-
}
|
|
126
|
-
return `${quote}${escapedContent}${quote}`;
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
129
|
-
* This implements a subset of the sprintf() function described in the Single UNIX
|
|
130
|
-
* Specification. It supports the %s, %f, %d, and %% formatting specifiers, and
|
|
131
|
-
* understands the %m$d notation to select the m-th parameter for this substitution,
|
|
132
|
-
* as well as the optional precision for %s, %f, and %d.
|
|
133
|
-
*
|
|
134
|
-
* @param fmt format string.
|
|
135
|
-
* @param args parameters to the format string.
|
|
136
|
-
* @returns the formatted output string.
|
|
137
|
-
*/
|
|
138
|
-
export const sprintf = (fmt, ...args) => {
|
|
139
|
-
let argIndex = 0;
|
|
140
|
-
const RE = /%(?:(\d+)\$)?(?:\.(\d*))?([%dfs])/g;
|
|
141
|
-
return fmt.replaceAll(RE, (_, index, precision, specifier) => {
|
|
142
|
-
if (specifier === '%') {
|
|
143
|
-
return '%';
|
|
144
|
-
}
|
|
145
|
-
if (index !== undefined) {
|
|
146
|
-
argIndex = parseInt(index, 10) - 1;
|
|
147
|
-
if (argIndex < 0) {
|
|
148
|
-
throw new RangeError(`Invalid parameter index ${argIndex + 1}`);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
if (argIndex >= args.length) {
|
|
152
|
-
throw new RangeError(`Expected at least ${argIndex + 1} format parameters, but only ${args.length} where given.`);
|
|
153
|
-
}
|
|
154
|
-
if (specifier === 's') {
|
|
155
|
-
const argValue = String(args[argIndex++]);
|
|
156
|
-
if (precision !== undefined) {
|
|
157
|
-
return argValue.substring(0, Number(precision));
|
|
158
|
-
}
|
|
159
|
-
return argValue;
|
|
160
|
-
}
|
|
161
|
-
let argValue = Number(args[argIndex++]);
|
|
162
|
-
if (isNaN(argValue)) {
|
|
163
|
-
argValue = 0;
|
|
164
|
-
}
|
|
165
|
-
if (specifier === 'd') {
|
|
166
|
-
return String(Math.floor(argValue)).padStart(Number(precision), '0');
|
|
167
|
-
}
|
|
168
|
-
if (precision !== undefined) {
|
|
169
|
-
return argValue.toFixed(Number(precision));
|
|
170
|
-
}
|
|
171
|
-
return String(argValue);
|
|
172
|
-
});
|
|
173
|
-
};
|
|
174
|
-
export const toBase64 = (inputString) => {
|
|
175
|
-
/* note to the reader: we can't use btoa here because we need to
|
|
176
|
-
* support Unicode correctly. See the test cases for this function and
|
|
177
|
-
* also
|
|
178
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem
|
|
179
|
-
*/
|
|
180
|
-
function encodeBits(b) {
|
|
181
|
-
return b < 26 ? b + 65 : b < 52 ? b + 71 : b < 62 ? b - 4 : b === 62 ? 43 : b === 63 ? 47 : 65;
|
|
182
|
-
}
|
|
183
|
-
const encoder = new TextEncoder();
|
|
184
|
-
const data = encoder.encode(inputString.toString());
|
|
185
|
-
const n = data.length;
|
|
186
|
-
let encoded = '';
|
|
187
|
-
if (n === 0) {
|
|
188
|
-
return encoded;
|
|
189
|
-
}
|
|
190
|
-
let shift;
|
|
191
|
-
let v = 0;
|
|
192
|
-
for (let i = 0; i < n; i++) {
|
|
193
|
-
shift = i % 3;
|
|
194
|
-
v |= data[i] << (16 >>> shift & 24);
|
|
195
|
-
if (shift === 2) {
|
|
196
|
-
encoded += String.fromCharCode(encodeBits(v >>> 18 & 63), encodeBits(v >>> 12 & 63), encodeBits(v >>> 6 & 63), encodeBits(v & 63));
|
|
197
|
-
v = 0;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
if (shift === 0) {
|
|
201
|
-
encoded += String.fromCharCode(encodeBits(v >>> 18 & 63), encodeBits(v >>> 12 & 63), 61, 61);
|
|
202
|
-
}
|
|
203
|
-
else if (shift === 1) {
|
|
204
|
-
encoded += String.fromCharCode(encodeBits(v >>> 18 & 63), encodeBits(v >>> 12 & 63), encodeBits(v >>> 6 & 63), 61);
|
|
205
|
-
}
|
|
206
|
-
return encoded;
|
|
207
|
-
};
|
|
208
|
-
export const findIndexesOfSubString = (inputString, searchString) => {
|
|
209
|
-
const matches = [];
|
|
210
|
-
let i = inputString.indexOf(searchString);
|
|
211
|
-
while (i !== -1) {
|
|
212
|
-
matches.push(i);
|
|
213
|
-
i = inputString.indexOf(searchString, i + searchString.length);
|
|
214
|
-
}
|
|
215
|
-
return matches;
|
|
216
|
-
};
|
|
217
|
-
export const findLineEndingIndexes = (inputString) => {
|
|
218
|
-
const endings = findIndexesOfSubString(inputString, '\n');
|
|
219
|
-
endings.push(inputString.length);
|
|
220
|
-
return endings;
|
|
221
|
-
};
|
|
222
|
-
export const isWhitespace = (inputString) => {
|
|
223
|
-
return /^\s*$/.test(inputString);
|
|
224
|
-
};
|
|
225
|
-
export const trimURL = (url, baseURLDomain) => {
|
|
226
|
-
let result = url.replace(/^(https|http|file):\/\//i, '');
|
|
227
|
-
if (baseURLDomain) {
|
|
228
|
-
if (result.toLowerCase().startsWith(baseURLDomain.toLowerCase())) {
|
|
229
|
-
result = result.substr(baseURLDomain.length);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
return result;
|
|
233
|
-
};
|
|
234
|
-
export const collapseWhitespace = (inputString) => {
|
|
235
|
-
return inputString.replace(/[\s\xA0]+/g, ' ');
|
|
236
|
-
};
|
|
237
|
-
export const reverse = (inputString) => {
|
|
238
|
-
return inputString.split('').reverse().join('');
|
|
239
|
-
};
|
|
240
|
-
export const replaceControlCharacters = (inputString) => {
|
|
241
|
-
// Replace C0 and C1 control character sets with replacement character.
|
|
242
|
-
// Do not replace '\t', \n' and '\r'.
|
|
243
|
-
return inputString.replace(/[\0-\x08\x0B\f\x0E-\x1F\x80-\x9F]/g, '\uFFFD');
|
|
244
|
-
};
|
|
245
|
-
export const countWtf8Bytes = (inputString) => {
|
|
246
|
-
let count = 0;
|
|
247
|
-
for (let i = 0; i < inputString.length; i++) {
|
|
248
|
-
const c = inputString.charCodeAt(i);
|
|
249
|
-
if (c <= 0x7F) {
|
|
250
|
-
count++;
|
|
251
|
-
}
|
|
252
|
-
else if (c <= 0x07FF) {
|
|
253
|
-
count += 2;
|
|
254
|
-
}
|
|
255
|
-
else if (c < 0xD800 || 0xDFFF < c) {
|
|
256
|
-
count += 3;
|
|
257
|
-
}
|
|
258
|
-
else {
|
|
259
|
-
if (c <= 0xDBFF && i + 1 < inputString.length) {
|
|
260
|
-
// The current character is a leading surrogate, and there is a
|
|
261
|
-
// next character.
|
|
262
|
-
const next = inputString.charCodeAt(i + 1);
|
|
263
|
-
if (0xDC00 <= next && next <= 0xDFFF) {
|
|
264
|
-
// The next character is a trailing surrogate, meaning this
|
|
265
|
-
// is a surrogate pair.
|
|
266
|
-
count += 4;
|
|
267
|
-
i++;
|
|
268
|
-
continue;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
count += 3;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
return count;
|
|
275
|
-
};
|
|
276
|
-
export const stripLineBreaks = (inputStr) => {
|
|
277
|
-
return inputStr.replace(/(\r)?\n/g, '');
|
|
278
|
-
};
|
|
279
|
-
const EXTENDED_KEBAB_CASE_REGEXP = /^([a-z0-9]+(?:-[a-z0-9]+)*\.)*[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
280
|
-
/**
|
|
281
|
-
* Tests if the `inputStr` is following the extended Kebab Case naming convention,
|
|
282
|
-
* where words are separated with either a dash (`-`) or a dot (`.`), and all
|
|
283
|
-
* characters must be lower-case alphanumeric.
|
|
284
|
-
*
|
|
285
|
-
* For example, it will yield `true` for `'my.amazing-string.literal'`, but `false`
|
|
286
|
-
* for `'Another.AmazingLiteral'` or '`another_amazing_literal'`.
|
|
287
|
-
*
|
|
288
|
-
* @param inputStr the input string to test.
|
|
289
|
-
* @returns `true` if the `inputStr` follows the extended Kebab Case convention.
|
|
290
|
-
*/
|
|
291
|
-
export const isExtendedKebabCase = (inputStr) => {
|
|
292
|
-
return EXTENDED_KEBAB_CASE_REGEXP.test(inputStr);
|
|
293
|
-
};
|
|
294
|
-
export const toTitleCase = (inputStr) => {
|
|
295
|
-
return inputStr.substring(0, 1).toUpperCase() + inputStr.substring(1);
|
|
296
|
-
};
|
|
297
|
-
export const removeURLFragment = (inputStr) => {
|
|
298
|
-
const url = new URL(inputStr);
|
|
299
|
-
url.hash = '';
|
|
300
|
-
return url.toString();
|
|
301
|
-
};
|
|
302
|
-
const SPECIAL_REGEX_CHARACTERS = '^[]{}()\\.^$*+?|-,';
|
|
303
|
-
const SPECIAL_URL_PATTERN_CHARACTERS = '?+*(){}\\:';
|
|
304
|
-
export const regexSpecialCharacters = function () {
|
|
305
|
-
return SPECIAL_REGEX_CHARACTERS;
|
|
306
|
-
};
|
|
307
|
-
export const filterRegex = function (query) {
|
|
308
|
-
let regexString = '^(?:.*\\0)?'; // Start from beginning or after a \0
|
|
309
|
-
for (let i = 0; i < query.length; ++i) {
|
|
310
|
-
let c = query.charAt(i);
|
|
311
|
-
if (SPECIAL_REGEX_CHARACTERS.indexOf(c) !== -1) {
|
|
312
|
-
c = '\\' + c;
|
|
313
|
-
}
|
|
314
|
-
regexString += '[^\\0' + c + ']*' + c;
|
|
315
|
-
}
|
|
316
|
-
return new RegExp(regexString, 'i');
|
|
317
|
-
};
|
|
318
|
-
export const createSearchRegex = function (query, caseSensitive, isRegex, matchWholeWord = false) {
|
|
319
|
-
const regexFlags = caseSensitive ? 'g' : 'gi';
|
|
320
|
-
let regexObject;
|
|
321
|
-
if (isRegex) {
|
|
322
|
-
try {
|
|
323
|
-
regexObject = new RegExp(query, regexFlags);
|
|
324
|
-
}
|
|
325
|
-
catch {
|
|
326
|
-
// Silent catch.
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
if (!regexObject) {
|
|
330
|
-
regexObject = createPlainTextSearchRegex(query, regexFlags);
|
|
331
|
-
}
|
|
332
|
-
if (matchWholeWord && regexObject) {
|
|
333
|
-
regexObject = new RegExp(`\\b${regexObject.source}\\b`, regexFlags);
|
|
334
|
-
}
|
|
335
|
-
return regexObject;
|
|
336
|
-
};
|
|
337
|
-
export const caseInsensetiveComparator = function (a, b) {
|
|
338
|
-
a = a.toUpperCase();
|
|
339
|
-
b = b.toUpperCase();
|
|
340
|
-
if (a === b) {
|
|
341
|
-
return 0;
|
|
342
|
-
}
|
|
343
|
-
return a > b ? 1 : -1;
|
|
344
|
-
};
|
|
345
|
-
export const hashCode = function (string) {
|
|
346
|
-
if (!string) {
|
|
347
|
-
return 0;
|
|
348
|
-
}
|
|
349
|
-
// Hash algorithm for substrings is described in "Über die Komplexität der Multiplikation in
|
|
350
|
-
// eingeschränkten Branchingprogrammmodellen" by Woelfe.
|
|
351
|
-
// http://opendatastructures.org/versions/edition-0.1d/ods-java/node33.html#SECTION00832000000000000000
|
|
352
|
-
const p = ((1 << 30) * 4 - 5); // prime: 2^32 - 5
|
|
353
|
-
const z = 0x5033d967; // 32 bits from random.org
|
|
354
|
-
const z2 = 0x59d2f15d; // random odd 32 bit number
|
|
355
|
-
let s = 0;
|
|
356
|
-
let zi = 1;
|
|
357
|
-
for (let i = 0; i < string.length; i++) {
|
|
358
|
-
const xi = string.charCodeAt(i) * z2;
|
|
359
|
-
s = (s + zi * xi) % p;
|
|
360
|
-
zi = (zi * z) % p;
|
|
361
|
-
}
|
|
362
|
-
s = (s + zi * (p - 1)) % p;
|
|
363
|
-
return Math.abs(s | 0);
|
|
364
|
-
};
|
|
365
|
-
export const compare = (a, b) => {
|
|
366
|
-
if (a > b) {
|
|
367
|
-
return 1;
|
|
368
|
-
}
|
|
369
|
-
if (a < b) {
|
|
370
|
-
return -1;
|
|
371
|
-
}
|
|
372
|
-
return 0;
|
|
373
|
-
};
|
|
374
|
-
/** Returns a string that has no more than maxLength characters. Actual graphemes are used, not bytes. */
|
|
375
|
-
export const trimMiddle = (str, maxLength) => {
|
|
376
|
-
// Early return for the case where there are fewer bytes than the character limit.
|
|
377
|
-
if (str.length <= maxLength) {
|
|
378
|
-
return str;
|
|
379
|
-
}
|
|
380
|
-
const segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });
|
|
381
|
-
// If the max length is so small it can't fit the ellipsis, just return the ellipsis.
|
|
382
|
-
const ellipsis = '…';
|
|
383
|
-
const ellipsisLength = 1;
|
|
384
|
-
if (maxLength <= ellipsisLength) {
|
|
385
|
-
return ellipsis;
|
|
386
|
-
}
|
|
387
|
-
// Calculate how many graphemes to keep on each side.
|
|
388
|
-
const freeSpace = maxLength - ellipsisLength;
|
|
389
|
-
const leftCount = Math.ceil(freeSpace / 2);
|
|
390
|
-
const rightCount = Math.floor(freeSpace / 2);
|
|
391
|
-
let currentGraphemeCount = 0;
|
|
392
|
-
let leftEndIndex = 0;
|
|
393
|
-
// Sliding Window Buffer
|
|
394
|
-
// We need to know where the "Right Half" starts. Since we can't iterate backwards,
|
|
395
|
-
// we keep track of the start index of the last N graphemes we've seen.
|
|
396
|
-
const rightIndexBuffer = [];
|
|
397
|
-
// This function would be significantly simpler if we created an array of all the
|
|
398
|
-
// segments upfront, but could result in poor performance for large input strings.
|
|
399
|
-
for (const { segment, index } of segmenter.segment(str)) {
|
|
400
|
-
currentGraphemeCount++;
|
|
401
|
-
// Mark the byte index where the "Left Half" ends
|
|
402
|
-
if (currentGraphemeCount === leftCount) {
|
|
403
|
-
leftEndIndex = index + segment.length;
|
|
404
|
-
}
|
|
405
|
-
// Maintain the buffer for the "Right Half"
|
|
406
|
-
if (rightCount > 0) {
|
|
407
|
-
rightIndexBuffer.push(index);
|
|
408
|
-
if (rightIndexBuffer.length > rightCount) {
|
|
409
|
-
rightIndexBuffer.shift(); // Remove the oldest index to keep buffer size constant.
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
// If the total grapheme count didn't exceed the limit, return the original string.
|
|
414
|
-
if (currentGraphemeCount <= maxLength) {
|
|
415
|
-
return str;
|
|
416
|
-
}
|
|
417
|
-
// The first item in our buffer is exactly 'rightCount' graphemes away from the end.
|
|
418
|
-
const rightStartIndex = rightCount > 0 ? rightIndexBuffer[0] : str.length;
|
|
419
|
-
return str.slice(0, leftEndIndex) + ellipsis + str.slice(rightStartIndex);
|
|
420
|
-
};
|
|
421
|
-
/** Returns a string that has no more than maxLength characters. Actual graphemes are used, not bytes. */
|
|
422
|
-
export const trimEndWithMaxLength = (str, maxLength) => {
|
|
423
|
-
// Early return for the case where there are fewer bytes than the character limit.
|
|
424
|
-
if (str.length <= maxLength) {
|
|
425
|
-
return str;
|
|
426
|
-
}
|
|
427
|
-
const ellipsis = '…';
|
|
428
|
-
const ellipsisLength = 1;
|
|
429
|
-
const segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });
|
|
430
|
-
const iterator = segmenter.segment(str)[Symbol.iterator]();
|
|
431
|
-
let lastSegmentIndex = 0;
|
|
432
|
-
for (let i = 0; i <= maxLength - ellipsisLength; i++) {
|
|
433
|
-
const result = iterator.next();
|
|
434
|
-
if (result.done) {
|
|
435
|
-
return str;
|
|
436
|
-
}
|
|
437
|
-
lastSegmentIndex = result.value.index;
|
|
438
|
-
}
|
|
439
|
-
for (let i = 0; i < ellipsisLength; i++) {
|
|
440
|
-
if (iterator.next().done) {
|
|
441
|
-
return str;
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
return str.slice(0, lastSegmentIndex) + ellipsis;
|
|
445
|
-
};
|
|
446
|
-
/**
|
|
447
|
-
* Truncates a string to not exceed a maximum number of UTF-16 code units (as measured by JS `string.length`).
|
|
448
|
-
*
|
|
449
|
-
* Unlike simple character limiters, this helper is grapheme-aware and uses `Intl.Segmenter` to prevent
|
|
450
|
-
* slicing inside surrogate pairs (e.g. Plane 1+ characters or emojis like '𠜎' / '🥳') or combining characters
|
|
451
|
-
* (e.g. 'é' represented in NFD as 'e' + combining acute accent). If the limit falls in the middle of a
|
|
452
|
-
* grapheme cluster, the function backs off to drop the entire cluster, ensuring the result is always a valid
|
|
453
|
-
* Unicode string.
|
|
454
|
-
*
|
|
455
|
-
* @param str The string to truncate.
|
|
456
|
-
* @param maxCodeUnits The maximum allowed code unit length (must be >= 0).
|
|
457
|
-
* @returns The truncated string, guaranteed to be <= maxCodeUnits in length and grapheme-safe.
|
|
458
|
-
*/
|
|
459
|
-
export const truncateToCodeUnitLength = (str, maxCodeUnits) => {
|
|
460
|
-
if (isNaN(maxCodeUnits) || maxCodeUnits <= 0) {
|
|
461
|
-
return '';
|
|
462
|
-
}
|
|
463
|
-
if (str.length <= maxCodeUnits) {
|
|
464
|
-
return str;
|
|
465
|
-
}
|
|
466
|
-
if (!graphemeSegmenter) {
|
|
467
|
-
graphemeSegmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });
|
|
468
|
-
}
|
|
469
|
-
let lastSafeIndex = 0;
|
|
470
|
-
for (const { index, segment } of graphemeSegmenter.segment(str)) {
|
|
471
|
-
if (index + segment.length > maxCodeUnits) {
|
|
472
|
-
break;
|
|
473
|
-
}
|
|
474
|
-
lastSafeIndex = index + segment.length;
|
|
475
|
-
}
|
|
476
|
-
return str.slice(0, lastSafeIndex);
|
|
477
|
-
};
|
|
478
|
-
export const escapeForRegExp = (str) => {
|
|
479
|
-
return escapeCharacters(str, SPECIAL_REGEX_CHARACTERS);
|
|
480
|
-
};
|
|
481
|
-
export const escapeForURLPattern = (text) => {
|
|
482
|
-
return escapeCharacters(text, SPECIAL_URL_PATTERN_CHARACTERS);
|
|
483
|
-
};
|
|
484
|
-
export const naturalOrderComparator = (a, b) => {
|
|
485
|
-
const chunk = /^\d+|^\D+/;
|
|
486
|
-
let chunkA, chunkB, numA, numB;
|
|
487
|
-
while (true) {
|
|
488
|
-
if (a) {
|
|
489
|
-
if (!b) {
|
|
490
|
-
return 1;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
else {
|
|
494
|
-
if (b) {
|
|
495
|
-
return -1;
|
|
496
|
-
}
|
|
497
|
-
return 0;
|
|
498
|
-
}
|
|
499
|
-
chunkA = a.match(chunk)[0];
|
|
500
|
-
chunkB = b.match(chunk)[0];
|
|
501
|
-
numA = !Number.isNaN(Number(chunkA));
|
|
502
|
-
numB = !Number.isNaN(Number(chunkB));
|
|
503
|
-
if (numA && !numB) {
|
|
504
|
-
return -1;
|
|
505
|
-
}
|
|
506
|
-
if (numB && !numA) {
|
|
507
|
-
return 1;
|
|
508
|
-
}
|
|
509
|
-
if (numA && numB) {
|
|
510
|
-
const diff = Number(chunkA) - Number(chunkB);
|
|
511
|
-
if (diff) {
|
|
512
|
-
return diff;
|
|
513
|
-
}
|
|
514
|
-
if (chunkA.length !== chunkB.length) {
|
|
515
|
-
if (!Number(chunkA) && !Number(chunkB)) { // chunks are strings of all 0s (special case)
|
|
516
|
-
return chunkA.length - chunkB.length;
|
|
517
|
-
}
|
|
518
|
-
return chunkB.length - chunkA.length;
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
else if (chunkA !== chunkB) {
|
|
522
|
-
return (chunkA < chunkB) ? -1 : 1;
|
|
523
|
-
}
|
|
524
|
-
a = a.substring(chunkA.length);
|
|
525
|
-
b = b.substring(chunkB.length);
|
|
526
|
-
}
|
|
527
|
-
};
|
|
528
|
-
export const base64ToSize = function (content) {
|
|
529
|
-
if (!content) {
|
|
530
|
-
return 0;
|
|
531
|
-
}
|
|
532
|
-
let size = content.length * 3 / 4;
|
|
533
|
-
if (content[content.length - 1] === '=') {
|
|
534
|
-
size--;
|
|
535
|
-
}
|
|
536
|
-
if (content.length > 1 && content[content.length - 2] === '=') {
|
|
537
|
-
size--;
|
|
538
|
-
}
|
|
539
|
-
return size;
|
|
540
|
-
};
|
|
541
|
-
export const SINGLE_QUOTE = '\'';
|
|
542
|
-
export const DOUBLE_QUOTE = '"';
|
|
543
|
-
const BACKSLASH = '\\';
|
|
544
|
-
export const findUnclosedCssQuote = function (str) {
|
|
545
|
-
let unmatchedQuote = '';
|
|
546
|
-
for (let i = 0; i < str.length; ++i) {
|
|
547
|
-
const char = str[i];
|
|
548
|
-
if (char === BACKSLASH) {
|
|
549
|
-
i++;
|
|
550
|
-
continue;
|
|
551
|
-
}
|
|
552
|
-
if (char === SINGLE_QUOTE || char === DOUBLE_QUOTE) {
|
|
553
|
-
if (unmatchedQuote === char) {
|
|
554
|
-
unmatchedQuote = '';
|
|
555
|
-
}
|
|
556
|
-
else if (unmatchedQuote === '') {
|
|
557
|
-
unmatchedQuote = char;
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
return unmatchedQuote;
|
|
562
|
-
};
|
|
563
|
-
export const countUnmatchedLeftParentheses = (str) => {
|
|
564
|
-
const stringLiteralRegex = /'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"/g;
|
|
565
|
-
// Remove all matched string literals from the original string.
|
|
566
|
-
const strWithoutStrings = str.replace(stringLiteralRegex, '');
|
|
567
|
-
let unmatchedCount = 0;
|
|
568
|
-
for (const c of strWithoutStrings) {
|
|
569
|
-
if (c === '(') {
|
|
570
|
-
unmatchedCount++;
|
|
571
|
-
}
|
|
572
|
-
else if (c === ')' && unmatchedCount > 0) {
|
|
573
|
-
unmatchedCount--;
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
return unmatchedCount;
|
|
577
|
-
};
|
|
578
|
-
export const createPlainTextSearchRegex = function (query, flags) {
|
|
579
|
-
// This should be kept the same as the one in StringUtil.cpp.
|
|
580
|
-
let regex = '';
|
|
581
|
-
for (let i = 0; i < query.length; ++i) {
|
|
582
|
-
const c = query.charAt(i);
|
|
583
|
-
if (regexSpecialCharacters().indexOf(c) !== -1) {
|
|
584
|
-
regex += '\\';
|
|
585
|
-
}
|
|
586
|
-
regex += c;
|
|
587
|
-
}
|
|
588
|
-
return new RegExp(regex, flags || '');
|
|
589
|
-
};
|
|
590
|
-
export const toLowerCaseString = function (input) {
|
|
591
|
-
return input.toLowerCase();
|
|
592
|
-
};
|
|
593
|
-
/**
|
|
594
|
-
* 1: two or more consecutive uppercase letters. This is useful for identifying acronyms
|
|
595
|
-
* 2: lookahead assertion that matches a word boundary
|
|
596
|
-
* 3: numeronym: single letter followed by number and another letter
|
|
597
|
-
* 4: word starting with an optional uppercase letter
|
|
598
|
-
* 5: single digit followed by word to handle '3D' or '2px' (this might be controverial)
|
|
599
|
-
* 6: single uppercase letter or number
|
|
600
|
-
* 7: a dot character. We extract it into a separate word and remove dashes around it later.
|
|
601
|
-
* This is makes more sense conceptually and allows accounting for all possible word variants.
|
|
602
|
-
* Making dot a part of a word prevent us from handling acronyms or numeronyms after the word
|
|
603
|
-
* correctly without making the RegExp prohibitively complicated.
|
|
604
|
-
* https://regex101.com/r/FhMVKc/1
|
|
605
|
-
* <---1---><------------2-----------> <---------3--------> <-----4----> <------5-----> <-----6----> <7>
|
|
606
|
-
*/
|
|
607
|
-
const WORD = /[A-Z]{2,}(?=[A-Z0-9][a-z0-9]+|\b|_)|[A-Za-z][0-9]+[a-z]?|[A-Z]?[a-z]+|[0-9][A-Za-z]+|[A-Z]|[0-9]+|[.]/g;
|
|
608
|
-
export const toKebabCase = function (input) {
|
|
609
|
-
return (input.match?.(WORD)?.map(w => w.toLowerCase()).join('-').replaceAll('-.-', '.') || input);
|
|
610
|
-
};
|
|
611
|
-
export function toKebabCaseKeys(settingValue) {
|
|
612
|
-
return Object.fromEntries(Object.entries(settingValue).map(([key, value]) => [toKebabCase(key), value]));
|
|
613
|
-
}
|
|
614
|
-
/**
|
|
615
|
-
* Converts a given string to snake_case.
|
|
616
|
-
* This function handles camelCase, PascalCase, and acronyms, including transitions between letters and numbers.
|
|
617
|
-
* It uses Unicode-aware regular expressions (`\p{L}`, `\p{N}`, `\p{Lu}`, `\p{Ll}` with the `u` flag)
|
|
618
|
-
* to correctly process letters and numbers from various languages.
|
|
619
|
-
*
|
|
620
|
-
* @param text The input string to convert to snake_case.
|
|
621
|
-
* @returns The snake_case version of the input string.
|
|
622
|
-
*/
|
|
623
|
-
export function toSnakeCase(text) {
|
|
624
|
-
if (!text) {
|
|
625
|
-
return '';
|
|
626
|
-
}
|
|
627
|
-
// First, handle case-based transformations to insert underscores correctly.
|
|
628
|
-
// 1. Add underscore between a letter and a number.
|
|
629
|
-
// e.g., "version2" -> "version_2"
|
|
630
|
-
// 2. Add underscore between an uppercase letter sequence and a following uppercase+lowercase sequence.
|
|
631
|
-
// e.g., "APIFlags" -> "API_Flags"
|
|
632
|
-
// 3. Add underscore between a lowercase/number and an uppercase letter.
|
|
633
|
-
// e.g., "lastName" -> "last_Name", "version_2Update" -> "version_2_Update"
|
|
634
|
-
// 4. Replace sequences of non-alphanumeric with a single underscore
|
|
635
|
-
// 5. Remove any leading or trailing underscores.
|
|
636
|
-
const result = text.replace(/(\p{L})(\p{N})/gu, '$1_$2') // 1
|
|
637
|
-
.replace(/(\p{Lu}+)(\p{Lu}\p{Ll})/gu, '$1_$2') // 2
|
|
638
|
-
.replace(/(\p{Ll}|\p{N})(\p{Lu})/gu, '$1_$2') // 3
|
|
639
|
-
.toLowerCase()
|
|
640
|
-
.replace(/[^\p{L}\p{N}]+/gu, '_') // 4
|
|
641
|
-
.replace(/^_|_$/g, ''); // 5
|
|
642
|
-
return result;
|
|
643
|
-
}
|
|
644
|
-
/** Replaces the last occurrence of parameter `search` with parameter `replacement` in `input` **/
|
|
645
|
-
export const replaceLast = function (input, search, replacement) {
|
|
646
|
-
const replacementStartIndex = input.lastIndexOf(search);
|
|
647
|
-
if (replacementStartIndex === -1) {
|
|
648
|
-
return input;
|
|
649
|
-
}
|
|
650
|
-
return input.slice(0, replacementStartIndex) + input.slice(replacementStartIndex).replace(search, replacement);
|
|
651
|
-
};
|
|
652
|
-
export const stringifyWithPrecision = function stringifyWithPrecision(s, precision = 2) {
|
|
653
|
-
if (precision === 0) {
|
|
654
|
-
return s.toFixed(0);
|
|
655
|
-
}
|
|
656
|
-
const string = s.toFixed(precision).replace(/\.?0*$/, '');
|
|
657
|
-
return string === '-0' ? '0' : string;
|
|
658
|
-
};
|
|
659
|
-
/**
|
|
660
|
-
* Somewhat efficiently concatenates 2 base64 encoded strings.
|
|
661
|
-
*/
|
|
662
|
-
export const concatBase64 = function (lhs, rhs) {
|
|
663
|
-
if (lhs.length === 0 || !lhs.endsWith('=')) {
|
|
664
|
-
// Empty string or no padding, we can straight-up concatenate.
|
|
665
|
-
return lhs + rhs;
|
|
666
|
-
}
|
|
667
|
-
const lhsLeaveAsIs = lhs.substring(0, lhs.length - 4);
|
|
668
|
-
const lhsToDecode = lhs.substring(lhs.length - 4);
|
|
669
|
-
return lhsLeaveAsIs + globalThis.btoa(globalThis.atob(lhsToDecode) + globalThis.atob(rhs));
|
|
670
|
-
};
|
|
671
|
-
/**
|
|
672
|
-
* Characters that cause spreadsheet viewers (Excel, Google Sheets, LibreOffice
|
|
673
|
-
* Calc) to evaluate a cell as a formula rather than rendering it as plain text
|
|
674
|
-
* when they appear at the start of a cell.
|
|
675
|
-
*/
|
|
676
|
-
const CSV_FORMULA_TRIGGERS = new Set(['=', '+', '-', '@', '\t', '\r']);
|
|
677
|
-
/**
|
|
678
|
-
* Matches plain numeric literals (e.g. `-42`, `+3.14`, `-1e-3`).
|
|
679
|
-
* Even though negative/signed numbers start with `-` or `+`, spreadsheets parse
|
|
680
|
-
* them as numbers rather than formulas, so we exempt them from `'` prefixing to
|
|
681
|
-
* keep numeric columns usable.
|
|
682
|
-
*/
|
|
683
|
-
const CSV_PLAIN_NUMBER = /^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/;
|
|
684
|
-
/**
|
|
685
|
-
* Returns true if a spreadsheet viewer could interpret `value` as a formula
|
|
686
|
-
* (for example `=SUM(A1:A2)`, `"- Loading..."`, or `"@alice"`).
|
|
687
|
-
*/
|
|
688
|
-
function isCsvFormula(value) {
|
|
689
|
-
// Check both the raw string and the leading-whitespace-trimmed string, since
|
|
690
|
-
// some spreadsheet parsers ignore leading spaces before `=`, `+`, `-`, or `@`.
|
|
691
|
-
const trimmed = value.trimStart();
|
|
692
|
-
if (!CSV_FORMULA_TRIGGERS.has(value[0]) && !CSV_FORMULA_TRIGGERS.has(trimmed[0])) {
|
|
693
|
-
return false;
|
|
694
|
-
}
|
|
695
|
-
return !CSV_PLAIN_NUMBER.test(trimmed.trimEnd());
|
|
696
|
-
}
|
|
697
|
-
/**
|
|
698
|
-
* Formats and escapes `value` so it can be safely written as a single CSV cell.
|
|
699
|
-
*
|
|
700
|
-
* This handles two separate layers of escaping:
|
|
701
|
-
* 1. Spreadsheet formula escaping (CWE-1236 & viewer fidelity):
|
|
702
|
-
* RFC 4180 double-quoting (`"=1+1"` or `"- Loading..."`) only groups text
|
|
703
|
-
* into a single CSV column; spreadsheet apps strip the outer `"` and still
|
|
704
|
-
* evaluate cells starting with `=`, `+`, `-`, or `@` as formulas (often
|
|
705
|
-
* resulting in `#NAME?` errors or unintended formula execution). Prefixing
|
|
706
|
-
* the value with a single quote (`'`) tells spreadsheet apps to treat the
|
|
707
|
-
* cell as literal text (and they hide the leading `'` when displaying it).
|
|
708
|
-
* - Example without commas: `=SUM(A1:A2)` -> `'=SUM(A1:A2)`
|
|
709
|
-
* 2. RFC 4180 structural CSV quoting:
|
|
710
|
-
* If the cell also contains commas (`,`), double quotes (`"`), or newlines,
|
|
711
|
-
* it is wrapped in `"..."` (with inner `"` doubled to `""`) so CSV parsers
|
|
712
|
-
* do not split the cell across columns or rows.
|
|
713
|
-
* - Example with commas: `=SUM(1,2)` -> `"'=SUM(1,2)"`
|
|
714
|
-
* - Example starting with a literal quote: `"=SUM(1,2)"` -> `"""=SUM(1,2)"""`
|
|
715
|
-
* (not treated as a formula since the first character is `"`, not `=`).
|
|
716
|
-
*/
|
|
717
|
-
export const escapeCsvCell = function (value) {
|
|
718
|
-
// Step 1: Prefix formula-like text with `'` so spreadsheets render it as literal text.
|
|
719
|
-
let escaped = isCsvFormula(value) ? `'${value}` : value;
|
|
720
|
-
// Step 2: Apply standard RFC 4180 double-quoting if the cell contains quotes,
|
|
721
|
-
// commas, or line breaks so the CSV structure stays intact.
|
|
722
|
-
if (escaped.includes('"')) {
|
|
723
|
-
escaped = escaped.replace(/"/g, '""');
|
|
724
|
-
return `"${escaped}"`;
|
|
725
|
-
}
|
|
726
|
-
if (escaped.includes(',') || escaped.includes('\n') || escaped.includes('\r')) {
|
|
727
|
-
return `"${escaped}"`;
|
|
728
|
-
}
|
|
729
|
-
return escaped;
|
|
730
|
-
};
|
|
731
|
-
//# sourceMappingURL=StringUtilities.js.map
|