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

Typo in Type Definitions and Usage: argorithm should be algorithm #18

Open
hsa00000 opened this issue May 19, 2024 · 0 comments
Open

Typo in Type Definitions and Usage: argorithm should be algorithm #18

hsa00000 opened this issue May 19, 2024 · 0 comments

Comments

@hsa00000
Copy link

Typo in Type Definitions and Usage: argorithm should be algorithm

Description:
There is a typo in the @misskey-dev/browser-image-resizer library. The key argorithm should be algorithm. This typo is present in the type definitions and throughout the codebase where this configuration is used.

Package Version:
2024.1.0

Files Affected:

  • index.d.ts
  • Other files where config.argorithm is referenced

Problem:
In the BrowserImageResizerConfigBase type, and in other parts of the codebase, the property argorithm is misspelled. It should be algorithm.

Code Snippet:

type BrowserImageResizerConfigBase = {
    /**
     * Algorithm used for downscaling
     *
     * * `null`: Just resize with `drawImage()`. The best quality and fastest.
     * * `bilinear`: Better quality, slower. Comes from upstream (ericnogralesbrowser-image-resizer).
     * * `hermite`: Worse quality, faster. Comes from [viliusle/Hermite-resize](https://github.com/viliusle/Hermite-resize). Will dispatch workers for better performance.
     * * `hermite_single`: Worse quality, faster. Single-threaded.
     *
     * default: null
     */
    argorithm: 'bilinear' | 'hermite' | 'hermite_single' | 'null' | null;
    ...
};

Proposed Fix:

  1. Rename the argorithm property to algorithm in the type definition.
  2. Update all references to config.argorithm to config.algorithm throughout the codebase.

Corrected Code Snippet:

type BrowserImageResizerConfigBase = {
    /**
     * Algorithm used for downscaling
     *
     * * `null`: Just resize with `drawImage()`. The best quality and fastest.
     * * `bilinear`: Better quality, slower. Comes from upstream (ericnogralesbrowser-image-resizer).
     * * `hermite`: Worse quality, faster. Comes from [viliusle/Hermite-resize](https://github.com/viliusle/Hermite-resize). Will dispatch workers for better performance.
     * * `hermite_single`: Worse quality, faster. Single-threaded.
     *
     * default: null
     */
    algorithm: 'bilinear' | 'hermite' | 'hermite_single' | 'null' | null;
    ...
};

Steps to Reproduce:

  1. Install the package using npm install @misskey-dev/browser-image-resizer.
  2. Import and use the BrowserImageResizerConfigBase type in a TypeScript file.
  3. Notice the typo in the property name argorithm.
  4. Search for config.argorithm in the codebase to find other instances of the typo.

Suggested Labels:

  • bug
  • typography
  • good first issue
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

No branches or pull requests

1 participant