mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-26 05:48:11 +08:00
Remove usage of 'null' in favor of 'undefined'
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import GraphiteLogotypeSolid from "@/../assets/graphics/graphite-logotype-solid.svg";
|
||||
|
||||
const GRAPHICS = {
|
||||
GraphiteLogotypeSolid: { component: GraphiteLogotypeSolid, size: null },
|
||||
GraphiteLogotypeSolid: { component: GraphiteLogotypeSolid, size: undefined },
|
||||
} as const;
|
||||
|
||||
// 12px Solid
|
||||
@@ -255,7 +255,7 @@ export const ICONS: IconDefinitionType<typeof ICON_LIST> = ICON_LIST;
|
||||
export const ICON_COMPONENTS = Object.fromEntries(Object.entries(ICONS).map(([name, data]) => [name, data.component]));
|
||||
|
||||
export type IconName = keyof typeof ICONS;
|
||||
export type IconSize = null | 12 | 16 | 24 | 32;
|
||||
export type IconSize = undefined | 12 | 16 | 24 | 32;
|
||||
export type IconStyle = "Normal" | "Node";
|
||||
|
||||
// The following helper type declarations allow us to avoid manually maintaining the `IconName` type declaration as a string union paralleling the keys of the
|
||||
|
||||
@@ -8,17 +8,17 @@ export function browserVersion(): string {
|
||||
}
|
||||
|
||||
if (match[1] === "Chrome") {
|
||||
let browser = agent.match(/\bEdg\/(\d+)/);
|
||||
if (browser !== null) return `Edge (Chromium) ${browser[1]}`;
|
||||
let browser = agent.match(/\bEdg\/(\d+)/) || undefined;
|
||||
if (browser !== undefined) return `Edge (Chromium) ${browser[1]}`;
|
||||
|
||||
browser = agent.match(/\bOPR\/(\d+)/);
|
||||
if (browser !== null) return `Opera ${browser[1]}`;
|
||||
browser = agent.match(/\bOPR\/(\d+)/) || undefined;
|
||||
if (browser !== undefined) return `Opera ${browser[1]}`;
|
||||
}
|
||||
|
||||
match = match[2] ? [match[1], match[2]] : [navigator.appName, navigator.appVersion, "-?"];
|
||||
|
||||
const browser = agent.match(/version\/(\d+)/i);
|
||||
if (browser !== null) match.splice(1, 1, browser[1]);
|
||||
const browser = agent.match(/version\/(\d+)/i) || undefined;
|
||||
if (browser !== undefined) match.splice(1, 1, browser[1]);
|
||||
|
||||
return `${match[0]} ${match[1]}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user