Skip to content

Commit d7882a4

Browse files
committed
simplify
1 parent d06e1c9 commit d7882a4

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/translator/predicate.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ function applyToAndTurnInto(
3333
predicate: English.NounPhrase,
3434
object: English.NounPhrase,
3535
) {
36-
return IterableResult.concat(
37-
IterableResult.fromArray(
38-
nullableAsArray(extractNegativeFromNoun(predicate)),
39-
)
40-
.map((predicate) => [true as boolean, predicate]),
41-
IterableResult.single([false as boolean, predicate]),
42-
)
36+
return IterableResult.fromArray([
37+
...nullableAsArray(extractNegativeFromNoun(predicate))
38+
.map((predicate) => [true, predicate] as const),
39+
[false, predicate] as const,
40+
])
4341
.flatMap(([negated, predicate]) =>
4442
IterableResult.fromArray([
4543
{
@@ -88,13 +86,11 @@ function applyToAndTurnInto(
8886
);
8987
}
9088
function make(predicate: AdjectiveWithInWay, object: English.NounPhrase) {
91-
return IterableResult.concat(
92-
IterableResult.fromArray(
93-
nullableAsArray(extractNegativeFromAdjective(predicate.adjective)),
94-
)
95-
.map((adjective) => [true as boolean, adjective]),
96-
IterableResult.single([false as boolean, predicate.adjective]),
97-
)
89+
return IterableResult.fromArray([
90+
...nullableAsArray(extractNegativeFromAdjective(predicate.adjective))
91+
.map((adjective) => [true, adjective] as const),
92+
[false, predicate.adjective] as const,
93+
])
9894
.map(([negated, adjective]) => ({
9995
type: "simple",
10096
modal: null,

0 commit comments

Comments
 (0)