Skip to content

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

@hsa00000

Description

@hsa00000

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions