wuchale 0.17.0 → 0.17.1
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/dist/adapters.d.ts +2 -0
- package/dist/adapters.js +2 -1
- package/dist/config.js +1 -1
- package/dist/handler.js +2 -2
- package/package.json +1 -1
package/dist/adapters.d.ts
CHANGED
|
@@ -23,7 +23,9 @@ export declare class Message {
|
|
|
23
23
|
toKey: () => string;
|
|
24
24
|
}
|
|
25
25
|
export type HeuristicFunc = (msg: Message) => boolean | null | undefined;
|
|
26
|
+
/** Default heuristic */
|
|
26
27
|
export declare function defaultHeuristic(msg: Message): boolean;
|
|
28
|
+
/** Default heuristic which ignores messages outside functions in the `script` scope */
|
|
27
29
|
export declare const defaultHeuristicFuncOnly: HeuristicFunc;
|
|
28
30
|
export declare const defaultGenerateLoadID: (filename: string) => string;
|
|
29
31
|
export declare class IndexTracker {
|
package/dist/adapters.js
CHANGED
|
@@ -19,6 +19,7 @@ export class Message {
|
|
|
19
19
|
}
|
|
20
20
|
const ignoreElements = ['style', 'path', 'code', 'pre'];
|
|
21
21
|
const ignoreAttribs = [['form', 'method']];
|
|
22
|
+
/** Default heuristic */
|
|
22
23
|
export function defaultHeuristic(msg) {
|
|
23
24
|
const msgStr = msg.msgStr.join('\n');
|
|
24
25
|
if (msgStr.search(/\p{L}/u) === -1) {
|
|
@@ -50,7 +51,7 @@ export function defaultHeuristic(msg) {
|
|
|
50
51
|
}
|
|
51
52
|
return !msg.details.call?.startsWith('console.') && msg.details.call !== 'fetch';
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
+
/** Default heuristic which ignores messages outside functions in the `script` scope */
|
|
54
55
|
export const defaultHeuristicFuncOnly = msg => {
|
|
55
56
|
return defaultHeuristic(msg) && (msg.details.scope !== 'script' || msg.details.funcName != null);
|
|
56
57
|
};
|
package/dist/config.js
CHANGED
package/dist/handler.js
CHANGED
|
@@ -564,13 +564,13 @@ export class AdapterHandler {
|
|
|
564
564
|
});
|
|
565
565
|
if (this.#log.checkLevel('verbose')) {
|
|
566
566
|
if (msgs.length) {
|
|
567
|
-
this.#log.verbose(
|
|
567
|
+
this.#log.verbose(`${this.key}: ${msgs.length} messages from ${filename}:`);
|
|
568
568
|
for (const msg of msgs) {
|
|
569
569
|
this.#log.verbose(` ${msg.msgStr.join(', ')} [${msg.details.scope}]`);
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
572
|
else {
|
|
573
|
-
this.#log.verbose(
|
|
573
|
+
this.#log.verbose(`${this.key}: No messages from ${filename}.`);
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
const hmrKeys = {};
|