Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit ed9a239

Browse files
atwalg2jasonLaster
authored andcommitted
add flow header to src/utils/dbg.js (#5896)
1 parent 2248ec9 commit ed9a239

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/utils/dbg.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
// @flow
12
import * as timings from "./timings";
23
import { prefs, features } from "./prefs";
34
import { isDevelopment } from "devtools-config";
45
import { formatPausePoints } from "./pause/pausePoints";
56

6-
function findSource(dbg, url) {
7+
function findSource(dbg: any, url: string) {
78
const sources = dbg.selectors.getSources();
89
const source = sources.find(s => (s.get("url") || "").includes(url));
910

@@ -14,23 +15,23 @@ function findSource(dbg, url) {
1415
return source.toJS();
1516
}
1617

17-
function sendPacket(dbg, packet, callback) {
18+
function sendPacket(dbg: any, packet: any, callback: () => void) {
1819
dbg.client.sendPacket(packet, callback || console.log);
1920
}
2021

21-
function sendPacketToThread(dbg, packet, callback) {
22+
function sendPacketToThread(dbg: Object, packet: any, callback: () => void) {
2223
sendPacket(
2324
dbg,
2425
{ to: dbg.connection.tabConnection.threadClient.actor, ...packet },
2526
callback
2627
);
2728
}
2829

29-
function evaluate(dbg, expression, callback) {
30+
function evaluate(dbg: Object, expression: any, callback: () => void) {
3031
dbg.client.evaluate(expression).then(callback || console.log);
3132
}
3233

33-
function bindSelectors(obj) {
34+
function bindSelectors(obj: Object): Object {
3435
return Object.keys(obj.selectors).reduce((bound, selector) => {
3536
bound[selector] = (a, b, c) =>
3637
obj.selectors[selector](obj.store.getState(), a, b, c);
@@ -39,19 +40,19 @@ function bindSelectors(obj) {
3940
}
4041

4142
function getCM() {
42-
const cm = document.querySelector(".CodeMirror");
43+
const cm: any = document.querySelector(".CodeMirror");
4344
return cm && cm.CodeMirror;
4445
}
4546

46-
function _formatPausePoints(dbg, url) {
47+
function _formatPausePoints(dbg: Object, url: string) {
4748
const source = dbg.helpers.findSource(url);
4849
const pausePoints = dbg.selectors.getPausePoints(source);
4950
console.log(formatPausePoints(source.text, pausePoints));
5051
}
5152

52-
export function setupHelper(obj) {
53+
export function setupHelper(obj: Object) {
5354
const selectors = bindSelectors(obj);
54-
const dbg = {
55+
const dbg: Object = {
5556
...obj,
5657
selectors,
5758
prefs,

0 commit comments

Comments
 (0)