@opensea/seadn
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -6,6 +6,7 @@ type MediaFormat = "webp" | "avif" | "jpeg" | "png"; | ||
format?: MediaFormat; | ||
quality?: number; | ||
}; | ||
declare function optimize(image: string | URL, { width, height, format }: MediaParams): string; | ||
declare function optimize(image: string | URL, { width, height, format, quality }: MediaParams): string; | ||
declare function canBeOptimized(url: URL): boolean; | ||
export { type MediaFormat, type MediaParams, canBeOptimized, optimize }; |
@@ -1,2 +0,2 @@ | ||
"use strict";var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var u=(e,t)=>{for(var r in t)a(e,r,{get:t[r],enumerable:!0})},p=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of f(t))!d.call(e,n)&&n!==r&&a(e,n,{get:()=>t[n],enumerable:!(i=c(t,n))||i.enumerable});return e};var m=e=>p(a({},"__esModule",{value:!0}),e);var l={};u(l,{canBeOptimized:()=>s,optimize:()=>o});module.exports=m(l);function o(e,{width:t,height:r,format:i}){try{typeof e=="string"&&(e=new URL(e))}catch(b){return e.toString()}if(!(e instanceof URL))return e;if(!s(e))return e.toString();let n=new URLSearchParams;return r!==void 0&&n.set("h",String(r)),t!==void 0&&n.set("w",String(t)),i!==void 0&&n.set("format",i),e.search=n.toString(),e.toString()}function s(e){if(!h(e))return!1;let t=e.pathname.split(".");if(t.length<=1)return!0;switch(t[t.length-1]){case"png":case"jpeg":case"webp":case"avif":case"ico":case void 0:return!0;default:return!1}}function h(e){switch(e.hostname){case"i2.dev.seadn.io":case"i2c.dev.seadn.io":case"i2.seadn.io":case"i2c.seadn.io":return!0;default:return!1}}0&&(module.exports={canBeOptimized,optimize}); | ||
"use strict";var s=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var p=(e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})},m=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of d(t))!u.call(e,n)&&n!==r&&s(e,n,{get:()=>t[n],enumerable:!(i=f(t,n))||i.enumerable});return e};var b=e=>m(s({},"__esModule",{value:!0}),e);var w={};p(w,{canBeOptimized:()=>o,optimize:()=>c});module.exports=b(w);function c(e,{width:t,height:r,format:i,quality:n}){try{typeof e=="string"&&(e=new URL(e))}catch(l){return e.toString()}if(!(e instanceof URL))return e;if(!o(e))return e.toString();let a=new URLSearchParams;if(r!==void 0&&a.set("h",String(r)),t!==void 0&&a.set("w",String(t)),i!==void 0&&a.set("format",i),n){if(n<=0||n>100)throw new Error("Quality has to be a positive number between 1 and 100");a.set("q",String(n))}return e.search=a.toString(),e.toString()}function o(e){if(!h(e))return!1;let t=e.pathname.split(".");if(t.length<=1)return!0;switch(t[t.length-1]){case"png":case"jpeg":case"webp":case"avif":case"ico":case void 0:return!0;default:return!1}}function h(e){switch(e.hostname){case"i2.dev.seadn.io":case"i2c.dev.seadn.io":case"i2.seadn.io":case"i2c.seadn.io":return!0;default:return!1}}0&&(module.exports={canBeOptimized,optimize}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@opensea/seadn", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Javascript SDK to work with SeaDN", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
14426
172