Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Commit

Permalink
Merge b4d54a8 into 8ec4c4c
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jan 21, 2022
2 parents 8ec4c4c + b4d54a8 commit b8d06dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Expand Up @@ -47,7 +47,10 @@ function CloudFlareWorkersKV (options) {

const { success, errors } = await fetch(
`${url}?${searchParams.toString()}`,
fetchOptions(opts, { body: JSON.stringify(value), method: 'PUT' })
fetchOptions(opts, {
body: typeof value === 'string' ? value : JSON.stringify(value),
method: 'PUT'
})
).then(res => res.json())

return success || throwError(errors[0])
Expand Down

0 comments on commit b8d06dc

Please sign in to comment.