New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

astro-selfie

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astro-selfie - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

dist/index.d.ts
import type { AstroGlobal, AstroIntegration } from 'astro';
export default function selfie(): AstroIntegration;
export declare const selfiePath: (astro: AstroGlobal) => string;
export declare const selfieUrl: (astro: AstroGlobal) => URL;

@@ -15,5 +15,7 @@ import path from 'node:path';

hooks: {
// eslint-disable-next-line @typescript-eslint/naming-convention, object-shorthand
'astro:config:done': ({ config }) => {
publicDir = config.publicDir;
},
// eslint-disable-next-line @typescript-eslint/naming-convention, object-shorthand
'astro:build:done': async ({ dir, pages }) => {

@@ -57,6 +59,13 @@ const screenshotsDir = new URL('og', publicDir);

}
export const selfiePath = (astro) => {
const pathname = astro.url.pathname === '/' ? '/' : astro.url.pathname.replace(/\/$/, '');
return new URL(`/og${pathname === '/' ? '/index' : pathname}.png`, astro.site)
.href;
const stripTrailingSlash = (input) => {
return input.replace(/\/$/, '');
};
const selfiePath = (astro) => {
const pathname = astro.url.pathname === '/'
? '/index'
: stripTrailingSlash(astro.url.pathname);
return `/og${pathname}.png`;
};
export const selfieUrl = (astro) => {
return new URL(selfiePath(astro), astro.site);
};
{
"name": "astro-selfie",
"version": "1.0.0",
"version": "1.0.1",
"description": "Astro integration to generate page screenshots to show as Open Graph images",

@@ -23,3 +23,4 @@ "license": "ISC",

"dev": "tsc --watch",
"test": "prettier --check source && xo"
"test": "prettier --check source && xo",
"prepare": "rm -rf dist && tsc"
},

@@ -26,0 +27,0 @@ "files": [

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