@opensea/seadn 1.0.0
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 +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.modern.js +2 -0
- package/dist/index.modern.js.map +1 -0
- package/dist/index.module.js +2 -0
- package/dist/index.module.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +47 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +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()};
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +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"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +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};
|
|
2
|
+
//# sourceMappingURL=index.modern.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +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};
|
|
2
|
+
//# sourceMappingURL=index.module.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +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()}});
|
|
2
|
+
//# sourceMappingURL=index.umd.js.map
|
|
@@ -0,0 +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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opensea/seadn",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Javascript SDK to work with SeaDN",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "OpenSea Developers",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
"require": "./dist/index.cjs",
|
|
10
|
+
"default": "./dist/index.modern.js"
|
|
11
|
+
},
|
|
12
|
+
"main": "./dist/index.cjs",
|
|
13
|
+
"module": "./dist/index.module.js",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "microbundle",
|
|
19
|
+
"check-types": "tsc --noEmit",
|
|
20
|
+
"prepare": "husky install",
|
|
21
|
+
"prettier:check": "prettier --check .",
|
|
22
|
+
"prettier:check:package.json": "prettier-package-json --list-different",
|
|
23
|
+
"prettier:fix": "prettier --write .",
|
|
24
|
+
"test": "vitest"
|
|
25
|
+
},
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"esbuild": "^0.17.10",
|
|
30
|
+
"husky": "^8.0.3",
|
|
31
|
+
"lint-staged": "^13.1.2",
|
|
32
|
+
"microbundle": "^0.15.1",
|
|
33
|
+
"prettier": "^2.8.4",
|
|
34
|
+
"prettier-package-json": "^2.8.0",
|
|
35
|
+
"vitest": "^0.29.1"
|
|
36
|
+
},
|
|
37
|
+
"lint-staged": {
|
|
38
|
+
"package.json": [
|
|
39
|
+
"prettier-package-json --write"
|
|
40
|
+
],
|
|
41
|
+
"**/*.{ts,tsx,js,jsx,html,md,mdx,yml,json}": [
|
|
42
|
+
"prettier --write"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"source": "src/index.ts",
|
|
46
|
+
"unpkg": "./dist/index.umd.js"
|
|
47
|
+
}
|