Skip to content

Commit

Permalink
v2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed Jan 31, 2024
1 parent 1792691 commit f68b418
Show file tree
Hide file tree
Showing 5 changed files with 758 additions and 716 deletions.
9 changes: 7 additions & 2 deletions dist/s3-store.js

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

2 changes: 1 addition & 1 deletion dist/s3-store.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seneca/s3-store",
"version": "2.2.0",
"version": "2.3.0",
"description": "Entity store using AWS S3.",
"main": "dist/s3-store.js",
"type": "commonjs",
Expand Down
11 changes: 9 additions & 2 deletions src/s3-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,20 @@ async function s3_store(this: any, options: any) {

// Binary files
else if ('string' === typeof bin && '' !== bin) {
let data = msg.ent[bin]
if (null == data) {
let dataRef = msg.ent[bin]
if (null == dataRef) {
throw new Error(
's3-store: option ent.bin data field not found: ' + bin,
)
}

let data = dataRef

// A function can be used to 'hide" very large data.
if ('function' === typeof dataRef) {
data = dataRef()
}

Body = Buffer.from(data)
}
}
Expand Down
Loading

0 comments on commit f68b418

Please sign in to comment.