Comparing version 3.18.0 to 3.18.1
@@ -16,1 +16,2 @@ declare const _default: { | ||
export default _default; | ||
//# sourceMappingURL=domains.d.ts.map |
@@ -15,1 +15,2 @@ declare const _default: { | ||
export default _default; | ||
//# sourceMappingURL=paths.d.ts.map |
@@ -16,1 +16,2 @@ declare const _default: { | ||
export default _default; | ||
//# sourceMappingURL=subdomains.d.ts.map |
@@ -6,1 +6,2 @@ export * from "./src/types.js"; | ||
export * from "./src/canonical.js"; | ||
//# sourceMappingURL=mod.d.ts.map |
@@ -8,1 +8,2 @@ import { CanonicalCdnUrl, ImageCdn } from "./types.js"; | ||
export declare function getCanonicalCdnForUrl(url: string | URL, defaultCdn?: ImageCdn | false): CanonicalCdnUrl | false; | ||
//# sourceMappingURL=canonical.d.ts.map |
@@ -5,1 +5,2 @@ import { ImageCdn } from "./types.js"; | ||
export declare function getImageCdnForUrlByPath(url: string | URL): ImageCdn | false; | ||
//# sourceMappingURL=detect.d.ts.map |
@@ -1,17 +0,17 @@ | ||
import { ImageCdn, ParsedUrl, UrlParser } from "./types.js"; | ||
import { ImageCdn, ParsedUrl, SupportedImageCdn, UrlParser } from "./types.js"; | ||
export declare const parsers: { | ||
imgix: UrlParser<Record<string, unknown>>; | ||
contentful: UrlParser<{ | ||
fit?: string | undefined; | ||
fit?: string; | ||
}>; | ||
"builder.io": UrlParser<{ | ||
fit?: string | undefined; | ||
quality?: number | undefined; | ||
fit?: string; | ||
quality?: number; | ||
}>; | ||
shopify: UrlParser<{ | ||
crop?: string | undefined; | ||
size?: string | undefined; | ||
crop?: string; | ||
size?: string; | ||
}>; | ||
wordpress: UrlParser<{ | ||
crop?: boolean | undefined; | ||
crop?: boolean; | ||
}>; | ||
@@ -22,7 +22,7 @@ cloudimage: UrlParser<import("./transformers/cloudimage.js").CloudimageParams>; | ||
bunny: UrlParser<{ | ||
fit?: string | undefined; | ||
fit?: string; | ||
}>; | ||
storyblok: UrlParser<import("./transformers/storyblok.js").StoryblokParams>; | ||
"kontent.ai": UrlParser<{ | ||
fit?: string | undefined; | ||
fit?: string; | ||
}>; | ||
@@ -40,3 +40,3 @@ vercel: UrlParser<Record<string, unknown>>; | ||
contentstack: UrlParser<{ | ||
fit?: string | undefined; | ||
fit?: string; | ||
}>; | ||
@@ -51,3 +51,3 @@ cloudflare_images: UrlParser<import("./transformers/cloudflare_images.js").CloudflareImagesParams>; | ||
}; | ||
export declare const cdnIsSupportedForParse: (cdn: ImageCdn | false) => cdn is ImageCdn; | ||
export declare const cdnIsSupportedForParse: (cdn: ImageCdn | false) => cdn is SupportedImageCdn; | ||
/** | ||
@@ -65,1 +65,2 @@ * Returns a parser function if the given URL is from a known image CDN | ||
export declare const parseUrl: <TParams = Record<string, unknown>>(url: string | URL, cdn?: ImageCdn) => ParsedUrl<TParams> | undefined; | ||
//# sourceMappingURL=parse.d.ts.map |
@@ -18,1 +18,2 @@ import { ImageCdn, UrlTransformer } from "./types.js"; | ||
export declare const getTransformerForUrl: (url: string | URL) => UrlTransformer | undefined; | ||
//# sourceMappingURL=transform.d.ts.map |
@@ -9,1 +9,2 @@ import { ShouldDelegateUrl, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=astro.d.ts.map |
@@ -7,1 +7,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=builder.io.d.ts.map |
@@ -6,1 +6,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=bunny.d.ts.map |
@@ -11,1 +11,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=cloudflare_images.d.ts.map |
@@ -10,1 +10,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=cloudflare.d.ts.map |
@@ -7,1 +7,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=cloudimage.d.ts.map |
@@ -16,1 +16,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=cloudinary.d.ts.map |
@@ -6,1 +6,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=contentful.d.ts.map |
@@ -6,1 +6,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=contentstack.d.ts.map |
@@ -17,1 +17,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=directus.d.ts.map |
@@ -38,1 +38,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare function getDirectives(paramArray: []): {}; | ||
//# sourceMappingURL=imageengine.d.ts.map |
import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
export declare const parse: UrlParser; | ||
//# sourceMappingURL=imagekit.d.ts.map |
import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const parse: UrlParser; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=imgix.d.ts.map |
@@ -12,1 +12,2 @@ import type { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=ipx.d.ts.map |
@@ -7,1 +7,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=keycdn.d.ts.map |
@@ -6,1 +6,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=kontent.ai.d.ts.map |
@@ -11,1 +11,2 @@ import type { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=netlify.d.ts.map |
@@ -5,1 +5,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=nextjs.d.ts.map |
@@ -13,1 +13,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=scene7.d.ts.map |
@@ -10,1 +10,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=shopify.d.ts.map |
@@ -59,1 +59,2 @@ declare const _default: ({ | ||
export default _default; | ||
//# sourceMappingURL=shopify.fixtures.d.ts.map |
@@ -13,1 +13,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=storyblok.d.ts.map |
@@ -26,1 +26,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=supabase.d.ts.map |
@@ -162,1 +162,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export {}; | ||
//# sourceMappingURL=uploadcare.d.ts.map |
@@ -11,1 +11,2 @@ import { ShouldDelegateUrl, UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=vercel.d.ts.map |
@@ -6,1 +6,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
}>; | ||
//# sourceMappingURL=wordpress.d.ts.map |
@@ -71,1 +71,2 @@ /** | ||
export type SupportedImageCdn = ImageCdn; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -17,1 +17,2 @@ export declare const roundIfNumeric: (value: string | number) => string | number; | ||
export declare const toUrl: (url: string | URL, base?: string | URL | undefined) => URL; | ||
//# sourceMappingURL=utils.d.ts.map |
137
package.json
{ | ||
"module": "./esm/mod.js", | ||
"main": "./script/mod.js", | ||
"name": "unpic", | ||
"version": "3.18.0", | ||
"version": "3.18.1", | ||
"description": "Universal image CDN translator", | ||
"license": "MIT", | ||
"homepage": "https://unpic.pics/lib", | ||
"sideEffects": false, | ||
"repository": { | ||
@@ -14,11 +10,8 @@ "type": "git", | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/ascorbic/unpic/issues" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.11.9", | ||
"picocolors": "^1.0.0", | ||
"@deno/shim-deno-test": "~0.4.0", | ||
"@unpic/pixels": "latest" | ||
}, | ||
"main": "./script/mod.js", | ||
"module": "./esm/mod.js", | ||
"exports": { | ||
@@ -33,10 +26,2 @@ ".": { | ||
}, | ||
"./transformers/nextjs": { | ||
"import": "./esm/src/transformers/nextjs.js", | ||
"require": "./script/src/transformers/nextjs.js" | ||
}, | ||
"./transformers/kontent.ai": { | ||
"import": "./esm/src/transformers/kontent.ai.js", | ||
"require": "./script/src/transformers/kontent.ai.js" | ||
}, | ||
"./transformers/scene7": { | ||
@@ -46,26 +31,6 @@ "import": "./esm/src/transformers/scene7.js", | ||
}, | ||
"./transformers/cloudflare_images": { | ||
"import": "./esm/src/transformers/cloudflare_images.js", | ||
"require": "./script/src/transformers/cloudflare_images.js" | ||
"./transformers/nextjs": { | ||
"import": "./esm/src/transformers/nextjs.js", | ||
"require": "./script/src/transformers/nextjs.js" | ||
}, | ||
"./transformers/cloudinary": { | ||
"import": "./esm/src/transformers/cloudinary.js", | ||
"require": "./script/src/transformers/cloudinary.js" | ||
}, | ||
"./transformers/netlify": { | ||
"import": "./esm/src/transformers/netlify.js", | ||
"require": "./script/src/transformers/netlify.js" | ||
}, | ||
"./transformers/astro": { | ||
"import": "./esm/src/transformers/astro.js", | ||
"require": "./script/src/transformers/astro.js" | ||
}, | ||
"./transformers/ipx": { | ||
"import": "./esm/src/transformers/ipx.js", | ||
"require": "./script/src/transformers/ipx.js" | ||
}, | ||
"./transformers/storyblok": { | ||
"import": "./esm/src/transformers/storyblok.js", | ||
"require": "./script/src/transformers/storyblok.js" | ||
}, | ||
"./transformers/builder.io": { | ||
@@ -75,10 +40,2 @@ "import": "./esm/src/transformers/builder.io.js", | ||
}, | ||
"./transformers/cloudimage": { | ||
"import": "./esm/src/transformers/cloudimage.js", | ||
"require": "./script/src/transformers/cloudimage.js" | ||
}, | ||
"./transformers/imgix": { | ||
"import": "./esm/src/transformers/imgix.js", | ||
"require": "./script/src/transformers/imgix.js" | ||
}, | ||
"./transformers/imageengine": { | ||
@@ -88,18 +45,14 @@ "import": "./esm/src/transformers/imageengine.js", | ||
}, | ||
"./transformers/cloudflare": { | ||
"import": "./esm/src/transformers/cloudflare.js", | ||
"require": "./script/src/transformers/cloudflare.js" | ||
"./transformers/netlify": { | ||
"import": "./esm/src/transformers/netlify.js", | ||
"require": "./script/src/transformers/netlify.js" | ||
}, | ||
"./transformers/uploadcare": { | ||
"import": "./esm/src/transformers/uploadcare.js", | ||
"require": "./script/src/transformers/uploadcare.js" | ||
"./transformers/cloudinary": { | ||
"import": "./esm/src/transformers/cloudinary.js", | ||
"require": "./script/src/transformers/cloudinary.js" | ||
}, | ||
"./transformers/bunny": { | ||
"import": "./esm/src/transformers/bunny.js", | ||
"require": "./script/src/transformers/bunny.js" | ||
"./transformers/imgix": { | ||
"import": "./esm/src/transformers/imgix.js", | ||
"require": "./script/src/transformers/imgix.js" | ||
}, | ||
"./transformers/keycdn": { | ||
"import": "./esm/src/transformers/keycdn.js", | ||
"require": "./script/src/transformers/keycdn.js" | ||
}, | ||
"./transformers/shopify": { | ||
@@ -109,2 +62,6 @@ "import": "./esm/src/transformers/shopify.js", | ||
}, | ||
"./transformers/cloudflare_images": { | ||
"import": "./esm/src/transformers/cloudflare_images.js", | ||
"require": "./script/src/transformers/cloudflare_images.js" | ||
}, | ||
"./transformers/supabase": { | ||
@@ -118,2 +75,6 @@ "import": "./esm/src/transformers/supabase.js", | ||
}, | ||
"./transformers/cloudflare": { | ||
"import": "./esm/src/transformers/cloudflare.js", | ||
"require": "./script/src/transformers/cloudflare.js" | ||
}, | ||
"./transformers/wordpress": { | ||
@@ -123,2 +84,30 @@ "import": "./esm/src/transformers/wordpress.js", | ||
}, | ||
"./transformers/bunny": { | ||
"import": "./esm/src/transformers/bunny.js", | ||
"require": "./script/src/transformers/bunny.js" | ||
}, | ||
"./transformers/contentstack": { | ||
"import": "./esm/src/transformers/contentstack.js", | ||
"require": "./script/src/transformers/contentstack.js" | ||
}, | ||
"./transformers/astro": { | ||
"import": "./esm/src/transformers/astro.js", | ||
"require": "./script/src/transformers/astro.js" | ||
}, | ||
"./transformers/kontent.ai": { | ||
"import": "./esm/src/transformers/kontent.ai.js", | ||
"require": "./script/src/transformers/kontent.ai.js" | ||
}, | ||
"./transformers/keycdn": { | ||
"import": "./esm/src/transformers/keycdn.js", | ||
"require": "./script/src/transformers/keycdn.js" | ||
}, | ||
"./transformers/cloudimage": { | ||
"import": "./esm/src/transformers/cloudimage.js", | ||
"require": "./script/src/transformers/cloudimage.js" | ||
}, | ||
"./transformers/storyblok": { | ||
"import": "./esm/src/transformers/storyblok.js", | ||
"require": "./script/src/transformers/storyblok.js" | ||
}, | ||
"./transformers/vercel": { | ||
@@ -132,9 +121,13 @@ "import": "./esm/src/transformers/vercel.js", | ||
}, | ||
"./transformers/contentstack": { | ||
"import": "./esm/src/transformers/contentstack.js", | ||
"require": "./script/src/transformers/contentstack.js" | ||
}, | ||
"./transformers/imagekit": { | ||
"import": "./esm/src/transformers/imagekit.js", | ||
"require": "./script/src/transformers/imagekit.js" | ||
}, | ||
"./transformers/ipx": { | ||
"import": "./esm/src/transformers/ipx.js", | ||
"require": "./script/src/transformers/ipx.js" | ||
}, | ||
"./transformers/uploadcare": { | ||
"import": "./esm/src/transformers/uploadcare.js", | ||
"require": "./script/src/transformers/uploadcare.js" | ||
} | ||
@@ -144,3 +137,11 @@ }, | ||
"test": "node test_runner.js" | ||
} | ||
}, | ||
"sideEffects": false, | ||
"devDependencies": { | ||
"@types/node": "^20.9.0", | ||
"picocolors": "^1.0.0", | ||
"@deno/shim-deno-test": "~0.5.0", | ||
"@unpic/pixels": "latest" | ||
}, | ||
"_generatedBy": "dnt@dev" | ||
} |
@@ -25,9 +25,5 @@ # 🖼 Unpic | ||
This library is available via URL imports for Deno and via npm for Node. To use | ||
it in Deno, import the module from deno.land: | ||
This library is available via NPM as `unpic` and JSR as | ||
[`@unpic/lib`](https://jsr.io/@unpic/lib). | ||
```ts | ||
import { transformUrl } from "https://deno.land/x/unpic/mod.ts"; | ||
``` | ||
To use it in Node, install it from npm: | ||
@@ -45,2 +41,11 @@ | ||
To use it in Deno, import [the module from JSR](https://jsr.io/@unpic/lib): | ||
```ts | ||
import { transformUrl } from "jsr:@unpic/lib"; | ||
``` | ||
If you previously installed the library from deno.land/x, you should update to | ||
use JSR instead as the deno.land/x version is no longer updated. | ||
You can then use the `transformUrl` function to transform a URL: | ||
@@ -50,8 +55,8 @@ | ||
const url = transformUrl( | ||
{ | ||
url: | ||
"https://cdn.shopify.com/static/sample-images/bath_grande_crop_center.jpeg", | ||
width: 800, | ||
height: 600, | ||
}, | ||
{ | ||
url: | ||
"https://cdn.shopify.com/static/sample-images/bath_grande_crop_center.jpeg", | ||
width: 800, | ||
height: 600, | ||
}, | ||
); | ||
@@ -69,3 +74,3 @@ | ||
const parsedUrl = parseUrl( | ||
"https://cdn.shopify.com/static/sample-images/bath_800x600_crop_center.jpeg", | ||
"https://cdn.shopify.com/static/sample-images/bath_800x600_crop_center.jpeg", | ||
); | ||
@@ -89,9 +94,9 @@ | ||
const url = transformUrl( | ||
{ | ||
url: | ||
"https://cdn.shopify.com/static/sample-images/bath_grande_crop_center.jpeg", | ||
width: 800, | ||
height: 600, | ||
cdn: "shopify", | ||
}, | ||
{ | ||
url: | ||
"https://cdn.shopify.com/static/sample-images/bath_grande_crop_center.jpeg", | ||
width: 800, | ||
height: 600, | ||
cdn: "shopify", | ||
}, | ||
); | ||
@@ -98,0 +103,0 @@ ``` |
@@ -16,1 +16,2 @@ declare const _default: { | ||
export default _default; | ||
//# sourceMappingURL=domains.d.ts.map |
@@ -15,1 +15,2 @@ declare const _default: { | ||
export default _default; | ||
//# sourceMappingURL=paths.d.ts.map |
@@ -16,1 +16,2 @@ declare const _default: { | ||
export default _default; | ||
//# sourceMappingURL=subdomains.d.ts.map |
@@ -6,1 +6,2 @@ export * from "./src/types.js"; | ||
export * from "./src/canonical.js"; | ||
//# sourceMappingURL=mod.d.ts.map |
@@ -8,1 +8,2 @@ import { CanonicalCdnUrl, ImageCdn } from "./types.js"; | ||
export declare function getCanonicalCdnForUrl(url: string | URL, defaultCdn?: ImageCdn | false): CanonicalCdnUrl | false; | ||
//# sourceMappingURL=canonical.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getCanonicalCdnForUrl = exports.getDelegatedCdn = void 0; | ||
exports.getDelegatedCdn = getDelegatedCdn; | ||
exports.getCanonicalCdnForUrl = getCanonicalCdnForUrl; | ||
const detect_js_1 = require("./detect.js"); | ||
@@ -23,3 +24,2 @@ const vercel_js_1 = require("./transformers/vercel.js"); | ||
} | ||
exports.getDelegatedCdn = getDelegatedCdn; | ||
/** | ||
@@ -40,2 +40,1 @@ * Gets the canonical URL and CDN for a given image URL, recursing into | ||
} | ||
exports.getCanonicalCdnForUrl = getCanonicalCdnForUrl; |
@@ -5,1 +5,2 @@ import { ImageCdn } from "./types.js"; | ||
export declare function getImageCdnForUrlByPath(url: string | URL): ImageCdn | false; | ||
//# sourceMappingURL=detect.d.ts.map |
@@ -6,3 +6,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getImageCdnForUrlByPath = exports.getImageCdnForUrlByDomain = exports.getImageCdnForUrl = void 0; | ||
exports.getImageCdnForUrl = getImageCdnForUrl; | ||
exports.getImageCdnForUrlByDomain = getImageCdnForUrlByDomain; | ||
exports.getImageCdnForUrlByPath = getImageCdnForUrlByPath; | ||
const domains_js_1 = __importDefault(require("../data/domains.js")); | ||
@@ -17,3 +19,2 @@ const subdomains_js_1 = __importDefault(require("../data/subdomains.js")); | ||
} | ||
exports.getImageCdnForUrl = getImageCdnForUrl; | ||
function getImageCdnForUrlByDomain(url) { | ||
@@ -34,3 +35,2 @@ if (typeof url === "string" && !url.startsWith("https://")) { | ||
} | ||
exports.getImageCdnForUrlByDomain = getImageCdnForUrlByDomain; | ||
function getImageCdnForUrlByPath(url) { | ||
@@ -46,2 +46,1 @@ // Allow relative URLs | ||
} | ||
exports.getImageCdnForUrlByPath = getImageCdnForUrlByPath; |
@@ -1,17 +0,17 @@ | ||
import { ImageCdn, ParsedUrl, UrlParser } from "./types.js"; | ||
import { ImageCdn, ParsedUrl, SupportedImageCdn, UrlParser } from "./types.js"; | ||
export declare const parsers: { | ||
imgix: UrlParser<Record<string, unknown>>; | ||
contentful: UrlParser<{ | ||
fit?: string | undefined; | ||
fit?: string; | ||
}>; | ||
"builder.io": UrlParser<{ | ||
fit?: string | undefined; | ||
quality?: number | undefined; | ||
fit?: string; | ||
quality?: number; | ||
}>; | ||
shopify: UrlParser<{ | ||
crop?: string | undefined; | ||
size?: string | undefined; | ||
crop?: string; | ||
size?: string; | ||
}>; | ||
wordpress: UrlParser<{ | ||
crop?: boolean | undefined; | ||
crop?: boolean; | ||
}>; | ||
@@ -22,7 +22,7 @@ cloudimage: UrlParser<import("./transformers/cloudimage.js").CloudimageParams>; | ||
bunny: UrlParser<{ | ||
fit?: string | undefined; | ||
fit?: string; | ||
}>; | ||
storyblok: UrlParser<import("./transformers/storyblok.js").StoryblokParams>; | ||
"kontent.ai": UrlParser<{ | ||
fit?: string | undefined; | ||
fit?: string; | ||
}>; | ||
@@ -40,3 +40,3 @@ vercel: UrlParser<Record<string, unknown>>; | ||
contentstack: UrlParser<{ | ||
fit?: string | undefined; | ||
fit?: string; | ||
}>; | ||
@@ -51,3 +51,3 @@ cloudflare_images: UrlParser<import("./transformers/cloudflare_images.js").CloudflareImagesParams>; | ||
}; | ||
export declare const cdnIsSupportedForParse: (cdn: ImageCdn | false) => cdn is ImageCdn; | ||
export declare const cdnIsSupportedForParse: (cdn: ImageCdn | false) => cdn is SupportedImageCdn; | ||
/** | ||
@@ -65,1 +65,2 @@ * Returns a parser function if the given URL is from a known image CDN | ||
export declare const parseUrl: <TParams = Record<string, unknown>>(url: string | URL, cdn?: ImageCdn) => ParsedUrl<TParams> | undefined; | ||
//# sourceMappingURL=parse.d.ts.map |
@@ -18,1 +18,2 @@ import { ImageCdn, UrlTransformer } from "./types.js"; | ||
export declare const getTransformerForUrl: (url: string | URL) => UrlTransformer | undefined; | ||
//# sourceMappingURL=transform.d.ts.map |
@@ -9,1 +9,2 @@ import { ShouldDelegateUrl, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=astro.d.ts.map |
@@ -7,1 +7,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=builder.io.d.ts.map |
@@ -6,1 +6,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=bunny.d.ts.map |
@@ -11,1 +11,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=cloudflare_images.d.ts.map |
@@ -10,1 +10,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=cloudflare.d.ts.map |
@@ -7,1 +7,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=cloudimage.d.ts.map |
@@ -16,1 +16,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=cloudinary.d.ts.map |
@@ -6,1 +6,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=contentful.d.ts.map |
@@ -6,1 +6,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=contentstack.d.ts.map |
@@ -17,1 +17,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=directus.d.ts.map |
@@ -38,1 +38,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare function getDirectives(paramArray: []): {}; | ||
//# sourceMappingURL=imageengine.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getDirectives = exports.maybe_create_directive = exports.build_IE_query_string = exports.build_IE_directives = exports.transform = exports.getBaseUrl = exports.getParameterArray = exports.getDirective = exports.parse = exports.OBJECT_TO_DIRECTIVES_MAP = void 0; | ||
exports.transform = exports.parse = exports.OBJECT_TO_DIRECTIVES_MAP = void 0; | ||
exports.getDirective = getDirective; | ||
exports.getParameterArray = getParameterArray; | ||
exports.getBaseUrl = getBaseUrl; | ||
exports.build_IE_directives = build_IE_directives; | ||
exports.build_IE_query_string = build_IE_query_string; | ||
exports.maybe_create_directive = maybe_create_directive; | ||
exports.getDirectives = getDirectives; | ||
const utils_js_1 = require("../utils.js"); | ||
@@ -74,3 +81,2 @@ exports.OBJECT_TO_DIRECTIVES_MAP = { | ||
} | ||
exports.getDirective = getDirective; | ||
function getParameterArray(url) { | ||
@@ -87,3 +93,2 @@ let url_string = url.toString(); | ||
} | ||
exports.getParameterArray = getParameterArray; | ||
function getBaseUrl(url) { | ||
@@ -103,3 +108,2 @@ let url_string = url.toString(); | ||
} | ||
exports.getBaseUrl = getBaseUrl; | ||
const transform = ({ url: originalUrl, width, height, format }) => { | ||
@@ -136,3 +140,2 @@ const url = (0, utils_js_1.toUrl)(originalUrl); | ||
} | ||
exports.build_IE_directives = build_IE_directives; | ||
function build_IE_query_string(directives_string) { | ||
@@ -144,3 +147,2 @@ if (directives_string && directives_string !== "") { | ||
} | ||
exports.build_IE_query_string = build_IE_query_string; | ||
function maybe_create_directive(directive, value) { | ||
@@ -153,3 +155,2 @@ let translated_directive = exports.OBJECT_TO_DIRECTIVES_MAP[directive]; | ||
} | ||
exports.maybe_create_directive = maybe_create_directive; | ||
function getDirectives(paramArray) { | ||
@@ -170,2 +171,1 @@ let directives = {}; | ||
} | ||
exports.getDirectives = getDirectives; |
import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
export declare const parse: UrlParser; | ||
//# sourceMappingURL=imagekit.d.ts.map |
import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const parse: UrlParser; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=imgix.d.ts.map |
@@ -12,1 +12,2 @@ import type { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=ipx.d.ts.map |
@@ -7,1 +7,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=keycdn.d.ts.map |
@@ -6,1 +6,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=kontent.ai.d.ts.map |
@@ -11,1 +11,2 @@ import type { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=netlify.d.ts.map |
@@ -5,1 +5,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=nextjs.d.ts.map |
@@ -13,1 +13,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=scene7.d.ts.map |
@@ -10,1 +10,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=shopify.d.ts.map |
@@ -59,1 +59,2 @@ declare const _default: ({ | ||
export default _default; | ||
//# sourceMappingURL=shopify.fixtures.d.ts.map |
@@ -13,1 +13,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=storyblok.d.ts.map |
@@ -26,1 +26,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=supabase.d.ts.map |
@@ -162,1 +162,2 @@ import { UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export {}; | ||
//# sourceMappingURL=uploadcare.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.transform = exports.generate = exports.parse = exports.extractOperations = exports.normalizeCdnOperation = exports.trimFilename = exports.splitFileUrl = exports.isFileUrl = exports.extractFilename = void 0; | ||
exports.transform = exports.generate = exports.parse = exports.normalizeCdnOperation = void 0; | ||
exports.extractFilename = extractFilename; | ||
exports.isFileUrl = isFileUrl; | ||
exports.splitFileUrl = splitFileUrl; | ||
exports.trimFilename = trimFilename; | ||
exports.extractOperations = extractOperations; | ||
const utils_js_1 = require("../utils.js"); | ||
@@ -25,3 +30,2 @@ const uploadcareRegex = /^https?:\/\/(?<host>[^\/]+)\/(?<uuid>[^\/]+)/g; | ||
} | ||
exports.extractFilename = extractFilename; | ||
/** | ||
@@ -35,3 +39,2 @@ * Taken from uploadcare/blocks | ||
} | ||
exports.isFileUrl = isFileUrl; | ||
/** | ||
@@ -50,3 +53,2 @@ * Taken from uploadcare/blocks | ||
} | ||
exports.splitFileUrl = splitFileUrl; | ||
/** | ||
@@ -68,3 +70,2 @@ * Taken from uploadcare/blocks | ||
} | ||
exports.trimFilename = trimFilename; | ||
/** | ||
@@ -110,3 +111,2 @@ * Taken from uploadcare/blocks | ||
} | ||
exports.extractOperations = extractOperations; | ||
const parseOperations = (operations) => { | ||
@@ -113,0 +113,0 @@ return operations.length |
@@ -11,1 +11,2 @@ import { ShouldDelegateUrl, UrlGenerator, UrlParser, UrlTransformer } from "../types.js"; | ||
export declare const transform: UrlTransformer; | ||
//# sourceMappingURL=vercel.d.ts.map |
@@ -6,1 +6,2 @@ import { UrlParser, UrlTransformer } from "../types.js"; | ||
}>; | ||
//# sourceMappingURL=wordpress.d.ts.map |
@@ -71,1 +71,2 @@ /** | ||
export type SupportedImageCdn = ImageCdn; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -17,1 +17,2 @@ export declare const roundIfNumeric: (value: string | number) => string | number; | ||
export declare const toUrl: (url: string | URL, base?: string | URL | undefined) => URL; | ||
//# sourceMappingURL=utils.d.ts.map |
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
272205
342
180
5068