Skip to content

Commit

Permalink
Stable v3.2.1 SDK (#141)
Browse files Browse the repository at this point in the history
* chore: sync master branch with stable branch (#127)

* feat: HEIF image widget support

* feat: added WidgetMakeOptions#convertOptions

* fix: missing variable (wrong var scope)

* export type (#136)

* fix: added missing break keyword

* Update package.json

* fix: remove duplicated dead code

Co-authored-by: hands8142 <dongsu8142@kakao.com>
  • Loading branch information
zero734kr and hands8142 authored Feb 25, 2022
1 parent c314ba9 commit c66a4c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "koreanbots",
"version": "3.2.0",
"version": "3.2.1",
"description": "JavaScript/TypeScript SDK for KOREANBOTS",
"main": "dist/src/index.js",
"typings": "dist/src/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export { Github } from "./structures/Github"
export { Owners } from "./structures/Owners"
export { Widget } from "./structures/Widget"

export * from "./utils/types"
export * as Constants from "./utils/Constants"
export * as Utils from "./utils"
export * as Errors from "./utils/Errors"
9 changes: 3 additions & 6 deletions src/managers/WidgetManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,12 @@ export class WidgetManager {
target: options.target,
type: options.type
}

const key = createHash("sha256").update(JSON.stringify(cacheKey)).digest("hex")
const cache = this.cache.get(key)

if (!fetchOptions?.force && cache) {
const cache = this.cache.get(key)
if (!fetchOptions?.force && cache)
return cache
}

for (const queryOption of queryOptions) {
const value = options[queryOption]?.toString?.() || options[queryOption] as string
Expand Down Expand Up @@ -162,8 +161,6 @@ export class WidgetManager {
case "heif":
converted = sh(buffer).heif(options.convertOptions).toBuffer()
break
case "avif":
converted = sh(buffer).avif().toBuffer()
default:
converted = buffer
break
Expand Down

0 comments on commit c66a4c0

Please sign in to comment.