Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use bun glob & update compressible extensions #67

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

huseeiin
Copy link

@huseeiin huseeiin commented Oct 2, 2024

this adds 2 changes:

  1. use native Bun.Glob instead of tiny-glob
  2. update the default compressible types to a wider range using mime-db

@huseeiin
Copy link
Author

huseeiin commented Oct 2, 2024

added some more tiny changes :D

Copy link
Owner

@gornostay25 gornostay25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but some minor issues

* @param {'gz' | 'br'} format
*/
async function compress_file(file, format = "gz") {
/*** @param {string} file* @param {'gz' | 'br'} format*/ async function compress_file(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but there are some formatting issues

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but there are some formatting issues

i ran bun format before every commit

* @param {string} out
*/
function patchServerWebsocketHandler(out) {
/*** @param {string} out*/ function patchServerWebsocketHandler(out) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

* @param {import('.').CompressOptions} options
*/
async function compress(directory, options) {
/*** @param {string} directory* @param {import('.').CompressOptions} options*/ async function compress(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

const files = fileURLToPath(new URL("./files", import.meta.url).href);

/** @type {import('.').default} */
export default function (opts = {}) {
/** @type {import('.').default} */ export default function (opts = {}) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

@@ -55,9 +55,6 @@ interface CompressOptions {
*/
brotli?: boolean;

/**
* @default html,js,json,css,svg,xml,wasm
*/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you removed this comment?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you removed this comment?

because its way more than those anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants