imagetools-core
Advanced tools
Comparing version 5.1.1 to 6.0.0
@@ -24,3 +24,2 @@ export * from './transforms/background.js'; | ||
export * from './output-formats.js'; | ||
export * from './util.js'; | ||
export { parseURL, extractEntries } from './lib/parse-url.js'; | ||
@@ -27,0 +26,0 @@ export { resolveConfigs } from './lib/resolve-configs.js'; |
@@ -1,5 +0,1 @@ | ||
import { createHash } from 'node:crypto'; | ||
import path from 'node:path'; | ||
import sharp from 'sharp'; | ||
const METADATA = Symbol('image metadata'); | ||
@@ -475,14 +471,2 @@ function setMetadata(image, key, value) { | ||
function loadImage(path) { | ||
return sharp(path); | ||
} | ||
function generateImageID(url, config) { | ||
// this isn't a valid URL, but just a string used for an identifier | ||
// use a relative path in the local case so that it's consistent across machines | ||
const baseURL = url.host | ||
? new URL(url.origin + url.pathname) | ||
: new URL(url.protocol + path.relative(process.cwd(), url.pathname)); | ||
return createHash('sha1').update(baseURL.href).update(JSON.stringify(config)).digest('hex'); | ||
} | ||
function parseURL(rawURL) { | ||
@@ -584,3 +568,3 @@ return new URL(rawURL.replace(/#/g, '%23'), 'file://'); | ||
export { applyTransforms, blur, builtinOutputFormats, builtins, extractEntries, fitValues, flatten, flip, flop, format, generateImageID, generateTransforms, getBackground, getFit, getKernel, getLossless, getMetadata, getPosition, getProgressive, getQuality, grayscale, hsb, imgFormat, invert, kernelValues, loadImage, median, metadataFormat, normalize, parseURL, pictureFormat, positionShorthands, positionValues, resize, resolveConfigs, rotate, setMetadata, srcsetFormat, tint, urlFormat }; | ||
export { applyTransforms, blur, builtinOutputFormats, builtins, extractEntries, fitValues, flatten, flip, flop, format, generateTransforms, getBackground, getFit, getKernel, getLossless, getMetadata, getPosition, getProgressive, getQuality, grayscale, hsb, imgFormat, invert, kernelValues, median, metadataFormat, normalize, parseURL, pictureFormat, positionShorthands, positionValues, resize, resolveConfigs, rotate, setMetadata, srcsetFormat, tint, urlFormat }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "imagetools-core", | ||
"version": "5.1.1", | ||
"version": "6.0.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
77459
36
828