@opensea/seadn
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "@opensea/seadn", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Javascript SDK to work with SeaDN", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -61,2 +61,12 @@ import { test, expect } from "vitest"; | ||
[ | ||
"https://i2.seadn.io/bored-ape", | ||
{ | ||
height: 100, | ||
width: 100, | ||
format: "avif", | ||
quality: 50, | ||
} satisfies MediaParams, | ||
"https://i2.seadn.io/bored-ape?h=100&w=100&format=avif&q=50", | ||
], | ||
[ | ||
"https://xyz.com/bored-ape.png", | ||
@@ -63,0 +73,0 @@ { height: 100, width: 100, format: "avif" } satisfies MediaParams, |
@@ -7,2 +7,3 @@ export type MediaFormat = "webp" | "avif" | "jpeg" | "png"; | ||
format?: MediaFormat; | ||
quality?: number; | ||
}; | ||
@@ -12,3 +13,3 @@ | ||
image: string | URL, | ||
{ width, height, format }: MediaParams, | ||
{ width, height, format, quality }: MediaParams, | ||
): string { | ||
@@ -41,2 +42,9 @@ try { | ||
} | ||
if (quality) { | ||
if (quality <= 0 || quality > 100) { | ||
throw new Error("Quality has to be a positive number between 1 and 100"); | ||
} | ||
params.set("q", String(quality)); | ||
} | ||
image.search = params.toString(); | ||
@@ -43,0 +51,0 @@ return image.toString(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
13386
169
0