Skip to content

Commit

Permalink
1.1.34
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Feb 25, 2023
1 parent 342580a commit f17ebd9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.1.34

- Updates files-pipeline component

## 1.1.33

- Process scripts enhancement
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/lib/sharp-read.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type { Sharp } from "sharp";
export interface sharpBuffer extends Sharp {
[key: string]: any;
}
export interface currentSharp extends Omit<optionExecutionsFile, "buffer"> {
export interface ongoingSharp extends Omit<optionExecutionsFile, "buffer"> {
buffer: sharpBuffer;
}
declare const _default: (options: IMG, current: currentSharp) => Promise<any>;
declare const _default: (options: IMG, ongoing: ongoingSharp) => Promise<any>;
export default _default;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro-compress",
"version": "1.1.33",
"version": "1.1.34",
"type": "module",
"description": "🗜️ AstroJS compression utilities. Compress HTML, CSS, JavaScript and more.",
"repository": {
Expand Down Expand Up @@ -35,7 +35,7 @@
"@types/html-minifier-terser": "7.0.0",
"@types/sharp": "0.31.1",
"csso": "5.0.5",
"files-pipeline": "0.0.3",
"files-pipeline": "0.0.4",
"html-minifier-terser": "7.1.0",
"sharp": "0.31.3",
"svgo": "3.0.2",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { optimize as svgo } from "svgo";
import { minify as terser } from "terser";

import type { Output } from "svgo";
import type { currentSharp } from "./lib/sharp-read.js";
import type { ongoingSharp } from "./lib/sharp-read.js";
import sharpRead from "./lib/sharp-read.js";

export default (options: Options = {}): AstroIntegration => {
Expand Down Expand Up @@ -105,7 +105,7 @@ export default (options: Options = {}): AstroIntegration => {
case "img": {
return sharpRead(
setting,
ongoing as currentSharp
ongoing as ongoingSharp
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/lib/sharp-read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export interface sharpBuffer extends Sharp {
[key: string]: any;
}

export interface currentSharp extends Omit<optionExecutionsFile, "buffer"> {
export interface ongoingSharp extends Omit<optionExecutionsFile, "buffer"> {
buffer: sharpBuffer;
}

export default async (options: IMG, current: currentSharp) => {
const fileType = current.inputPath.split(".").pop();
export default async (options: IMG, ongoing: ongoingSharp) => {
const fileType = ongoing["inputPath"].split(".").pop();

if (!fileType) {
return;
Expand Down Expand Up @@ -61,8 +61,8 @@ export default async (options: IMG, current: currentSharp) => {
typeof options[optionType] !== "undefined" &&
options[optionType] !== false
) {
if (optionType in current.buffer) {
return await current.buffer[optionType](
if (optionType in ongoing.buffer) {
return await ongoing.buffer[optionType](
options[optionType] !== true
? options[optionType]
: defaults["img"]
Expand Down

0 comments on commit f17ebd9

Please sign in to comment.