msem-api-lib
Advanced tools
Comparing version 1.3.4 to 1.3.5
@@ -19,2 +19,5 @@ "use strict"; | ||
global.DOMParser = _xmldom.DOMParser; | ||
const { | ||
Readable | ||
} = require("stream"); | ||
const btoa = str => { | ||
@@ -77,4 +80,11 @@ const buf = Buffer.from(str, "utf-8"); | ||
}); | ||
Seq(attachment).forEach(path => { | ||
body.append("attachment", _fs.default.createReadStream(path)); | ||
Seq(attachment).forEach(item => { | ||
if (typeof item === "object") { | ||
body.append("attachment", Readable.from(item.data), { | ||
filename: item.filename | ||
}); | ||
} | ||
if (typeof item === "string") { | ||
body.append("attachment", _fs.default.createReadStream(item)); | ||
} | ||
}); | ||
@@ -81,0 +91,0 @@ const response = await (0, _nodeFetch.default)(`https://${config.host}/v3/${config.domain}/messages`, { |
{ | ||
"name": "msem-api-lib", | ||
"version": "1.3.4", | ||
"version": "1.3.5", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "build:lib": "babel ./src -x '.js,.ts,.tsx' -d .", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
36137
1012
1