Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@svelte-put/avatar

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@svelte-put/avatar - npm Package Compare versions

Comparing version 1.0.10 to 1.0.11

7

lib/Avatar.svelte.d.ts
import { SvelteComponentTyped } from "svelte";
import type { AvatarProps } from './avatar.types';
import type { AvatarSlots, GravatarOptions, UIAvatarOptions } from './avatar.types';
import type { AvatarSlots, AvatarProps } from './avatar.types';
declare const __propDef: {
props: {
src?: string | undefined;
gravatar?: string | GravatarOptions | undefined;
uiAvatar?: string | UIAvatarOptions | undefined;
gravatar?: string | import("./avatar.types").GravatarOptions | undefined;
uiAvatar?: string | import("./avatar.types").UIAvatarOptions | undefined;
fallback?: string | undefined;

@@ -10,0 +9,0 @@ size?: number | undefined;

@@ -5,3 +5,3 @@ import type { AvatarProps } from './avatar.types';

*/
export declare function resolveAlt(alt?: string, gravatar?: AvatarProps['gravatar'], uiAvatar?: AvatarProps['uiAvatar']): string;
export declare function resolveAlt(alt?: string, gravatar?: AvatarProps['gravatar'], uiAvatar?: AvatarProps['uiAvatar'], src?: string): string;
/**

@@ -8,0 +8,0 @@ * @internal

@@ -14,2 +14,11 @@ import { gravatar as constructGravatarUrl, uiAvatar as constructUIAvatarUrl, } from './avatar.helpers';

}
/** @internal */
function getAltFromUrl(url) {
// match "name" or "email" query param from url
const match = url.match(/(name|email)=([^&]+)/);
if (match) {
return match[2];
}
return '';
}
/**

@@ -26,3 +35,3 @@ * @internal

*/
export function resolveAlt(alt, gravatar, uiAvatar) {
export function resolveAlt(alt, gravatar, uiAvatar, src) {
if (alt)

@@ -32,2 +41,4 @@ return alt;

return gravatar.email;
if (typeof gravatar === 'string' && gravatar)
return gravatar;
if (typeof uiAvatar === 'object' && uiAvatar.name)

@@ -37,2 +48,4 @@ return uiAvatar.name;

return uiAvatar;
if (src)
return getAltFromUrl(src);
return '';

@@ -39,0 +52,0 @@ }

{
"name": "@svelte-put/avatar",
"version": "1.0.10",
"version": "1.0.11",
"description": "Component and utils for handling avatar",

@@ -5,0 +5,0 @@ "type": "module",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc