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

@networkteam/zebra-utils

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@networkteam/zebra-utils - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

2

dist/imgproxy/loader.d.ts
import { ImageLoaderProps } from 'next/image';
declare const imgProxyLoader: (pathSegment?: string) => ({ src, width, quality }: ImageLoaderProps) => string;
declare const imgProxyLoader: (pathSegment: string | undefined, whitelistedSourceUrls: string[]) => ({ src, width, quality }: ImageLoaderProps) => string;
export default imgProxyLoader;
//# sourceMappingURL=loader.d.ts.map

@@ -8,3 +8,3 @@ "use strict";

var _utils = require("./utils");
const imgProxyLoader = (pathSegment = '_image') => ({
const imgProxyLoader = (pathSegment = '_image', whitelistedSourceUrls) => ({
src,

@@ -14,3 +14,5 @@ width,

}) => {
if (!src.startsWith('s3://')) return src;
if (!whitelistedSourceUrls.some(url => src.startsWith(url))) {
return src;
}
const encodedUrl = (0, _utils.urlSafeBase64)(src);

@@ -17,0 +19,0 @@ const params = new URLSearchParams();

{
"name": "@networkteam/zebra-utils",
"version": "0.3.0",
"version": "0.4.0",
"author": "networkteam GmbH",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -5,6 +5,8 @@ import { urlSafeBase64 } from './utils';

const imgProxyLoader =
(pathSegment: string = '_image') =>
(pathSegment: string = '_image', whitelistedSourceUrls: string[]) =>
({ src, width, quality }: ImageLoaderProps) => {
// If the source is not an S3 URL, return the original source
if (!src.startsWith('s3://')) return src;
// if the source url is not whitelisted, return the original src
if (!whitelistedSourceUrls.some((url) => src.startsWith(url))) {
return src;
}

@@ -11,0 +13,0 @@ const encodedUrl = urlSafeBase64(src);

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