mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-19 05:25:43 +00:00
15 lines
386 B
TypeScript
15 lines
386 B
TypeScript
import { isNull, isUndefined } from "lodash-es";
|
|
|
|
export const isNullorUndefined = (value: any) => {
|
|
return isNull(value) || isUndefined(value);
|
|
};
|
|
|
|
export const getFaviconWithGoogleS2 = (url: string) => {
|
|
try {
|
|
const urlObject = new URL(url);
|
|
return `https://www.google.com/s2/favicons?sz=128&domain=${urlObject.hostname}`;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
};
|