Skip to content

Commit

Permalink
Map error fix (#90)
Browse files Browse the repository at this point in the history
* Resolve D.map errors

* 1.6.2
  • Loading branch information
dvargas92495 authored Aug 6, 2023
1 parent 7105ce0 commit 04e8dce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
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": "smartblocks",
"version": "1.6.1",
"version": "1.6.2",
"description": "Create custom and programmable templates from within Roam!",
"main": "./build/main.js",
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions src/utils/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2268,15 +2268,15 @@ const processBlockTextToPromises = (s: string) => {
}
)
.then(({ output, nodeProps }) =>
typeof output === "undefined"
? Promise.reject(
"Command handler output expected a string or array, but instead got undefined"
)
: typeof output === "string"
typeof output === "string"
? [{ text: output, ...nodeProps }]
: output.map((o: string | InputTextNode) =>
: Array.isArray(output)
? output.map((o: string | InputTextNode) =>
typeof o === "string" ? { text: o, ...nodeProps } : o
)
: Promise.reject(
`Command handler output expected a string or array, but instead got ${typeof output}`
)
);
});
};
Expand Down

0 comments on commit 04e8dce

Please sign in to comment.