Skip to content

Commit

Permalink
refactor: improve
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Sep 29, 2022
1 parent bbd5e8f commit a1335a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/** @typedef {import("./index.js").MinimizedResult} MinimizedResult */
/** @typedef {import("./index.js").CustomOptions} CustomOptions */
/** @typedef {import("./index.js").Input} Input */
/** @typedef {import("html-minifier-terser").Options} HtmlMinifierTerserOptions */

Expand Down Expand Up @@ -67,7 +68,7 @@ function throttleAll(limit, tasks) {

/**
* @param {Input} input
* @param {HtmlMinifierTerserOptions | undefined} [minimizerOptions]
* @param {CustomOptions | undefined} [minimizerOptions]
* @returns {Promise<MinimizedResult>}
*/
/* istanbul ignore next */
Expand Down Expand Up @@ -104,7 +105,7 @@ async function htmlMinifierTerser(input, minimizerOptions = {}) {

/**
* @param {Input} input
* @param {* | undefined} [minimizerOptions]
* @param {CustomOptions | undefined} [minimizerOptions]
* @returns {Promise<MinimizedResult>}
*/
/* istanbul ignore next */
Expand Down
9 changes: 5 additions & 4 deletions types/utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export type Task<T> = () => Promise<T>;
export type MinimizedResult = import("./index.js").MinimizedResult;
export type CustomOptions = import("./index.js").CustomOptions;
export type Input = import("./index.js").Input;
export type HtmlMinifierTerserOptions = import("html-minifier-terser").Options;
/**
Expand All @@ -16,19 +17,19 @@ export type HtmlMinifierTerserOptions = import("html-minifier-terser").Options;
export function throttleAll<T>(limit: number, tasks: Task<T>[]): Promise<T[]>;
/**
* @param {Input} input
* @param {HtmlMinifierTerserOptions | undefined} [minimizerOptions]
* @param {CustomOptions | undefined} [minimizerOptions]
* @returns {Promise<MinimizedResult>}
*/
export function htmlMinifierTerser(
input: Input,
minimizerOptions?: HtmlMinifierTerserOptions | undefined
minimizerOptions?: CustomOptions | undefined
): Promise<MinimizedResult>;
/**
* @param {Input} input
* @param {* | undefined} [minimizerOptions]
* @param {CustomOptions | undefined} [minimizerOptions]
* @returns {Promise<MinimizedResult>}
*/
export function swcMinify(
input: Input,
minimizerOptions?: any | undefined
minimizerOptions?: CustomOptions | undefined
): Promise<MinimizedResult>;

0 comments on commit a1335a3

Please sign in to comment.