File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ With this flag turned on, Hawk will:
197197Typical usage is to add a special marker comment into the bundles you actually want to track, for example:
198198
199199` ` ` js
200- // @hawk:track
200+ // /*! HAWK:tracked */
201201// rest of your bundled app
202202` ` `
203203
Original file line number Diff line number Diff line change @@ -355,6 +355,7 @@ export default class Catcher {
355355 */
356356 if ( this . trackOnlyMarkedFiles ) {
357357 const hasMarker = await this . checkTrackingMarker ( error ) ;
358+
358359 if ( ! hasMarker ) {
359360 /**
360361 * Error is not from a marked file, skip it
@@ -502,7 +503,7 @@ export default class Catcher {
502503 * Check if error comes from a file marked with HAWK:tracked marker
503504 *
504505 * @param error - error to check
505- * @returns true if at least one file in stack trace contains the marker, false otherwise
506+ * @returns { boolean } true if at least one file in stack trace contains the marker, false otherwise
506507 */
507508 private async checkTrackingMarker ( error : Error | string ) : Promise < boolean > {
508509 const notAnError = ! ( error instanceof Error ) ;
@@ -536,6 +537,7 @@ export default class Catcher {
536537 */
537538 const response = await fetchTimer ( frame . file , 2000 ) ;
538539 const fileContent = await response . text ( ) ;
540+
539541 return fileContent . includes ( marker ) ;
540542 } catch {
541543 /**
@@ -549,6 +551,7 @@ export default class Catcher {
549551 /**
550552 * Return true if at least one file contains the marker
551553 */
554+
552555 return results . some ( hasMarker => hasMarker === true ) ;
553556 } catch {
554557 /**
You can’t perform that action at this time.
0 commit comments