MCPcopy Index your code
hub / github.com/angular/angular / ngDevModeResetPerfCounters

Function ngDevModeResetPerfCounters

packages/core/src/util/ng_dev_mode.ts:38–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36}
37
38function ngDevModeResetPerfCounters(): NgDevModePerfCounters {
39 const locationString = typeof location !== 'undefined' ? location.toString() : '';
40 const newCounters: NgDevModePerfCounters = {
41 hydratedNodes: 0,
42 hydratedComponents: 0,
43 dehydratedViewsRemoved: 0,
44 dehydratedViewsCleanupRuns: 0,
45 componentsSkippedHydration: 0,
46 deferBlocksWithIncrementalHydration: 0,
47 };
48
49 // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.
50 const allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1;
51 if (!allowNgDevModeTrue) {
52 global['ngDevMode'] = false;
53 } else {
54 if (typeof global['ngDevMode'] !== 'object') {
55 global['ngDevMode'] = {};
56 }
57 Object.assign(global['ngDevMode'], newCounters);
58 }
59 return newCounters;
60}
61
62/**
63 * This function checks to see if the `ngDevMode` has been set. If yes,

Callers 1

initNgDevModeFunction · 0.85

Calls 2

indexOfMethod · 0.80
toStringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…