Skip to content

Commit db4aa46

Browse files
committed
fix: ignore zero timestamps in metric processing and update @typescript/native-preview dependency
1 parent 3b5ec80 commit db4aa46

3 files changed

Lines changed: 18 additions & 10 deletions

File tree

bun.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@types/react": "^19",
3838
"@types/react-dom": "^19",
3939
"@types/react-router-dom": "^5.3.3",
40-
"@typescript/native-preview": "^7.0.0-dev.20260403.1",
40+
"@typescript/native-preview": "^7.0.0-dev.20260407.1",
4141
"mitata": "^1.0.34",
4242
"tailwindcss": "^4.2.2",
4343
"typescript": "^6.0.2"

src/utils/hooks.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ const buildPackageMetricValue = ({
1818
buildTime,
1919
}: Pick<Package, 'name' | 'buildTime'>) => `${name}_${buildTime || 'unknown'}`;
2020

21+
const isZeroTimestamp = (timestamp: string) => {
22+
const normalizedTimestamp = timestamp.trim();
23+
return normalizedTimestamp !== '' && Number(normalizedTimestamp) === 0;
24+
};
25+
2126
export const getPackageTimestampWarnings = ({
2227
dict,
2328
packages,
@@ -82,6 +87,9 @@ export const getPackageTimestampWarnings = ({
8287
const timestamp = metricValue.startsWith(`${matchedPackage.pkg.name}_`)
8388
? metricValue.slice(matchedPackage.pkg.name.length + 1) || 'unknown'
8489
: metricValue;
90+
if (isZeroTimestamp(timestamp)) {
91+
continue;
92+
}
8593
const currentWarningTimestamps =
8694
warningTimestamps.get(matchedPackage.pkg.id) ?? new Set<string>();
8795
currentWarningTimestamps.add(timestamp);

0 commit comments

Comments
 (0)