Skip to content

Commit

Permalink
Fix assign for other definitions of Result
Browse files Browse the repository at this point in the history
  • Loading branch information
pjrebsch authored and kofno committed Apr 4, 2024
1 parent 8858320 commit b926b5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tasks": {
"dev": "deno run --watch main.ts"
"dev": "deno run --watch src/index.ts"
}
}
2 changes: 1 addition & 1 deletion src/Result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class Result<E, A> {
const state = this.state;
switch (state.kind) {
case 'ok': {
const result = other instanceof Result ? other : other(state.value);
const result = typeof other === 'function' ? other(state.value) : other;
return result.map<A & { [k in K]: B }>(b => ({
...Object(state.value),
[k.toString()]: b,
Expand Down

0 comments on commit b926b5e

Please sign in to comment.