Skip to content

Commit

Permalink
Fix icon uses all strategies instead of only the first success strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
dennypradipta committed May 24, 2023
1 parent ff8ed8a commit 13aa9c5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.2]

Fixed

- Fix icon uses all strategies instead of only the first success strategy

## [1.0.1]

Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperjumptech/favicon-fetcher",
"version": "1.0.1",
"version": "1.0.2",
"description": "A utility to fetch a website's favicon",
"main": "dist/index.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion src/get-favicon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ export async function getFavicon(
return Buffer.from(ab)
})

icon = result
if (result) {
icon = result
break
}

// Else, use another strategy
continue
Expand Down

0 comments on commit 13aa9c5

Please sign in to comment.