@paulirish/trace_engine 0.0.11 → 0.0.13
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/core/platform/{array-utilities.js → ArrayUtilities.js} +1 -1
- package/core/platform/ArrayUtilities.js.map +1 -0
- package/core/platform/{brand.js → Brand.js} +1 -1
- package/core/platform/{brand.js.map → Brand.js.map} +1 -1
- package/core/platform/{dom-utilities.js → DOMUtilities.js} +1 -1
- package/core/platform/DOMUtilities.js.map +1 -0
- package/core/platform/{date-utilities.js → DateUtilities.js} +1 -1
- package/core/platform/DateUtilities.js.map +1 -0
- package/core/platform/DevToolsPath.d.ts +1 -1
- package/core/platform/DevToolsPath.js.map +1 -1
- package/core/platform/{keyboard-utilities.js → KeyboardUtilities.js} +1 -1
- package/core/platform/KeyboardUtilities.js.map +1 -0
- package/core/platform/{map-utilities.js → MapUtilities.js} +1 -1
- package/core/platform/MapUtilities.js.map +1 -0
- package/core/platform/{number-utilities.js → NumberUtilities.js} +1 -1
- package/core/platform/NumberUtilities.js.map +1 -0
- package/core/platform/{promise-utilities.js → PromiseUtilities.js} +1 -1
- package/core/platform/PromiseUtilities.js.map +1 -0
- package/core/platform/{set-utilities.js → SetUtilities.js} +1 -1
- package/core/platform/SetUtilities.js.map +1 -0
- package/core/platform/{string-utilities.js → StringUtilities.js} +4 -4
- package/core/platform/StringUtilities.js.map +1 -0
- package/core/platform/Timing.d.ts +1 -1
- package/core/platform/Timing.js.map +1 -1
- package/core/platform/{typescript-utilities.js → TypescriptUtilities.js} +1 -1
- package/core/platform/TypescriptUtilities.js.map +1 -0
- package/core/platform/UIString.d.ts +1 -1
- package/core/platform/UIString.js.map +1 -1
- package/core/platform/platform-tsconfig.json +11 -16
- package/core/platform/platform.d.ts +12 -13
- package/core/platform/platform.js +16 -17
- package/core/platform/platform.js.map +1 -1
- package/generated/protocol.d.ts +83 -28
- package/models/trace/ModelImpl.d.ts +3 -0
- package/models/trace/ModelImpl.js +10 -2
- package/models/trace/ModelImpl.js.map +1 -1
- package/models/trace/Processor.d.ts +3 -1
- package/models/trace/Processor.js +43 -4
- package/models/trace/Processor.js.map +1 -1
- package/models/trace/TracingManager.js.map +1 -1
- package/models/trace/extras/FetchNodes.d.ts +10 -3
- package/models/trace/extras/FetchNodes.js +14 -1
- package/models/trace/extras/FetchNodes.js.map +1 -1
- package/models/trace/handlers/NetworkRequestsHandler.js +5 -0
- package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
- package/models/trace/handlers/RendererHandler.js +2 -1
- package/models/trace/handlers/RendererHandler.js.map +1 -1
- package/models/trace/insights/InsightRunners.d.ts +1 -0
- package/models/trace/insights/InsightRunners.js +5 -0
- package/models/trace/insights/InsightRunners.js.map +1 -0
- package/models/trace/insights/RenderBlocking.d.ts +6 -0
- package/models/trace/insights/RenderBlocking.js +27 -0
- package/models/trace/insights/RenderBlocking.js.map +1 -0
- package/models/trace/insights/bundle-tsconfig.json +1 -0
- package/models/trace/{frames → insights}/devtools_entrypoint-bundle-typescript-tsconfig.json +5 -4
- package/models/trace/{worker/processor-tsconfig.json → insights/insights-tsconfig.json} +9 -8
- package/models/trace/insights/insights.d.ts +2 -0
- package/models/trace/insights/insights.js +6 -0
- package/models/trace/insights/insights.js.map +1 -0
- package/models/trace/insights/types.d.ts +33 -0
- package/models/trace/insights/types.js +5 -0
- package/models/trace/insights/types.js.map +1 -0
- package/models/trace/trace-tsconfig.json +3 -0
- package/models/trace/trace.d.ts +2 -1
- package/models/trace/trace.js +2 -1
- package/models/trace/trace.js.map +1 -1
- package/models/trace/types/TraceEvents.d.ts +24 -0
- package/models/trace/types/TraceEvents.js.map +1 -1
- package/package.json +7 -5
- package/LICENSE +0 -27
- package/PAUL.readme.md +0 -5
- package/README.md +0 -156
- package/analyze-trace.mjs +0 -184
- package/core/platform/array-utilities.js.map +0 -1
- package/core/platform/date-utilities.js.map +0 -1
- package/core/platform/dcheck-tsconfig.json +0 -8
- package/core/platform/dcheck.d.ts +0 -4
- package/core/platform/dcheck.js +0 -5
- package/core/platform/devtools_entrypoint-bundle-tsconfig-tsconfig.json +0 -40
- package/core/platform/dom-utilities.js.map +0 -1
- package/core/platform/keyboard-utilities.js.map +0 -1
- package/core/platform/map-utilities.js.map +0 -1
- package/core/platform/number-utilities.js.map +0 -1
- package/core/platform/platform.js.compressed +0 -0
- package/core/platform/platform.js.hash +0 -1
- package/core/platform/platform.prebundle.d.ts +0 -15
- package/core/platform/platform.prebundle.js +0 -50
- package/core/platform/platform.prebundle.js.map +0 -1
- package/core/platform/platform.prebundle.ts +0 -64
- package/core/platform/promise-utilities.js.map +0 -1
- package/core/platform/set-utilities.js.map +0 -1
- package/core/platform/string-utilities.js.map +0 -1
- package/core/platform/typescript-utilities.js.map +0 -1
- package/models/trace/SDKServices.js +0 -104
- package/models/trace/SDKServices.js.map +0 -7
- package/models/trace/TraceProcessor.js +0 -133
- package/models/trace/TraceProcessor.js.map +0 -7
- package/models/trace/TreeManipulator.js +0 -85
- package/models/trace/TreeManipulator.js.map +0 -7
- package/models/trace/devtools_entrypoint-legacy-typescript-tsconfig.json +0 -43
- package/models/trace/frames/TimelineFrameModel.js +0 -392
- package/models/trace/frames/TimelineFrameModel.js.map +0 -7
- package/models/trace/frames/bundle-tsconfig.json +0 -1
- package/models/trace/frames/frames-tsconfig.json +0 -58
- package/models/trace/frames/frames.js +0 -5
- package/models/trace/frames/frames.js.map +0 -7
- package/models/trace/handlers/Migration.js +0 -27
- package/models/trace/handlers/Migration.js.map +0 -7
- package/models/trace/handlers/UberFramesHandler.js +0 -293
- package/models/trace/handlers/UberFramesHandler.js.map +0 -7
- package/models/trace/legacy-tsconfig.json +0 -1
- package/models/trace/sdk_services/DOMNodeLookup.js +0 -41
- package/models/trace/sdk_services/DOMNodeLookup.js.map +0 -7
- package/models/trace/sdk_services/LayoutShifts.js +0 -68
- package/models/trace/sdk_services/LayoutShifts.js.map +0 -7
- package/models/trace/sdk_services/bundle-tsconfig.json +0 -1
- package/models/trace/sdk_services/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -41
- package/models/trace/sdk_services/sdk_services-tsconfig.json +0 -57
- package/models/trace/sdk_services/sdk_services.js +0 -7
- package/models/trace/sdk_services/sdk_services.js.map +0 -7
- package/models/trace/trace-legacy.js +0 -16
- package/models/trace/trace-legacy.js.map +0 -7
- package/models/trace/worker/Processor.js +0 -143
- package/models/trace/worker/Processor.js.map +0 -7
- package/models/trace/worker/Types.js +0 -1
- package/models/trace/worker/Types.js.map +0 -7
- package/models/trace/worker/bundle-tsconfig.json +0 -1
- package/models/trace/worker/devtools_entrypoint-bundle-typescript-tsconfig.json +0 -41
- package/models/trace/worker/devtools_entrypoint-worker_entrypoint-typescript-tsconfig.json +0 -41
- package/models/trace/worker/worker.js +0 -7
- package/models/trace/worker/worker.js.map +0 -7
- package/models/trace/worker/worker_entrypoint-tsconfig.json +0 -1
- package/models/trace/worker/worker_entrypoint.js +0 -36
- package/models/trace/worker/worker_entrypoint.js.map +0 -7
- package/test/invalid-animation-events.json.gz +0 -0
- package/test/test-trace-engine.mjs +0 -52
- /package/core/platform/{array-utilities.d.ts → ArrayUtilities.d.ts} +0 -0
- /package/core/platform/{brand.d.ts → Brand.d.ts} +0 -0
- /package/core/platform/{dom-utilities.d.ts → DOMUtilities.d.ts} +0 -0
- /package/core/platform/{date-utilities.d.ts → DateUtilities.d.ts} +0 -0
- /package/core/platform/{keyboard-utilities.d.ts → KeyboardUtilities.d.ts} +0 -0
- /package/core/platform/{map-utilities.d.ts → MapUtilities.d.ts} +0 -0
- /package/core/platform/{number-utilities.d.ts → NumberUtilities.d.ts} +0 -0
- /package/core/platform/{promise-utilities.d.ts → PromiseUtilities.d.ts} +0 -0
- /package/core/platform/{set-utilities.d.ts → SetUtilities.d.ts} +0 -0
- /package/core/platform/{string-utilities.d.ts → StringUtilities.d.ts} +0 -0
- /package/core/platform/{typescript-utilities.d.ts → TypescriptUtilities.d.ts} +0 -0
package/README.md
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
# Trace Model (NOT FOR PUBLIC CONSUMPTION)
|
|
2
|
-
|
|
3
|
-
This folder contains the new trace engine that was first implemented for the Performance Insights panel and is now being repurposed as the primary trace engine that we use within DevTools.
|
|
4
|
-
|
|
5
|
-
## API quickstart
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
import * as TraceModel from '@paulirish/trace_engine';
|
|
9
|
-
|
|
10
|
-
polyfillDOMRect();
|
|
11
|
-
const processor = TraceModel.Processor.TraceProcessor.createWithAllHandlers();
|
|
12
|
-
|
|
13
|
-
await processor.parse(traceEvents);
|
|
14
|
-
console.log(processor.data)
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
**Note:** in reality to run in Node, you'll need to polyfill `window.DOMRect`. 😜
|
|
18
|
-
|
|
19
|
-
See the included `analyze-trace.mjs` a runnable invocation.
|
|
20
|
-
|
|
21
|
-
## Maintainer cheatsheet
|
|
22
|
-
|
|
23
|
-
See also http://go/btlax
|
|
24
|
-
|
|
25
|
-
#### Build, run, extract
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
# build bundle with esbuild
|
|
29
|
-
scripts/trace/build-trace-engine-lib.sh
|
|
30
|
-
|
|
31
|
-
# run
|
|
32
|
-
node scripts/trace/analyze-trace.mjs test/unittests/fixtures/traces/web-dev.json.gz
|
|
33
|
-
|
|
34
|
-
# test
|
|
35
|
-
node scripts/trace/test/test-trace-engine.mjs
|
|
36
|
-
|
|
37
|
-
# copy built files to $HOME/code/trace_engine
|
|
38
|
-
scripts/trace/copy-build-trace-engine-for-publish.sh
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
#### Test and publish
|
|
42
|
-
|
|
43
|
-
```sh
|
|
44
|
-
# switch to standalone
|
|
45
|
-
cd $HOME/code/trace_engine
|
|
46
|
-
|
|
47
|
-
# test
|
|
48
|
-
node test/test-trace-engine.mjs
|
|
49
|
-
|
|
50
|
-
# bump and publish
|
|
51
|
-
npm version v0.0.XXX # Manually determine next version
|
|
52
|
-
npm publish --access public --dry-run
|
|
53
|
-
npm publish --access public
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## High level architecture
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
┌──────────────┐
|
|
60
|
-
│ Model#parse ├───┐
|
|
61
|
-
└──────────────┘ │
|
|
62
|
-
│
|
|
63
|
-
┌──────────▼──────────┐
|
|
64
|
-
│async processor#parse│
|
|
65
|
-
└──────────┬──────────┘
|
|
66
|
-
│
|
|
67
|
-
┌──────────▼────────────┐
|
|
68
|
-
│for handler of handlers│
|
|
69
|
-
└───┬────────────────┬──┘
|
|
70
|
-
│ │
|
|
71
|
-
┌────────────────▼────┐ ┌─────▼────────────────┐
|
|
72
|
-
│NetworkRequestHandler│ │...many more handlers │
|
|
73
|
-
│ │ │ │
|
|
74
|
-
│ reset() │ │ │
|
|
75
|
-
│ initialize() │ │ │
|
|
76
|
-
│ │ │ │
|
|
77
|
-
│ handleEvent() │ │ │
|
|
78
|
-
│ │ │ │
|
|
79
|
-
│ finalize() │ │ │
|
|
80
|
-
│ │ │ │
|
|
81
|
-
│ data() │ │ │ │
|
|
82
|
-
└─────────────────────┘ │ └──────────────────────┘
|
|
83
|
-
│
|
|
84
|
-
│
|
|
85
|
-
┌──────────────────▼─────────────────┐
|
|
86
|
-
│const data = model.traceParsedData()│
|
|
87
|
-
└────────────────────────────────────┘
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
`Model#parse` is the entrypoint into the engine and is the public interface that consumers use to initiate tracing and to fetch data back.
|
|
91
|
-
|
|
92
|
-
All the processing is done by the `Processor`. The processor contains a series of *Handlers*, each of which is responsible for parsing events of a particular category.
|
|
93
|
-
|
|
94
|
-
The trace processor loops over every event in the trace and calls each handler in turn (done this way so we only loop over the trace file once, rather than doing it once-per-handler). A Handler is a file that exposes a set of methods, most importantly `handleEvent()` and `data()`. The `handleEvent` function will be called for each event in the trace, and it is up to an individual handler to do something with that event if it needs to. The `data` method should return the final data that has been parsed and generated by the handler.
|
|
95
|
-
|
|
96
|
-
Once processing is done (read on for more details on how to track this), you can use the `traceParsedData()` method to fetch the result of parsing a given trace.
|
|
97
|
-
|
|
98
|
-
## Enabled handlers and creating a model
|
|
99
|
-
|
|
100
|
-
At the time of writing (06 June 2023) we are midway through a migration of the Performanc Panel's trace engine from the SDK.TracingModel to the new TraceEngine. Consequently, not all of the TraceEngine's handlers are currently active, because we don't want to run expensive handlers whose data we do not yet use in the UI.
|
|
101
|
-
|
|
102
|
-
Therefore, to create a model instance, we use `Model.createWithRequiredHandlersForMigration()`, which initializes a model configured correctly with the right handlers.
|
|
103
|
-
|
|
104
|
-
Once the migration is done, we can swap to `Model.createWithAllHandlers()` and remove the code that enables a subset of the handlers to run.
|
|
105
|
-
|
|
106
|
-
If you want to strictly control the set of handlers that are run (for example, if you only want to run one particular handler), you can initialize the model yourself and pass in the set of handlers:
|
|
107
|
-
|
|
108
|
-
```ts
|
|
109
|
-
const model = new Model({
|
|
110
|
-
NetworkRequestHandler: Handlers.ModelHandlers.NetworkRequestHandler,
|
|
111
|
-
})
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
## Parsing a trace and getting data back
|
|
115
|
-
|
|
116
|
-
Once you have an instance of the model, you can call the `parse` method to take a set of raw events and parse them. Once parsed, you then have to call the `traceParsedData` method, providing an index of the trace you want to have the data for. This is because any model can store a number of traces. Each trace is given an index, which starts at 0 and increments by one as a new trace is parsed.
|
|
117
|
-
|
|
118
|
-
If you are managing multiple traces, you should store them in some form of indexed data structure so you can easily know which index to use to fetch any data from the model. You may delete a trace with `deleteTraceByIndex`, which will then update the indexes of all other traces too.
|
|
119
|
-
|
|
120
|
-
If you need to check how many traces you have, you can call `model.size()`. The latest trace's index is therefore always `model.size() - 1`.
|
|
121
|
-
|
|
122
|
-
## Waiting for updates from the model
|
|
123
|
-
|
|
124
|
-
When you call `parse` you have two options. You can `await` it, which will wait until the trace is fully parsed:
|
|
125
|
-
|
|
126
|
-
```ts
|
|
127
|
-
await this.model.parse();
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
But it's likely preferable to instead use events, to avoid blocking the UI whilst parsing is in progress. You can listen to the `ModelUpdateEvent` for updates:
|
|
131
|
-
|
|
132
|
-
```ts
|
|
133
|
-
this.model.addEventListener(Model.ModelUpdateEvent.eventName, event => {
|
|
134
|
-
const {data} = event as Model.ModelUpdateEvent;
|
|
135
|
-
|
|
136
|
-
if (data.data === 'done') {
|
|
137
|
-
// trace is complete
|
|
138
|
-
const newestData = this.model.traceParsedData(this.model.size() - 1);
|
|
139
|
-
} else {
|
|
140
|
-
// data.data will be an object: { index: X, total: Y}, which represents how many events (X) have been processed out of a total (Y).
|
|
141
|
-
// This can be used to show a progress bar, for example.
|
|
142
|
-
}
|
|
143
|
-
})
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
## The structure of the final data object
|
|
147
|
-
|
|
148
|
-
The object returned from `traceParsedData()` is an object of key-value pairs where each key is the name of a handler, and the value is the data that was parsed and returned from that handler.
|
|
149
|
-
|
|
150
|
-
```ts
|
|
151
|
-
{
|
|
152
|
-
NetworkRequestHandler: ReturnType<typeof NetworkRequestHandler['data']>,
|
|
153
|
-
LayoutShiftHandler: ReturnType<typeof LayoutShiftHandler['data']>,
|
|
154
|
-
// and so on for each enabled Handler
|
|
155
|
-
}
|
|
156
|
-
```
|
package/analyze-trace.mjs
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 The Chromium Authors. All rights reserved.
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
// Run this first:
|
|
6
|
-
// front_end/models/trace/build-trace-engine-lib.sh
|
|
7
|
-
|
|
8
|
-
/* eslint-disable rulesdir/es_modules_import */
|
|
9
|
-
import fs from 'node:fs';
|
|
10
|
-
import zlib from 'node:zlib';
|
|
11
|
-
|
|
12
|
-
/** @typedef {import('../front_end/models/trace/trace.ts')} TraceEngine */
|
|
13
|
-
|
|
14
|
-
// For types... see Connor's manual hack here:
|
|
15
|
-
// https://github.com/GoogleChrome/lighthouse/pull/15703/files#diff-ec7e073cf0e6135d4f2af9bc04fe6100ec0df80ad1686bee2da53871be5f1a7b
|
|
16
|
-
// and https://github.com/GoogleChrome/lighthouse/pull/15703/files#diff-6dab4507247217209f5ab0f6c343ca2b00af1300878abba81fb74d51cdfbedf9
|
|
17
|
-
|
|
18
|
-
/** @type {TraceEngine} */
|
|
19
|
-
import * as TraceEngine from './models/trace/trace.js';
|
|
20
|
-
|
|
21
|
-
polyfillDOMRect();
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @param {string} filename
|
|
25
|
-
* @returns {Promise<TraceEngine.TraceModel>}
|
|
26
|
-
*/
|
|
27
|
-
export async function analyzeTrace(filename) {
|
|
28
|
-
const traceEvents = loadTraceEventsFromFile(filename);
|
|
29
|
-
const model = TraceEngine.TraceModel.Model.createWithAllHandlers(TraceEngine.Types.Configuration.DEFAULT); // aka `fullTraceEngine`
|
|
30
|
-
await model.parse(traceEvents);
|
|
31
|
-
return model.traceParsedData();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// If run as CLI, parse the argv trace (or a fallback)
|
|
35
|
-
if (import.meta.url.endsWith(process?.argv[1])) {
|
|
36
|
-
cli();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async function cli() {
|
|
40
|
-
const filename = process.argv.at(2);
|
|
41
|
-
const TraceEngine = await analyzeTrace(filename);
|
|
42
|
-
console.log(TraceEngine);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @param {string=} filename
|
|
48
|
-
* @returns TraceEvent[]
|
|
49
|
-
*/
|
|
50
|
-
function loadTraceEventsFromFile(filename) {
|
|
51
|
-
const fileBuf = fs.readFileSync(filename);
|
|
52
|
-
let data;
|
|
53
|
-
if (isGzip(fileBuf)) {
|
|
54
|
-
data = zlib.gunzipSync(fileBuf);
|
|
55
|
-
} else {
|
|
56
|
-
data = fileBuf.toString('utf8');
|
|
57
|
-
}
|
|
58
|
-
const json = JSON.parse(data);
|
|
59
|
-
const traceEvents = json.traceEvents ?? json;
|
|
60
|
-
console.assert(Array.isArray(traceEvents));
|
|
61
|
-
return traceEvents;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Read the first 3 bytes looking for the gzip signature in the file header
|
|
66
|
-
* https://www.rfc-editor.org/rfc/rfc1952#page-6
|
|
67
|
-
* @param {ArrayBuffer} ab
|
|
68
|
-
* @returns boolean
|
|
69
|
-
*/
|
|
70
|
-
function isGzip(ab) {
|
|
71
|
-
const buf = new Uint8Array(ab);
|
|
72
|
-
if (!buf || buf.length < 3) {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
return buf[0] === 0x1F && buf[1] === 0x8B && buf[2] === 0x08;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function polyfillDOMRect() {
|
|
79
|
-
|
|
80
|
-
// devtools assumes clientside :(
|
|
81
|
-
|
|
82
|
-
// Everything else in here is the DOMRect polyfill
|
|
83
|
-
// https://raw.githubusercontent.com/JakeChampion/polyfill-library/master/polyfills/DOMRect/polyfill.js
|
|
84
|
-
|
|
85
|
-
(function (global) {
|
|
86
|
-
function number(v) {
|
|
87
|
-
return v === undefined ? 0 : Number(v);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function different(u, v) {
|
|
91
|
-
return u !== v && !(isNaN(u) && isNaN(v));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function DOMRect(xArg, yArg, wArg, hArg) {
|
|
95
|
-
let x, y, width, height, left, right, top, bottom;
|
|
96
|
-
|
|
97
|
-
x = number(xArg);
|
|
98
|
-
y = number(yArg);
|
|
99
|
-
width = number(wArg);
|
|
100
|
-
height = number(hArg);
|
|
101
|
-
|
|
102
|
-
Object.defineProperties(this, {
|
|
103
|
-
x: {
|
|
104
|
-
get: function () { return x; },
|
|
105
|
-
set: function (newX) {
|
|
106
|
-
if (different(x, newX)) {
|
|
107
|
-
x = newX;
|
|
108
|
-
left = right = undefined;
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
enumerable: true
|
|
112
|
-
},
|
|
113
|
-
y: {
|
|
114
|
-
get: function () { return y; },
|
|
115
|
-
set: function (newY) {
|
|
116
|
-
if (different(y, newY)) {
|
|
117
|
-
y = newY;
|
|
118
|
-
top = bottom = undefined;
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
enumerable: true
|
|
122
|
-
},
|
|
123
|
-
width: {
|
|
124
|
-
get: function () { return width; },
|
|
125
|
-
set: function (newWidth) {
|
|
126
|
-
if (different(width, newWidth)) {
|
|
127
|
-
width = newWidth;
|
|
128
|
-
left = right = undefined;
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
enumerable: true
|
|
132
|
-
},
|
|
133
|
-
height: {
|
|
134
|
-
get: function () { return height; },
|
|
135
|
-
set: function (newHeight) {
|
|
136
|
-
if (different(height, newHeight)) {
|
|
137
|
-
height = newHeight;
|
|
138
|
-
top = bottom = undefined;
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
enumerable: true
|
|
142
|
-
},
|
|
143
|
-
left: {
|
|
144
|
-
get: function () {
|
|
145
|
-
if (left === undefined) {
|
|
146
|
-
left = x + Math.min(0, width);
|
|
147
|
-
}
|
|
148
|
-
return left;
|
|
149
|
-
},
|
|
150
|
-
enumerable: true
|
|
151
|
-
},
|
|
152
|
-
right: {
|
|
153
|
-
get: function () {
|
|
154
|
-
if (right === undefined) {
|
|
155
|
-
right = x + Math.max(0, width);
|
|
156
|
-
}
|
|
157
|
-
return right;
|
|
158
|
-
},
|
|
159
|
-
enumerable: true
|
|
160
|
-
},
|
|
161
|
-
top: {
|
|
162
|
-
get: function () {
|
|
163
|
-
if (top === undefined) {
|
|
164
|
-
top = y + Math.min(0, height);
|
|
165
|
-
}
|
|
166
|
-
return top;
|
|
167
|
-
},
|
|
168
|
-
enumerable: true
|
|
169
|
-
},
|
|
170
|
-
bottom: {
|
|
171
|
-
get: function () {
|
|
172
|
-
if (bottom === undefined) {
|
|
173
|
-
bottom = y + Math.max(0, height);
|
|
174
|
-
}
|
|
175
|
-
return bottom;
|
|
176
|
-
},
|
|
177
|
-
enumerable: true
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
globalThis.DOMRect = DOMRect;
|
|
183
|
-
})(globalThis);
|
|
184
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"array-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/array-utilities.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,KAAU,EAAE,OAAU,EAAE,SAAmB,EAAW,EAAE;IACvF,IAAI,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;QAChB,OAAO,KAAK,CAAC;KACd;IACD,IAAI,SAAS,EAAE;QACb,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;KACb;IACD,KAAK,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE;QACpD,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;YACxB,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3B;KACF;IACD,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;IACrB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAIF,SAAS,IAAI,CAAC,KAAe,E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,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5D;KACF,QAAQ,KAAK,KAAK,IAAI,EAAE;IAEzB,kEAAkE;IAClE,iEAAiE;IACjE,aAAa;IACb,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE;QACzB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB,CAAI,GAAQ,EAAE,SAAoC;IACzF,OAAO,YAAY,CAAC,GAAG,EAAE,SAAS,iDAA+B,CAAC;AACpE,CAAC;AAED;;;;;;;;GAQG;AAEH,MAAM,UAAU,mBAAmB,CAAI,GAAiB,EAAE,SAAoC;IAC5F,OAAO,YAAY,CAAC,GAAG,EAAE,SAAS,qCAAyB,CAAC;AAC9D,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,kCAAkC,CAAI,GAAyB;IAC7E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACzD,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const removeElement = <T>(array: T[], element: T, firstOnly?: boolean): boolean => {\n let index = array.indexOf(element);\n if (index === -1) {\n return false;\n }\n if (firstOnly) {\n array.splice(index, 1);\n return true;\n }\n for (let i = index + 1, n = array.length; i < n; ++i) {\n if (array[i] !== element) {\n array[index++] = array[i];\n }\n }\n array.length = index;\n return true;\n};\n\ntype NumberComparator = (a: number, b: number) => number;\n\nfunction swap(array: number[], i1: number, i2: number): void {\n const temp = array[i1];\n array[i1] = array[i2];\n array[i2] = temp;\n}\n\nfunction partition(\n array: number[], comparator: NumberComparator, left: number, right: number, pivotIndex: number): number {\n const pivotValue = array[pivotIndex];\n swap(array, right, pivotIndex);\n let storeIndex = left;\n for (let i = left; i < right; ++i) {\n if (comparator(array[i], pivotValue) < 0) {\n swap(array, storeIndex, i);\n ++storeIndex;\n }\n }\n swap(array, right, storeIndex);\n return storeIndex;\n}\n\nfunction quickSortRange(\n array: number[], comparator: NumberComparator, left: number, right: number, sortWindowLeft: number,\n sortWindowRight: number): void {\n if (right <= left) {\n return;\n }\n const pivotIndex = Math.floor(Math.random() * (right - left)) + left;\n const pivotNewIndex = partition(array, comparator, left, right, pivotIndex);\n if (sortWindowLeft < pivotNewIndex) {\n quickSortRange(array, comparator, left, pivotNewIndex - 1, sortWindowLeft, sortWindowRight);\n }\n if (pivotNewIndex < sortWindowRight) {\n quickSortRange(array, comparator, pivotNewIndex + 1, right, sortWindowLeft, sortWindowRight);\n }\n}\n\nexport function sortRange(\n array: number[], comparator: NumberComparator, leftBound: number, rightBound: number, sortWindowLeft: number,\n sortWindowRight: number): number[] {\n if (leftBound === 0 && rightBound === (array.length - 1) && sortWindowLeft === 0 && sortWindowRight >= rightBound) {\n array.sort(comparator);\n } else {\n quickSortRange(array, comparator, leftBound, rightBound, sortWindowLeft, sortWindowRight);\n }\n return array;\n}\nexport const binaryIndexOf = <T, S>(array: T[], value: S, comparator: (a: S, b: T) => number): number => {\n const index = lowerBound(array, value, comparator);\n return index < array.length && comparator(value, array[index]) === 0 ? index : -1;\n};\n\nfunction mergeOrIntersect<T>(\n array1: T[], array2: T[], comparator: (a: T, b: T) => number, mergeNotIntersect: boolean): T[] {\n const result = [];\n let i = 0;\n let j = 0;\n while (i < array1.length && j < array2.length) {\n const compareValue = comparator(array1[i], array2[j]);\n if (mergeNotIntersect || !compareValue) {\n result.push(compareValue <= 0 ? array1[i] : array2[j]);\n }\n if (compareValue <= 0) {\n i++;\n }\n if (compareValue >= 0) {\n j++;\n }\n }\n if (mergeNotIntersect) {\n while (i < array1.length) {\n result.push(array1[i++]);\n }\n while (j < array2.length) {\n result.push(array2[j++]);\n }\n }\n return result;\n}\n\nexport const intersectOrdered = <T>(array1: T[], array2: T[], comparator: (a: T, b: T) => number): T[] => {\n return mergeOrIntersect(array1, array2, comparator, false);\n};\n\nexport const mergeOrdered = <T>(array1: T[], array2: T[], comparator: (a: T, b: T) => number): T[] => {\n return mergeOrIntersect(array1, array2, comparator, true);\n};\n\nexport const DEFAULT_COMPARATOR = (a: string|number, b: string|number): -1|0|1 => {\n return a < b ? -1 : (a > b ? 1 : 0);\n};\n\n/**\n * Returns the index of the element closest to the needle that is equal to or\n * greater than it. Assumes that the provided array is sorted.\n *\n * If no element is found, the right bound is returned.\n *\n * Uses the provided comparator function to determine if two items are equal or\n * if one is greater than the other. If you are working with strings or\n * numbers, you can use ArrayUtilities.DEFAULT_COMPARATOR. Otherwise, you\n * should define one that takes the needle element and an element from the\n * array and returns a positive or negative number to indicate which is greater\n * than the other.\n *\n * When specified, |left| (inclusive) and |right| (exclusive) indices\n * define the search window.\n */\nexport function lowerBound<T>(\n array: Uint32Array|Int32Array, needle: T, comparator: (needle: T, b: number) => number, left?: number,\n right?: number): number;\nexport function lowerBound<S, T>(\n array: S[], needle: T, comparator: (needle: T, b: S) => number, left?: number, right?: number): number;\nexport function lowerBound<S, T>(\n array: readonly S[], needle: T, comparator: (needle: T, b: S) => number, left?: number, right?: number): number;\nexport function lowerBound<S, T, A extends S[]>(\n array: A, needle: T, comparator: (needle: T, b: S) => number, left?: number, right?: number): number {\n let l = left || 0;\n let r = right !== undefined ? right : array.length;\n while (l < r) {\n const m = (l + r) >> 1;\n if (comparator(needle, array[m]) > 0) {\n l = m + 1;\n } else {\n r = m;\n }\n }\n return r;\n}\n\n/**\n * Returns the index of the element closest to the needle that is greater than\n * it. Assumes that the provided array is sorted.\n *\n * If no element is found, the right bound is returned.\n *\n * Uses the provided comparator function to determine if two items are equal or\n * if one is greater than the other. If you are working with strings or\n * numbers, you can use ArrayUtilities.DEFAULT_COMPARATOR. Otherwise, you\n * should define one that takes the needle element and an element from the\n * array and returns a positive or negative number to indicate which is greater\n * than the other.\n *\n * When specified, |left| (inclusive) and |right| (exclusive) indices\n * define the search window.\n */\nexport function upperBound<T>(\n array: Uint32Array, needle: T, comparator: (needle: T, b: number) => number, left?: number, right?: number): number;\nexport function upperBound<S, T>(\n array: S[], needle: T, comparator: (needle: T, b: S) => number, left?: number, right?: number): number;\nexport function upperBound<S, T, A extends S[]>(\n array: A, needle: T, comparator: (needle: T, b: S) => number, left?: number, right?: number): number {\n let l = left || 0;\n let r = right !== undefined ? right : array.length;\n while (l < r) {\n const m = (l + r) >> 1;\n if (comparator(needle, array[m]) >= 0) {\n l = m + 1;\n } else {\n r = m;\n }\n }\n return r;\n}\n\nconst enum NearestSearchStart {\n BEGINNING = 'BEGINNING',\n END = 'END',\n}\n/**\n * Obtains the first or last item in the array that satisfies the predicate function.\n * So, for example, if the array were arr = [2, 4, 6, 8, 10], and you are looking for\n * the last item arr[i] such that arr[i] < 5 you would be returned 1, because\n * array[1] is 4, the last item in the array that satisfies the\n * predicate function.\n *\n * If instead you were looking for the first item in the same array that satisfies\n * arr[i] > 5 you would be returned 2 because array[2] = 6.\n *\n * Please note: this presupposes that the array is already ordered.\n */\nfunction nearestIndex<T>(\n arr: readonly T[], predicate: (arrayItem: T) => boolean, searchStart: NearestSearchStart): number|null {\n const searchFromEnd = searchStart === NearestSearchStart.END;\n if (arr.length === 0) {\n return null;\n }\n\n let left = 0;\n let right = arr.length - 1;\n let pivot = 0;\n let matchesPredicate = false;\n let moveToTheRight = false;\n let middle = 0;\n do {\n middle = left + (right - left) / 2;\n pivot = searchFromEnd ? Math.ceil(middle) : Math.floor(middle);\n matchesPredicate = predicate(arr[pivot]);\n moveToTheRight = matchesPredicate === searchFromEnd;\n if (moveToTheRight) {\n left = Math.min(right, pivot + (left === pivot ? 1 : 0));\n } else {\n right = Math.max(left, pivot + (right === pivot ? -1 : 0));\n }\n } while (right !== left);\n\n // Special-case: the indexed item doesn't pass the predicate. This\n // occurs when none of the items in the array are a match for the\n // predicate.\n if (!predicate(arr[left])) {\n return null;\n }\n return left;\n}\n\n/**\n * Obtains the first item in the array that satisfies the predicate function.\n * So, for example, if the array was arr = [2, 4, 6, 8, 10], and you are looking for\n * the first item arr[i] such that arr[i] > 5 you would be returned 2, because\n * array[2] is 6, the first item in the array that satisfies the\n * predicate function.\n *\n * Please note: this presupposes that the array is already ordered.\n */\nexport function nearestIndexFromBeginning<T>(arr: T[], predicate: (arrayItem: T) => boolean): number|null {\n return nearestIndex(arr, predicate, NearestSearchStart.BEGINNING);\n}\n\n/**\n * Obtains the last item in the array that satisfies the predicate function.\n * So, for example, if the array was arr = [2, 4, 6, 8, 10], and you are looking for\n * the last item arr[i] such that arr[i] < 5 you would be returned 1, because\n * arr[1] is 4, the last item in the array that satisfies the\n * predicate function.\n *\n * Please note: this presupposes that the array is already ordered.\n */\n\nexport function nearestIndexFromEnd<T>(arr: readonly T[], predicate: (arrayItem: T) => boolean): number|null {\n return nearestIndex(arr, predicate, NearestSearchStart.END);\n}\n\n// Type guard for ensuring that `arr` does not contain null or undefined\nexport function arrayDoesNotContainNullOrUndefined<T>(arr: (T|null|undefined)[]): arr is T[] {\n return !arr.includes(null) && !arr.includes(undefined);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/date-utilities.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAU,EAAW,EAAE;IAC7C,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAAU,EAAE;IACrD,SAAS,QAAQ,CAAC,CAAS;QACzB,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,GAAG;QACtF,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;AAC5F,CAAC,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const isValid = (date: Date): boolean => {\n return !isNaN(date.getTime());\n};\n\nexport const toISO8601Compact = (date: Date): string => {\n function leadZero(x: number): string {\n return (x > 9 ? '' : '0') + x;\n }\n return date.getFullYear() + leadZero(date.getMonth() + 1) + leadZero(date.getDate()) + 'T' +\n leadZero(date.getHours()) + leadZero(date.getMinutes()) + leadZero(date.getSeconds());\n};\n"]}
|
package/core/platform/dcheck.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"allowJs": true,
|
|
4
|
-
"checkJs": true,
|
|
5
|
-
"composite": true,
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"forceConsistentCasingInFileNames": true,
|
|
8
|
-
"inlineSources": true,
|
|
9
|
-
"lib": [
|
|
10
|
-
"esnext",
|
|
11
|
-
"dom",
|
|
12
|
-
"dom.iterable"
|
|
13
|
-
],
|
|
14
|
-
"module": "esnext",
|
|
15
|
-
"noEmitOnError": true,
|
|
16
|
-
"noFallthroughCasesInSwitch": true,
|
|
17
|
-
"noImplicitReturns": true,
|
|
18
|
-
"outDir": ".",
|
|
19
|
-
"rootDir": ".",
|
|
20
|
-
"skipLibCheck": true,
|
|
21
|
-
"sourceMap": true,
|
|
22
|
-
"strict": true,
|
|
23
|
-
"target": "esnext",
|
|
24
|
-
"tsBuildInfoFile": "devtools_entrypoint-bundle-tsconfig-tsconfig.json.tsbuildinfo",
|
|
25
|
-
"typeRoots": [],
|
|
26
|
-
"useUnknownInCatchVariables": false
|
|
27
|
-
},
|
|
28
|
-
"files": [
|
|
29
|
-
"platform.prebundle.ts",
|
|
30
|
-
"../../../../../../front_end/legacy/legacy-defs.d.ts",
|
|
31
|
-
"../../../../../../front_end/global_typings/global_defs.d.ts",
|
|
32
|
-
"../../../../../../front_end/global_typings/request_idle_callback.d.ts",
|
|
33
|
-
"../../../../../../node_modules/@types/filesystem/index.d.ts"
|
|
34
|
-
],
|
|
35
|
-
"references": [
|
|
36
|
-
{
|
|
37
|
-
"path": "./platform-tsconfig.json"
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dom-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/dom-utilities.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAa;IAC7C,IAAI,aAAa,GAAiB,GAAG,CAAC,aAAa,CAAC;IACpD,OAAO,aAAa,IAAI,aAAa,CAAC,UAAU,IAAI,aAAa,CAAC,UAAU,CAAC,aAAa,EAAE;QAC1F,aAAa,GAAG,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC;KACxD;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,IAAU;IACtD,IAAI,UAAU,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAC/C,OAAO,UAAU,EAAE;QACjB,IAAI,UAAU,YAAY,UAAU,EAAE;YACpC,OAAO,UAAU,CAAC;SACnB;QACD,UAAU,GAAG,UAAU,CAAC,sBAAsB,EAAE,CAAC;KAClD;IACD,OAAO,IAAI,CAAC;AACd,CAAC;A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AC;gBACvC,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC;SAC3F;KACF;SAAM;QACL,OAAO,GAAG,QAAQ,CAAC;QACnB,SAAS,GAAG,MAAM,CAAC;KACpB;IAED,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE;QAC3B,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;KAC1D;IACD,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC;IACpD,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACxC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAElC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/**\n * `document.activeElement` will not enter shadow roots to find the element\n * that has focus; use this method if you need to traverse through any shadow\n * roots to find the actual, specific focused element.\n */\nexport function deepActiveElement(doc: Document): Element|null {\n let activeElement: Element|null = doc.activeElement;\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n return activeElement;\n}\n\nexport function getEnclosingShadowRootForNode(node: Node): Node|null {\n let parentNode = node.parentNodeOrShadowHost();\n while (parentNode) {\n if (parentNode instanceof ShadowRoot) {\n return parentNode;\n }\n parentNode = parentNode.parentNodeOrShadowHost();\n }\n return null;\n}\n\nexport function rangeOfWord(\n rootNode: Node, offset: number, stopCharacters: string, stayWithinNode: Node, direction?: string): Range {\n let startNode;\n let startOffset = 0;\n let endNode;\n let endOffset = 0;\n\n if (!stayWithinNode) {\n stayWithinNode = rootNode;\n }\n\n if (!direction || direction === 'backward' || direction === 'both') {\n let node: Node|null = rootNode;\n while (node) {\n if (node === stayWithinNode) {\n if (!startNode) {\n startNode = stayWithinNode;\n }\n break;\n }\n\n if (node.nodeType === Node.TEXT_NODE && node.nodeValue !== null) {\n const start = (node === rootNode ? (offset - 1) : (node.nodeValue.length - 1));\n for (let i = start; i >= 0; --i) {\n if (stopCharacters.indexOf(node.nodeValue[i]) !== -1) {\n startNode = node;\n startOffset = i + 1;\n break;\n }\n }\n }\n\n if (startNode) {\n break;\n }\n\n node = node.traversePreviousNode(stayWithinNode);\n }\n\n if (!startNode) {\n startNode = stayWithinNode;\n startOffset = 0;\n }\n } else {\n startNode = rootNode;\n startOffset = offset;\n }\n\n if (!direction || direction === 'forward' || direction === 'both') {\n let node: (Node|null)|Node = rootNode;\n while (node) {\n if (node === stayWithinNode) {\n if (!endNode) {\n endNode = stayWithinNode;\n }\n break;\n }\n\n if (node.nodeType === Node.TEXT_NODE && node.nodeValue !== null) {\n const start = (node === rootNode ? offset : 0);\n for (let i = start; i < node.nodeValue.length; ++i) {\n if (stopCharacters.indexOf(node.nodeValue[i]) !== -1) {\n endNode = node;\n endOffset = i;\n break;\n }\n }\n }\n\n if (endNode) {\n break;\n }\n\n node = node.traverseNextNode(stayWithinNode);\n }\n\n if (!endNode) {\n endNode = stayWithinNode;\n endOffset = stayWithinNode.nodeType === Node.TEXT_NODE ? stayWithinNode.nodeValue?.length || 0 :\n stayWithinNode.childNodes.length;\n }\n } else {\n endNode = rootNode;\n endOffset = offset;\n }\n\n if (!rootNode.ownerDocument) {\n throw new Error('No `ownerDocument` found for rootNode');\n }\n const result = rootNode.ownerDocument.createRange();\n result.setStart(startNode, startOffset);\n result.setEnd(endNode, endOffset);\n\n return result;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/keyboard-utilities.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAc7B,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AACjC,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC;AACnC,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC;AAE7B,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAW;;;;;CAK3C,CAAC,CAAC;AAEH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,UAAU,CAAC,GAAG,CAAC,GAAe,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAoB;IACpD,OAAO,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC;AACpD,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const enum ArrowKey {\n UP = 'ArrowUp',\n DOWN = 'ArrowDown',\n LEFT = 'ArrowLeft',\n RIGHT = 'ArrowRight',\n}\n\nexport const enum PageKey {\n UP = 'PageUp',\n DOWN = 'PageDown',\n}\n\nexport const ENTER_KEY = 'Enter';\nexport const ESCAPE_KEY = 'Escape';\nexport const TAB_KEY = 'Tab';\n\nexport const ARROW_KEYS = new Set<ArrowKey>([\n ArrowKey.UP,\n ArrowKey.DOWN,\n ArrowKey.LEFT,\n ArrowKey.RIGHT,\n]);\n\nexport function keyIsArrowKey(key: string): key is ArrowKey {\n return ARROW_KEYS.has(key as ArrowKey);\n}\n\nexport function isEscKey(event: KeyboardEvent): boolean {\n return event.key === 'Escape';\n}\n\nexport function isEnterOrSpaceKey(event: KeyboardEvent): boolean {\n return event.key === 'Enter' || event.key === ' ';\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/map-utilities.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B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source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const inverse = function<K, V>(map: Map<K, V>): Multimap<V, K> {\n const result = new Multimap<V, K>();\n for (const [key, value] of map.entries()) {\n result.set(value, key);\n }\n return result;\n};\n\nexport class Multimap<K, V> {\n private map = new Map<K, Set<V>>();\n\n set(key: K, value: V): void {\n let set = this.map.get(key);\n if (!set) {\n set = new Set();\n this.map.set(key, set);\n }\n set.add(value);\n }\n\n get(key: K): Set<V> {\n return this.map.get(key) || new Set();\n }\n\n has(key: K): boolean {\n return this.map.has(key);\n }\n\n hasValue(key: K, value: V): boolean {\n const set = this.map.get(key);\n if (!set) {\n return false;\n }\n return set.has(value);\n }\n\n get size(): number {\n return this.map.size;\n }\n\n delete(key: K, value: V): boolean {\n const values = this.get(key);\n if (!values) {\n return false;\n }\n const result = values.delete(value);\n if (!values.size) {\n this.map.delete(key);\n }\n return result;\n }\n\n deleteAll(key: K): void {\n this.map.delete(key);\n }\n\n keysArray(): K[] {\n return [...this.map.keys()];\n }\n\n valuesArray(): V[] {\n const result = [];\n for (const set of this.map.values()) {\n result.push(...set.values());\n }\n return result;\n }\n\n clear(): void {\n this.map.clear();\n }\n}\n\n/**\n * Gets value for key, assigning a default if value is falsy.\n */\nexport function getWithDefault<K extends {}, V>(\n map: WeakMap<K, V>|Map<K, V>, key: K, defaultValueFactory: (key?: K) => V): V {\n let value = map.get(key);\n if (!value) {\n value = defaultValueFactory(key);\n map.set(key, value);\n }\n\n return value;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/number-utilities.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,GAAW,EAAU,EAAE;IACrE,IAAI,aAAa,GAAG,GAAG,CAAC;IACxB,IAAI,GAAG,GAAG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OAAO,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAS,GAAW;IACxD,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,MAAM,EAAE,GAAG,cAAc,CAAC;IAC1B,OAAO,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;QACpB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;KACnC,CAAE,+BAA+B;IAClC,OAAO,GAAG,CAAC;AACb,CAAC,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const clamp = (num: number, min: number, max: number): number => {\n let clampedNumber = num;\n if (num < min) {\n clampedNumber = min;\n } else if (num > max) {\n clampedNumber = max;\n }\n return clampedNumber;\n};\n\nexport const mod = (m: number, n: number): number => {\n return ((m % n) + n) % n;\n};\n\nexport const bytesToString = (bytes: number): string => {\n if (bytes < 1000) {\n return `${bytes.toFixed(0)}\\xA0B`;\n }\n\n const kilobytes = bytes / 1000;\n if (kilobytes < 100) {\n return `${kilobytes.toFixed(1)}\\xA0kB`;\n }\n if (kilobytes < 1000) {\n return `${kilobytes.toFixed(0)}\\xA0kB`;\n }\n\n const megabytes = kilobytes / 1000;\n if (megabytes < 100) {\n return `${megabytes.toFixed(1)}\\xA0MB`;\n }\n return `${megabytes.toFixed(0)}\\xA0MB`;\n};\n\nexport const toFixedIfFloating = (value: string): string => {\n if (!value || Number.isNaN(Number(value))) {\n return value;\n }\n const number = Number(value);\n return number % 1 ? number.toFixed(3) : String(number);\n};\n\n/**\n * Rounds a number (including float) down.\n */\nexport const floor = (value: number, precision: number = 0): number => {\n const mult = Math.pow(10, precision);\n return Math.floor(value * mult) / mult;\n};\n\n/**\n * Computes the great common divisor for two numbers.\n * If the numbers are floats, they will be rounded to an integer.\n */\nexport const greatestCommonDivisor = (a: number, b: number): number => {\n a = Math.round(a);\n b = Math.round(b);\n while (b !== 0) {\n const t = b;\n b = a % b;\n a = t;\n }\n return a;\n};\n\nconst commonRatios = new Map([\n ['8∶5', '16∶10'],\n]);\n\nexport const aspectRatio = (width: number, height: number): string => {\n const divisor = greatestCommonDivisor(width, height);\n if (divisor !== 0) {\n width /= divisor;\n height /= divisor;\n }\n const result = `${width}∶${height}`;\n return commonRatios.get(result) || result;\n};\n\nexport const withThousandsSeparator = function(num: number): string {\n let str = String(num);\n const re = /(\\d+)(\\d{3})/;\n while (str.match(re)) {\n str = str.replace(re, '$1\\xA0$2');\n } // \\xa0 is a non-breaking space\n return str;\n};\n"]}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
da7fcbc6595ae828a8f968354a0793bbe528d175
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as ArrayUtilities from './array-utilities.js';
|
|
2
|
-
import * as DateUtilities from './date-utilities.js';
|
|
3
|
-
import * as DevToolsPath from './DevToolsPath.js';
|
|
4
|
-
import * as DOMUtilities from './dom-utilities.js';
|
|
5
|
-
import * as KeyboardUtilities from './keyboard-utilities.js';
|
|
6
|
-
import * as MapUtilities from './map-utilities.js';
|
|
7
|
-
import * as NumberUtilities from './number-utilities.js';
|
|
8
|
-
import * as SetUtilities from './set-utilities.js';
|
|
9
|
-
import * as StringUtilities from './string-utilities.js';
|
|
10
|
-
import * as TypeScriptUtilities from './typescript-utilities.js';
|
|
11
|
-
import * as UIString from './UIString.js';
|
|
12
|
-
import * as UserVisibleError from './UserVisibleError.js';
|
|
13
|
-
export { DCHECK } from './dcheck.js';
|
|
14
|
-
export { assertNever, assertNotNullOrUndefined, assertUnhandled } from './typescript-utilities.js';
|
|
15
|
-
export { ArrayUtilities, DateUtilities, DevToolsPath, DOMUtilities, KeyboardUtilities, MapUtilities, NumberUtilities, SetUtilities, StringUtilities, TypeScriptUtilities, UIString, UserVisibleError, };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2019 Google Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Redistribution and use in source and binary forms, with or without
|
|
5
|
-
* modification, are permitted provided that the following conditions are
|
|
6
|
-
* met:
|
|
7
|
-
*
|
|
8
|
-
* * Redistributions of source code must retain the above copyright
|
|
9
|
-
* notice, this list of conditions and the following disclaimer.
|
|
10
|
-
* * Redistributions in binary form must reproduce the above
|
|
11
|
-
* copyright notice, this list of conditions and the following disclaimer
|
|
12
|
-
* in the documentation and/or other materials provided with the
|
|
13
|
-
* distribution.
|
|
14
|
-
* * Neither the name of Google Inc. nor the names of its
|
|
15
|
-
* contributors may be used to endorse or promote products derived from
|
|
16
|
-
* this software without specific prior written permission.
|
|
17
|
-
*
|
|
18
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
19
|
-
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
20
|
-
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
21
|
-
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
22
|
-
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
23
|
-
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
24
|
-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
25
|
-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
26
|
-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
27
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
29
|
-
*/
|
|
30
|
-
import * as ArrayUtilities from './array-utilities.js';
|
|
31
|
-
import * as DateUtilities from './date-utilities.js';
|
|
32
|
-
import * as DevToolsPath from './DevToolsPath.js';
|
|
33
|
-
import * as DOMUtilities from './dom-utilities.js';
|
|
34
|
-
import * as KeyboardUtilities from './keyboard-utilities.js';
|
|
35
|
-
import * as MapUtilities from './map-utilities.js';
|
|
36
|
-
import * as NumberUtilities from './number-utilities.js';
|
|
37
|
-
import * as SetUtilities from './set-utilities.js';
|
|
38
|
-
import * as StringUtilities from './string-utilities.js';
|
|
39
|
-
import * as TypeScriptUtilities from './typescript-utilities.js';
|
|
40
|
-
import * as UIString from './UIString.js';
|
|
41
|
-
import * as UserVisibleError from './UserVisibleError.js';
|
|
42
|
-
export { DCHECK } from './dcheck.js';
|
|
43
|
-
/* `assertNotNull` also need to be exposed, as TypeScript does not
|
|
44
|
-
* allow `asserts` functions to be used with qualified access
|
|
45
|
-
* (e.g. `Platform.TypeScriptUtilities.assertNotNull` causes a
|
|
46
|
-
* compiler error)
|
|
47
|
-
*/
|
|
48
|
-
export { assertNever, assertNotNullOrUndefined, assertUnhandled } from './typescript-utilities.js';
|
|
49
|
-
export { ArrayUtilities, DateUtilities, DevToolsPath, DOMUtilities, KeyboardUtilities, MapUtilities, NumberUtilities, SetUtilities, StringUtilities, TypeScriptUtilities, UIString, UserVisibleError, };
|
|
50
|
-
//# sourceMappingURL=platform.prebundle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platform.prebundle.js","sourceRoot":"","sources":["platform.prebundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,mBAAmB,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC;;;;GAIG;AACH,OAAO,EAAC,WAAW,EAAE,wBAAwB,EAAE,eAAe,EAAC,MAAM,2BAA2B,CAAC;AACjG,OAAO,EACL,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,gBAAgB,GACjB,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as ArrayUtilities from './array-utilities.js';\nimport * as DateUtilities from './date-utilities.js';\nimport * as DevToolsPath from './DevToolsPath.js';\nimport * as DOMUtilities from './dom-utilities.js';\nimport * as KeyboardUtilities from './keyboard-utilities.js';\nimport * as MapUtilities from './map-utilities.js';\nimport * as NumberUtilities from './number-utilities.js';\nimport * as SetUtilities from './set-utilities.js';\nimport * as StringUtilities from './string-utilities.js';\nimport * as TypeScriptUtilities from './typescript-utilities.js';\nimport * as UIString from './UIString.js';\nimport * as UserVisibleError from './UserVisibleError.js';\n\nexport {DCHECK} from './dcheck.js';\n/* `assertNotNull` also need to be exposed, as TypeScript does not\n * allow `asserts` functions to be used with qualified access\n * (e.g. `Platform.TypeScriptUtilities.assertNotNull` causes a\n * compiler error)\n */\nexport {assertNever, assertNotNullOrUndefined, assertUnhandled} from './typescript-utilities.js';\nexport {\n ArrayUtilities,\n DateUtilities,\n DevToolsPath,\n DOMUtilities,\n KeyboardUtilities,\n MapUtilities,\n NumberUtilities,\n SetUtilities,\n StringUtilities,\n TypeScriptUtilities,\n UIString,\n UserVisibleError,\n};\n"]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2019 Google Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Redistribution and use in source and binary forms, with or without
|
|
5
|
-
* modification, are permitted provided that the following conditions are
|
|
6
|
-
* met:
|
|
7
|
-
*
|
|
8
|
-
* * Redistributions of source code must retain the above copyright
|
|
9
|
-
* notice, this list of conditions and the following disclaimer.
|
|
10
|
-
* * Redistributions in binary form must reproduce the above
|
|
11
|
-
* copyright notice, this list of conditions and the following disclaimer
|
|
12
|
-
* in the documentation and/or other materials provided with the
|
|
13
|
-
* distribution.
|
|
14
|
-
* * Neither the name of Google Inc. nor the names of its
|
|
15
|
-
* contributors may be used to endorse or promote products derived from
|
|
16
|
-
* this software without specific prior written permission.
|
|
17
|
-
*
|
|
18
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
19
|
-
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
20
|
-
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
21
|
-
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
22
|
-
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
23
|
-
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
24
|
-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
25
|
-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
26
|
-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
27
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
import * as ArrayUtilities from './array-utilities.js';
|
|
32
|
-
import * as DateUtilities from './date-utilities.js';
|
|
33
|
-
import * as DevToolsPath from './DevToolsPath.js';
|
|
34
|
-
import * as DOMUtilities from './dom-utilities.js';
|
|
35
|
-
import * as KeyboardUtilities from './keyboard-utilities.js';
|
|
36
|
-
import * as MapUtilities from './map-utilities.js';
|
|
37
|
-
import * as NumberUtilities from './number-utilities.js';
|
|
38
|
-
import * as SetUtilities from './set-utilities.js';
|
|
39
|
-
import * as StringUtilities from './string-utilities.js';
|
|
40
|
-
import * as TypeScriptUtilities from './typescript-utilities.js';
|
|
41
|
-
import * as UIString from './UIString.js';
|
|
42
|
-
import * as UserVisibleError from './UserVisibleError.js';
|
|
43
|
-
|
|
44
|
-
export {DCHECK} from './dcheck.js';
|
|
45
|
-
/* `assertNotNull` also need to be exposed, as TypeScript does not
|
|
46
|
-
* allow `asserts` functions to be used with qualified access
|
|
47
|
-
* (e.g. `Platform.TypeScriptUtilities.assertNotNull` causes a
|
|
48
|
-
* compiler error)
|
|
49
|
-
*/
|
|
50
|
-
export {assertNever, assertNotNullOrUndefined, assertUnhandled} from './typescript-utilities.js';
|
|
51
|
-
export {
|
|
52
|
-
ArrayUtilities,
|
|
53
|
-
DateUtilities,
|
|
54
|
-
DevToolsPath,
|
|
55
|
-
DOMUtilities,
|
|
56
|
-
KeyboardUtilities,
|
|
57
|
-
MapUtilities,
|
|
58
|
-
NumberUtilities,
|
|
59
|
-
SetUtilities,
|
|
60
|
-
StringUtilities,
|
|
61
|
-
TypeScriptUtilities,
|
|
62
|
-
UIString,
|
|
63
|
-
UserVisibleError,
|
|
64
|
-
};
|