Skip to content

Commit

Permalink
fix: add src type to CloudinaryLoaderCldOptions interface (#552)
Browse files Browse the repository at this point in the history
# Description

This PR will add the `src` type to `CloudinaryLoaderCldOptions`
interface to fix the ts error being thrown from the
`cloudinary-loader.ts` file.

Fixes This will close #425 

<!-- Specify above which issue this fixes by referencing the issue
number (`#<ISSUE_NUMBER>`) or issue URL. -->
<!-- Example: Fixes
https://github.com/cloudinary-community/next-cloudinary/issues/<ISSUE_NUMBER>
-->

## Type of change

<!-- Please select all options that are applicable. -->

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Fix or improve the documentation
- [ ] This change requires a documentation update


# Checklist

<!-- These must all be followed and checked. -->

- [x] I have followed the contributing guidelines of this project as
mentioned in [CONTRIBUTING.md](/CONTRIBUTING.md)
- [x] I have created an
[issue](https://github.com/cloudinary-community/next-cloudinary/issues)
ticket for this PR
- [x] I have checked to ensure there aren't other open [Pull
Requests](https://github.com/cloudinary-community/next-cloudinary/pulls)
for the same update/change?
- [x] I have performed a self-review of my own code
- [x] I have run tests locally to ensure they all pass
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes needed to the documentation

---------

Co-authored-by: Colby Fayock <[email protected]>
  • Loading branch information
vickywane and colbyfayock authored Nov 1, 2024
1 parent 2955336 commit 74e1b96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion next-cloudinary/src/loaders/cloudinary-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ImageProps } from 'next/image';
import { getCldImageUrl } from '../helpers/getCldImageUrl';

export interface CloudinaryLoaderCldOptions {
src: string
}

export interface CloudinaryLoaderLoaderOptions {
Expand Down Expand Up @@ -53,6 +54,5 @@ export function cloudinaryLoader({ loaderOptions, imageProps, cldOptions, cldCon
options.width = loaderOptions?.width;
}

// @ts-ignore
return getCldImageUrl(options, cldConfig);
}

0 comments on commit 74e1b96

Please sign in to comment.