@effect-app/infra 2.8.1 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-empty-object-type */
2
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
3
- import { Context, Effect, flow, Layer, Option, pipe, S, Struct } from "effect-app"
3
+ import { Context, Effect, Layer, Option, pipe, S, Struct } from "effect-app"
4
4
  import { inspect } from "util"
5
5
  import { expect, expectTypeOf, it } from "vitest"
6
6
  import { setupRequestContextFromCurrent } from "../src/api/setupRequest.js"
@@ -115,7 +115,7 @@ it("works with repo", () =>
115
115
  const q1 = yield* somethingRepo.query(() => q)
116
116
  // same as above, but with the `flow` helper
117
117
  const q2 = yield* somethingRepo
118
- .query(flow(
118
+ .query(
119
119
  where("displayName", "Verona"),
120
120
  or(
121
121
  where("displayName", "Riley"),
@@ -130,7 +130,7 @@ it("works with repo", () =>
130
130
  (_) => Effect.andThen(SomeService, _)
131
131
  )
132
132
  )
133
- ))
133
+ )
134
134
 
135
135
  expect(q1).toEqual(items.slice(0, 2).toReversed().map(Struct.pick("id", "displayName")))
136
136
  expect(q2).toEqual(items.slice(0, 2).toReversed().map(Struct.pick("displayName")))
@@ -145,7 +145,7 @@ it("collect", () =>
145
145
 
146
146
  expect(
147
147
  yield* somethingRepo
148
- .query(flow(
148
+ .query(
149
149
  where("displayName", "Riley"), // TODO: work with To type translation, so Date?
150
150
  // one,
151
151
  project(
@@ -160,13 +160,13 @@ it("collect", () =>
160
160
  ),
161
161
  "collect"
162
162
  )
163
- ))
163
+ )
164
164
  )
165
165
  .toEqual(["Riley-2020-01-01T00:00:00.000Z"])
166
166
 
167
167
  expect(
168
168
  yield* somethingRepo
169
- .query(flow(
169
+ .query(
170
170
  where("union._tag", "string"),
171
171
  one,
172
172
  project(
@@ -181,7 +181,7 @@ it("collect", () =>
181
181
  ),
182
182
  "collect"
183
183
  )
184
- ))
184
+ )
185
185
  )
186
186
  .toEqual("hi")
187
187
  })
@@ -221,8 +221,8 @@ it(
221
221
  Effect
222
222
  .gen(function*() {
223
223
  const repo = yield* makeRepo("test", TestUnion, {})
224
- const result = (yield* repo.query(flow(where("id", "123"), and("_tag", "animal")))) satisfies readonly Animal[]
225
- const result2 = (yield* repo.query(flow(where("_tag", "animal")))) satisfies readonly Animal[]
224
+ const result = (yield* repo.query(where("id", "123"), and("_tag", "animal"))) satisfies readonly Animal[]
225
+ const result2 = (yield* repo.query(where("_tag", "animal"))) satisfies readonly Animal[]
226
226
 
227
227
  expect(result).toEqual([])
228
228
  expect(result2).toEqual([])
@@ -429,7 +429,7 @@ it(
429
429
  {}
430
430
  )
431
431
 
432
- const result = yield* repo.query(flow(where("id", "123"), project(schema)))
432
+ const result = yield* repo.query(where("id", "123"), project(schema))
433
433
 
434
434
  expect(result).toEqual([])
435
435
  })