Comparing version 8.0.0 to 8.0.1
19
index.js
@@ -1,10 +0,12 @@ | ||
import {promisify} from 'util'; | ||
import path from 'path'; | ||
import {Buffer} from 'node:buffer'; | ||
import {promises as fsPromises} from 'node:fs'; | ||
import {promisify} from 'node:util'; | ||
import path from 'node:path'; | ||
import fs from 'graceful-fs'; | ||
import {promises as fsPromises} from 'fs'; | ||
import FileType from 'file-type'; | ||
import globby from 'globby'; | ||
import {globby} from 'globby'; | ||
import pPipe from 'p-pipe'; | ||
import replaceExt from 'replace-ext'; | ||
import junk from 'junk'; | ||
import convertToUnixPath from 'slash'; | ||
@@ -22,3 +24,3 @@ const readFile = promisify(fs.readFile); | ||
const {ext} = await FileType.fromBuffer(data); | ||
const {ext} = await FileType.fromBuffer(data) || {ext: path.extname(sourcePath)}; | ||
let destinationPath = destination ? path.join(destination, path.basename(sourcePath)) : undefined; | ||
@@ -30,3 +32,3 @@ destinationPath = ext === 'webp' ? replaceExt(destinationPath, '.webp') : destinationPath; | ||
sourcePath, | ||
destinationPath | ||
destinationPath, | ||
}; | ||
@@ -49,3 +51,4 @@ | ||
const filePaths = glob ? await globby(input, {onlyFiles: true}) : input; | ||
const unixFilePaths = input.map(path => convertToUnixPath(path)); | ||
const filePaths = glob ? await globby(unixFilePaths, {onlyFiles: true}) : input; | ||
@@ -62,3 +65,3 @@ return Promise.all( | ||
} | ||
}) | ||
}), | ||
); | ||
@@ -65,0 +68,0 @@ } |
{ | ||
"name": "imagemin", | ||
"version": "8.0.0", | ||
"version": "8.0.1", | ||
"description": "Minify images seamlessly", | ||
@@ -30,8 +30,9 @@ "license": "MIT", | ||
"dependencies": { | ||
"file-type": "^14.6.0", | ||
"globby": "^11.0.3", | ||
"graceful-fs": "^4.2.6", | ||
"file-type": "^16.5.3", | ||
"globby": "^12.0.0", | ||
"graceful-fs": "^4.2.8", | ||
"junk": "^3.1.0", | ||
"p-pipe": "^4.0.0", | ||
"replace-ext": "^2.0.0" | ||
"replace-ext": "^2.0.0", | ||
"slash": "^3.0.0" | ||
}, | ||
@@ -46,4 +47,4 @@ "devDependencies": { | ||
"tempy": "^1.0.1", | ||
"xo": "^0.39.1" | ||
"xo": "^0.43.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# imagemin ![GitHub Actions Status](https://github.com/imagemin/imagemin/workflows/CI/badge.svg?branch=master) | ||
# imagemin | ||
@@ -24,2 +24,3 @@ > Minify images seamlessly | ||
<br> | ||
<br> | ||
<a href="https://doppler.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=imagemin&utm_source=github"> | ||
@@ -36,2 +37,12 @@ <div> | ||
</a> | ||
<br> | ||
<a href="https://strapi.io/?ref=sindresorhus"> | ||
<div> | ||
<img src="https://sindresorhus.com/assets/thanks/strapi-logo-white-bg.png" width="200" alt="Strapi"> | ||
</div> | ||
<b>Strapi is the leading open-source headless CMS.</b> | ||
<div> | ||
<sup>It’s 100% JavaScript, fully customizable, and developer-first.</sup> | ||
</div> | ||
</a> | ||
</p> | ||
@@ -126,10 +137,2 @@ </div> | ||
## Hosted API | ||
We also provide a hosted API for imagemin which may simplify your use case. | ||
<a href="https://imagemin.saasify.sh"> | ||
<img src="https://badges.saasify.sh?text=View%20Hosted%20API" height="40"/> | ||
</a> | ||
## Related | ||
@@ -136,0 +139,0 @@ |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
7177
62
141
2
7
+ Addedslash@^3.0.0
+ Addedarray-union@3.0.1(transitive)
+ Addedfile-type@16.5.4(transitive)
+ Addedglobby@12.2.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedreadable-web-to-node-stream@3.0.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedslash@4.0.0(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedtoken-types@4.2.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removed@tokenizer/token@0.1.1(transitive)
- Removedarray-union@2.1.0(transitive)
- Removedfile-type@14.7.1(transitive)
- Removedglobby@11.1.0(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedreadable-web-to-node-stream@2.0.0(transitive)
- Removedtoken-types@2.1.1(transitive)
- Removedtypedarray-to-buffer@3.1.5(transitive)
Updatedfile-type@^16.5.3
Updatedglobby@^12.0.0
Updatedgraceful-fs@^4.2.8