Skip to content

Commit

Permalink
0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal committed Aug 3, 2022
1 parent 949e56a commit 38bf039
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "astro-flow-demo",
"type": "module",
"version": "0.2.1",
"version": "0.2.2",
"private": true,
"scripts": {
"start": "astro dev",
"build": "astro build",
"serve": "astro preview"
},
"devDependencies": {
"@astropub/flow": "0.2.1",
"@astropub/flow": "0.2.2",
"astro": "latest"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "astro-flow-root",
"type": "module",
"version": "0.2.1",
"version": "0.2.2",
"workspaces": [
"demo",
"packages/*"
Expand Down
4 changes: 2 additions & 2 deletions packages/astro-flow/AstroWhen.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const render = async (props: Record<string, any>) => {
const hasTruthyWhen = Object.values(props).every(value => Boolean(value))
/** Slot to render, which is `"default"` when `true` and `"else"` when `false`. */
const slotToRender = hasTruthyWhen ? 'default' : 'else'
const slotToRender = hasTruthyWhen ? 'default' : Object.hasOwn(Astro.slots, 'else') ? 'else' : ''
/** Rendered contents. */
const htmlPart = new String(await Astro.slots.render(slotToRender))
const htmlPart = new String(slotToRender ? await Astro.slots.render(slotToRender) : '')
return htmlPart
}
Expand Down
2 changes: 1 addition & 1 deletion packages/astro-flow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/package.json",
"name": "@astropub/flow",
"description": "Use control flow statements in Astro",
"version": "0.2.1",
"version": "0.2.2",
"type": "module",
"license": "CC0-1.0",
"exports": {
Expand Down

0 comments on commit 38bf039

Please sign in to comment.