@opensea/seadn 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- exports.resizeImage=function(r,t){var e=t.width,i=t.height,n=t.dpr,o=void 0===n?1:n;"string"==typeof r&&(r=new URL(r));var a=new URLSearchParams({auto:"format",dpr:String(o)});return void 0!==e&&a.set("w",String(e)),void 0!==i&&a.set("h",String(i)),r.search=a.toString(),r.toString()};
1
+ exports.isSupportedFormat=function(t){"string"==typeof t&&(t=new URL(t));var e=t.pathname;return e.endsWith(".jpg")||e.endsWith(".jpeg")||e.endsWith(".png")||e.endsWith(".webp")||e.endsWith(".gif")||e.startsWith("/gae/")},exports.resizeImage=function(t,e){var r=e.width,i=e.height,n=e.dpr,s=void 0===n?1:n;"string"==typeof t&&(t=new URL(t));var a=new URLSearchParams({auto:"format",dpr:String(s)});return void 0!==r&&a.set("w",String(r)),void 0!==i&&a.set("h",String(i)),t.search=a.toString(),t.toString()};
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["export type ResizeParams = {\n dpr?: number;\n width?: number;\n height?: number;\n};\n\nexport const resizeImage = (\n image: string | URL,\n { width, height, dpr = 1 }: ResizeParams\n): string => {\n if (typeof image === 'string') {\n image = new URL(image);\n }\n\n const params = new URLSearchParams({\n auto: 'format',\n dpr: String(dpr)\n });\n\n if (width !== undefined) {\n params.set('w', String(width));\n }\n if (height !== undefined) {\n params.set('h', String(height));\n }\n\n image.search = params.toString();\n return image.toString();\n};\n"],"names":["image","_ref","width","height","_ref$dpr","dpr","URL","params","URLSearchParams","auto","String","undefined","set","search","toString"],"mappings":"oBAM2B,SACzBA,EAAmBC,GACjB,IAAAC,EAAKD,EAALC,MAAOC,EAAMF,EAANE,OAAMC,EAAAH,EAAEI,IAAAA,OAAM,IAAHD,EAAG,EAACA,EAEH,iBAAVJ,IACTA,EAAQ,IAAIM,IAAIN,IAGlB,IAAMO,EAAS,IAAIC,gBAAgB,CACjCC,KAAM,SACNJ,IAAKK,OAAOL,KAWd,YARcM,IAAVT,GACFK,EAAOK,IAAI,IAAKF,OAAOR,SAEVS,IAAXR,GACFI,EAAOK,IAAI,IAAKF,OAAOP,IAGzBH,EAAMa,OAASN,EAAOO,WACfd,EAAMc,UACf"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["export type ResizeParams = {\n dpr?: number;\n width?: number;\n height?: number;\n};\n\nexport const resizeImage = (\n image: string | URL,\n { width, height, dpr = 1 }: ResizeParams\n): string => {\n if (typeof image === 'string') {\n image = new URL(image);\n }\n\n const params = new URLSearchParams({\n auto: 'format',\n dpr: String(dpr)\n });\n\n if (width !== undefined) {\n params.set('w', String(width));\n }\n if (height !== undefined) {\n params.set('h', String(height));\n }\n\n image.search = params.toString();\n return image.toString();\n};\n\nexport const isSupportedFormat = (image: string | URL) => {\n if (typeof image === 'string') {\n image = new URL(image);\n }\n\n const { pathname } = image;\n return (\n pathname.endsWith('.jpg') ||\n pathname.endsWith('.jpeg') ||\n pathname.endsWith('.png') ||\n pathname.endsWith('.webp') ||\n pathname.endsWith('.gif') ||\n pathname.startsWith('/gae/') // GoogleAppEngine URLs do not contain extensions\n );\n};\n"],"names":["image","URL","pathname","endsWith","startsWith","_ref","width","height","_ref$dpr","dpr","params","URLSearchParams","auto","String","undefined","set","search","toString"],"mappings":"0BA8BiC,SAACA,GACX,iBAAVA,IACTA,EAAQ,IAAIC,IAAID,IAGlB,IAAQE,EAAaF,EAAbE,SACR,OACEA,EAASC,SAAS,SAClBD,EAASC,SAAS,UAClBD,EAASC,SAAS,SAClBD,EAASC,SAAS,UAClBD,EAASC,SAAS,SAClBD,EAASE,WAAW,QAExB,sBAtC2B,SACzBJ,EAAmBK,GACjB,IAAAC,EAAKD,EAALC,MAAOC,EAAMF,EAANE,OAAMC,EAAAH,EAAEI,IAAAA,OAAG,IAAAD,EAAG,EAACA,EAEH,iBAAVR,IACTA,EAAQ,IAAIC,IAAID,IAGlB,IAAMU,EAAS,IAAIC,gBAAgB,CACjCC,KAAM,SACNH,IAAKI,OAAOJ,KAWd,YARcK,IAAVR,GACFI,EAAOK,IAAI,IAAKF,OAAOP,SAEVQ,IAAXP,GACFG,EAAOK,IAAI,IAAKF,OAAON,IAGzBP,EAAMgB,OAASN,EAAOO,WACfjB,EAAMiB,UACf"}
package/dist/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export type ResizeParams = {
5
5
  height?: number;
6
6
  };
7
7
  export declare const resizeImage: (image: string | URL, { width, height, dpr }: ResizeParams) => string;
8
+ export declare const isSupportedFormat: (image: string | URL) => boolean;
@@ -1,2 +1,2 @@
1
- const t=(t,{width:r,height:n,dpr:e=1})=>{"string"==typeof t&&(t=new URL(t));const i=new URLSearchParams({auto:"format",dpr:String(e)});return void 0!==r&&i.set("w",String(r)),void 0!==n&&i.set("h",String(n)),t.search=i.toString(),t.toString()};export{t as resizeImage};
1
+ const t=(t,{width:e,height:n,dpr:r=1})=>{"string"==typeof t&&(t=new URL(t));const i=new URLSearchParams({auto:"format",dpr:String(r)});return void 0!==e&&i.set("w",String(e)),void 0!==n&&i.set("h",String(n)),t.search=i.toString(),t.toString()},e=t=>{"string"==typeof t&&(t=new URL(t));const{pathname:e}=t;return e.endsWith(".jpg")||e.endsWith(".jpeg")||e.endsWith(".png")||e.endsWith(".webp")||e.endsWith(".gif")||e.startsWith("/gae/")};export{e as isSupportedFormat,t as resizeImage};
2
2
  //# sourceMappingURL=index.modern.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.modern.js","sources":["../src/index.ts"],"sourcesContent":["export type ResizeParams = {\n dpr?: number;\n width?: number;\n height?: number;\n};\n\nexport const resizeImage = (\n image: string | URL,\n { width, height, dpr = 1 }: ResizeParams\n): string => {\n if (typeof image === 'string') {\n image = new URL(image);\n }\n\n const params = new URLSearchParams({\n auto: 'format',\n dpr: String(dpr)\n });\n\n if (width !== undefined) {\n params.set('w', String(width));\n }\n if (height !== undefined) {\n params.set('h', String(height));\n }\n\n image.search = params.toString();\n return image.toString();\n};\n"],"names":["resizeImage","image","width","height","dpr","URL","params","URLSearchParams","auto","String","undefined","set","search","toString"],"mappings":"AAMa,MAAAA,EAAcA,CACzBC,GACEC,QAAOC,SAAQC,IAAAA,EAAM,MAEF,iBAAVH,IACTA,EAAQ,IAAII,IAAIJ,IAGlB,MAAMK,EAAS,IAAIC,gBAAgB,CACjCC,KAAM,SACNJ,IAAKK,OAAOL,KAWd,YARcM,IAAVR,GACFI,EAAOK,IAAI,IAAKF,OAAOP,SAEVQ,IAAXP,GACFG,EAAOK,IAAI,IAAKF,OAAON,IAGzBF,EAAMW,OAASN,EAAOO,WACfZ,EAAMY,UACf"}
1
+ {"version":3,"file":"index.modern.js","sources":["../src/index.ts"],"sourcesContent":["export type ResizeParams = {\n dpr?: number;\n width?: number;\n height?: number;\n};\n\nexport const resizeImage = (\n image: string | URL,\n { width, height, dpr = 1 }: ResizeParams\n): string => {\n if (typeof image === 'string') {\n image = new URL(image);\n }\n\n const params = new URLSearchParams({\n auto: 'format',\n dpr: String(dpr)\n });\n\n if (width !== undefined) {\n params.set('w', String(width));\n }\n if (height !== undefined) {\n params.set('h', String(height));\n }\n\n image.search = params.toString();\n return image.toString();\n};\n\nexport const isSupportedFormat = (image: string | URL) => {\n if (typeof image === 'string') {\n image = new URL(image);\n }\n\n const { pathname } = image;\n return (\n pathname.endsWith('.jpg') ||\n pathname.endsWith('.jpeg') ||\n pathname.endsWith('.png') ||\n pathname.endsWith('.webp') ||\n pathname.endsWith('.gif') ||\n pathname.startsWith('/gae/') // GoogleAppEngine URLs do not contain extensions\n );\n};\n"],"names":["resizeImage","image","width","height","dpr","URL","params","URLSearchParams","auto","String","undefined","set","search","toString","isSupportedFormat","pathname","endsWith","startsWith"],"mappings":"AAMa,MAAAA,EAAcA,CACzBC,GACEC,QAAOC,SAAQC,IAAAA,EAAM,MAEF,iBAAVH,IACTA,EAAQ,IAAII,IAAIJ,IAGlB,MAAMK,EAAS,IAAIC,gBAAgB,CACjCC,KAAM,SACNJ,IAAKK,OAAOL,KAWd,YARcM,IAAVR,GACFI,EAAOK,IAAI,IAAKF,OAAOP,SAEVQ,IAAXP,GACFG,EAAOK,IAAI,IAAKF,OAAON,IAGzBF,EAAMW,OAASN,EAAOO,WACfZ,EAAMY,YAGFC,EAAqBb,IACX,iBAAVA,IACTA,EAAQ,IAAII,IAAIJ,IAGlB,MAAMc,SAAEA,GAAad,EACrB,OACEc,EAASC,SAAS,SAClBD,EAASC,SAAS,UAClBD,EAASC,SAAS,SAClBD,EAASC,SAAS,UAClBD,EAASC,SAAS,SAClBD,EAASE,WAAW,QAAO"}
@@ -1,2 +1,2 @@
1
- var r=function(r,t){var i=t.width,n=t.height,e=t.dpr,o=void 0===e?1:e;"string"==typeof r&&(r=new URL(r));var a=new URLSearchParams({auto:"format",dpr:String(o)});return void 0!==i&&a.set("w",String(i)),void 0!==n&&a.set("h",String(n)),r.search=a.toString(),r.toString()};export{r as resizeImage};
1
+ var t=function(t,n){var r=n.width,e=n.height,i=n.dpr,a=void 0===i?1:i;"string"==typeof t&&(t=new URL(t));var g=new URLSearchParams({auto:"format",dpr:String(a)});return void 0!==r&&g.set("w",String(r)),void 0!==e&&g.set("h",String(e)),t.search=g.toString(),t.toString()},n=function(t){"string"==typeof t&&(t=new URL(t));var n=t.pathname;return n.endsWith(".jpg")||n.endsWith(".jpeg")||n.endsWith(".png")||n.endsWith(".webp")||n.endsWith(".gif")||n.startsWith("/gae/")};export{n as isSupportedFormat,t as resizeImage};
2
2
  //# sourceMappingURL=index.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.module.js","sources":["../src/index.ts"],"sourcesContent":["export type ResizeParams = {\n dpr?: number;\n width?: number;\n height?: number;\n};\n\nexport const resizeImage = (\n image: string | URL,\n { width, height, dpr = 1 }: ResizeParams\n): string => {\n if (typeof image === 'string') {\n image = new URL(image);\n }\n\n const params = new URLSearchParams({\n auto: 'format',\n dpr: String(dpr)\n });\n\n if (width !== undefined) {\n params.set('w', String(width));\n }\n if (height !== undefined) {\n params.set('h', String(height));\n }\n\n image.search = params.toString();\n return image.toString();\n};\n"],"names":["resizeImage","image","_ref","width","height","_ref$dpr","dpr","URL","params","URLSearchParams","auto","String","undefined","set","search","toString"],"mappings":"AAMa,IAAAA,EAAc,SACzBC,EAAmBC,GACjB,IAAAC,EAAKD,EAALC,MAAOC,EAAMF,EAANE,OAAMC,EAAAH,EAAEI,IAAAA,OAAM,IAAHD,EAAG,EAACA,EAEH,iBAAVJ,IACTA,EAAQ,IAAIM,IAAIN,IAGlB,IAAMO,EAAS,IAAIC,gBAAgB,CACjCC,KAAM,SACNJ,IAAKK,OAAOL,KAWd,YARcM,IAAVT,GACFK,EAAOK,IAAI,IAAKF,OAAOR,SAEVS,IAAXR,GACFI,EAAOK,IAAI,IAAKF,OAAOP,IAGzBH,EAAMa,OAASN,EAAOO,WACfd,EAAMc,UACf"}
1
+ {"version":3,"file":"index.module.js","sources":["../src/index.ts"],"sourcesContent":["export type ResizeParams = {\n dpr?: number;\n width?: number;\n height?: number;\n};\n\nexport const resizeImage = (\n image: string | URL,\n { width, height, dpr = 1 }: ResizeParams\n): string => {\n if (typeof image === 'string') {\n image = new URL(image);\n }\n\n const params = new URLSearchParams({\n auto: 'format',\n dpr: String(dpr)\n });\n\n if (width !== undefined) {\n params.set('w', String(width));\n }\n if (height !== undefined) {\n params.set('h', String(height));\n }\n\n image.search = params.toString();\n return image.toString();\n};\n\nexport const isSupportedFormat = (image: string | URL) => {\n if (typeof image === 'string') {\n image = new URL(image);\n }\n\n const { pathname } = image;\n return (\n pathname.endsWith('.jpg') ||\n pathname.endsWith('.jpeg') ||\n pathname.endsWith('.png') ||\n pathname.endsWith('.webp') ||\n pathname.endsWith('.gif') ||\n pathname.startsWith('/gae/') // GoogleAppEngine URLs do not contain extensions\n );\n};\n"],"names":["resizeImage","image","_ref","width","height","_ref$dpr","dpr","URL","params","URLSearchParams","auto","String","undefined","set","search","toString","isSupportedFormat","pathname","endsWith","startsWith"],"mappings":"AAMa,IAAAA,EAAc,SACzBC,EAAmBC,GACjB,IAAAC,EAAKD,EAALC,MAAOC,EAAMF,EAANE,OAAMC,EAAAH,EAAEI,IAAAA,OAAG,IAAAD,EAAG,EAACA,EAEH,iBAAVJ,IACTA,EAAQ,IAAIM,IAAIN,IAGlB,IAAMO,EAAS,IAAIC,gBAAgB,CACjCC,KAAM,SACNJ,IAAKK,OAAOL,KAWd,YARcM,IAAVT,GACFK,EAAOK,IAAI,IAAKF,OAAOR,SAEVS,IAAXR,GACFI,EAAOK,IAAI,IAAKF,OAAOP,IAGzBH,EAAMa,OAASN,EAAOO,WACfd,EAAMc,UACf,EAEaC,EAAoB,SAACf,GACX,iBAAVA,IACTA,EAAQ,IAAIM,IAAIN,IAGlB,IAAQgB,EAAahB,EAAbgB,SACR,OACEA,EAASC,SAAS,SAClBD,EAASC,SAAS,UAClBD,EAASC,SAAS,SAClBD,EAASC,SAAS,UAClBD,EAASC,SAAS,SAClBD,EAASE,WAAW,QAExB"}
package/dist/index.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).seadn={})}(this,function(e){e.resizeImage=function(e,t){var n=t.width,i=t.height,o=t.dpr,r=void 0===o?1:o;"string"==typeof e&&(e=new URL(e));var d=new URLSearchParams({auto:"format",dpr:String(r)});return void 0!==n&&d.set("w",String(n)),void 0!==i&&d.set("h",String(i)),e.search=d.toString(),e.toString()}});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).seadn={})}(this,function(e){e.isSupportedFormat=function(e){"string"==typeof e&&(e=new URL(e));var t=e.pathname;return t.endsWith(".jpg")||t.endsWith(".jpeg")||t.endsWith(".png")||t.endsWith(".webp")||t.endsWith(".gif")||t.startsWith("/gae/")},e.resizeImage=function(e,t){var n=t.width,i=t.height,o=t.dpr,r=void 0===o?1:o;"string"==typeof e&&(e=new URL(e));var s=new URLSearchParams({auto:"format",dpr:String(r)});return void 0!==n&&s.set("w",String(n)),void 0!==i&&s.set("h",String(i)),e.search=s.toString(),e.toString()}});
2
2
  //# sourceMappingURL=index.umd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../src/index.ts"],"sourcesContent":["export type ResizeParams = {\n dpr?: number;\n width?: number;\n height?: number;\n};\n\nexport const resizeImage = (\n image: string | URL,\n { width, height, dpr = 1 }: ResizeParams\n): string => {\n if (typeof image === 'string') {\n image = new URL(image);\n }\n\n const params = new URLSearchParams({\n auto: 'format',\n dpr: String(dpr)\n });\n\n if (width !== undefined) {\n params.set('w', String(width));\n }\n if (height !== undefined) {\n params.set('h', String(height));\n }\n\n image.search = params.toString();\n return image.toString();\n};\n"],"names":["image","_ref","width","height","_ref$dpr","dpr","URL","params","URLSearchParams","auto","String","undefined","set","search","toString"],"mappings":"6OAM2B,SACzBA,EAAmBC,GACjB,IAAAC,EAAKD,EAALC,MAAOC,EAAMF,EAANE,OAAMC,EAAAH,EAAEI,IAAAA,OAAM,IAAHD,EAAG,EAACA,EAEH,iBAAVJ,IACTA,EAAQ,IAAIM,IAAIN,IAGlB,IAAMO,EAAS,IAAIC,gBAAgB,CACjCC,KAAM,SACNJ,IAAKK,OAAOL,KAWd,YARcM,IAAVT,GACFK,EAAOK,IAAI,IAAKF,OAAOR,SAEVS,IAAXR,GACFI,EAAOK,IAAI,IAAKF,OAAOP,IAGzBH,EAAMa,OAASN,EAAOO,WACfd,EAAMc,UACf"}
1
+ {"version":3,"file":"index.umd.js","sources":["../src/index.ts"],"sourcesContent":["export type ResizeParams = {\n dpr?: number;\n width?: number;\n height?: number;\n};\n\nexport const resizeImage = (\n image: string | URL,\n { width, height, dpr = 1 }: ResizeParams\n): string => {\n if (typeof image === 'string') {\n image = new URL(image);\n }\n\n const params = new URLSearchParams({\n auto: 'format',\n dpr: String(dpr)\n });\n\n if (width !== undefined) {\n params.set('w', String(width));\n }\n if (height !== undefined) {\n params.set('h', String(height));\n }\n\n image.search = params.toString();\n return image.toString();\n};\n\nexport const isSupportedFormat = (image: string | URL) => {\n if (typeof image === 'string') {\n image = new URL(image);\n }\n\n const { pathname } = image;\n return (\n pathname.endsWith('.jpg') ||\n pathname.endsWith('.jpeg') ||\n pathname.endsWith('.png') ||\n pathname.endsWith('.webp') ||\n pathname.endsWith('.gif') ||\n pathname.startsWith('/gae/') // GoogleAppEngine URLs do not contain extensions\n );\n};\n"],"names":["image","URL","pathname","endsWith","startsWith","_ref","width","height","_ref$dpr","dpr","params","URLSearchParams","auto","String","undefined","set","search","toString"],"mappings":"mPA8BiC,SAACA,GACX,iBAAVA,IACTA,EAAQ,IAAIC,IAAID,IAGlB,IAAQE,EAAaF,EAAbE,SACR,OACEA,EAASC,SAAS,SAClBD,EAASC,SAAS,UAClBD,EAASC,SAAS,SAClBD,EAASC,SAAS,UAClBD,EAASC,SAAS,SAClBD,EAASE,WAAW,QAExB,gBAtC2B,SACzBJ,EAAmBK,GACjB,IAAAC,EAAKD,EAALC,MAAOC,EAAMF,EAANE,OAAMC,EAAAH,EAAEI,IAAAA,OAAG,IAAAD,EAAG,EAACA,EAEH,iBAAVR,IACTA,EAAQ,IAAIC,IAAID,IAGlB,IAAMU,EAAS,IAAIC,gBAAgB,CACjCC,KAAM,SACNH,IAAKI,OAAOJ,KAWd,YARcK,IAAVR,GACFI,EAAOK,IAAI,IAAKF,OAAOP,SAEVQ,IAAXP,GACFG,EAAOK,IAAI,IAAKF,OAAON,IAGzBP,EAAMgB,OAASN,EAAOO,WACfjB,EAAMiB,UACf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensea/seadn",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Javascript SDK to work with SeaDN",
5
5
  "license": "MIT",
6
6
  "author": "OpenSea Developers",