Skip to content

Commit

Permalink
fix: use ??
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvdkolk committed Mar 26, 2024
1 parent b460bbf commit c9055dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/images/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function parseCacheControl(
export function getMaxAge(str: string | null | undefined): number {
const map = parseCacheControl(str);
if (map) {
let age = map.get('s-maxage') || map.get('max-age') || '';
let age = map.get('s-maxage') ?? map.get('max-age') ?? '';
if (age.startsWith('"') && age.endsWith('"')) {
age = age.slice(1, -1);
}
Expand Down

0 comments on commit c9055dd

Please sign in to comment.