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:
- Rename the
argorithm property to algorithm in the type definition.
- 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:
- Install the package using
npm install @misskey-dev/browser-image-resizer.
- Import and use the
BrowserImageResizerConfigBase type in a TypeScript file.
- Notice the typo in the property name
argorithm.
- Search for
config.argorithm in the codebase to find other instances of the typo.
Suggested Labels:
bug
typography
good first issue
Typo in Type Definitions and Usage:
argorithmshould bealgorithmDescription:
There is a typo in the
@misskey-dev/browser-image-resizerlibrary. The keyargorithmshould bealgorithm. This typo is present in the type definitions and throughout the codebase where this configuration is used.Package Version:
2024.1.0Files Affected:
index.d.tsconfig.argorithmis referencedProblem:
In the
BrowserImageResizerConfigBasetype, and in other parts of the codebase, the propertyargorithmis misspelled. It should bealgorithm.Code Snippet:
Proposed Fix:
argorithmproperty toalgorithmin the type definition.config.argorithmtoconfig.algorithmthroughout the codebase.Corrected Code Snippet:
Steps to Reproduce:
npm install @misskey-dev/browser-image-resizer.BrowserImageResizerConfigBasetype in a TypeScript file.argorithm.config.argorithmin the codebase to find other instances of the typo.Suggested Labels:
bugtypographygood first issue