@livestore/utils 0.3.1 → 0.3.2-dev.1

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.
Files changed (112) hide show
  1. package/dist/.tsbuildinfo.json +1 -1
  2. package/dist/NoopTracer.d.ts +1 -0
  3. package/dist/NoopTracer.d.ts.map +1 -1
  4. package/dist/NoopTracer.js +1 -1
  5. package/dist/NoopTracer.js.map +1 -1
  6. package/dist/base64.d.ts.map +1 -1
  7. package/dist/base64.js +2 -2
  8. package/dist/base64.js.map +1 -1
  9. package/dist/cuid/cuid.browser.d.ts.map +1 -1
  10. package/dist/cuid/cuid.browser.js +12 -10
  11. package/dist/cuid/cuid.browser.js.map +1 -1
  12. package/dist/cuid/cuid.node.d.ts.map +1 -1
  13. package/dist/cuid/cuid.node.js +17 -11
  14. package/dist/cuid/cuid.node.js.map +1 -1
  15. package/dist/effect/Effect.d.ts.map +1 -1
  16. package/dist/effect/Effect.js +3 -3
  17. package/dist/effect/Effect.js.map +1 -1
  18. package/dist/effect/Scheduler.d.ts.map +1 -1
  19. package/dist/effect/Scheduler.js +0 -1
  20. package/dist/effect/Scheduler.js.map +1 -1
  21. package/dist/effect/Schema/debug-diff.test.js +1 -1
  22. package/dist/effect/Schema/index.d.ts +2 -2
  23. package/dist/effect/Schema/index.js +3 -3
  24. package/dist/effect/Subscribable.d.ts.map +1 -1
  25. package/dist/effect/Subscribable.js +2 -3
  26. package/dist/effect/Subscribable.js.map +1 -1
  27. package/dist/effect/WebChannel/WebChannel.d.ts +13 -17
  28. package/dist/effect/WebChannel/WebChannel.d.ts.map +1 -1
  29. package/dist/effect/WebChannel/WebChannel.js +5 -6
  30. package/dist/effect/WebChannel/WebChannel.js.map +1 -1
  31. package/dist/effect/WebChannel/WebChannel.test.js +1 -1
  32. package/dist/effect/WebChannel/broadcastChannelWithAck.d.ts +2 -2
  33. package/dist/effect/WebChannel/broadcastChannelWithAck.js +2 -2
  34. package/dist/effect/WebChannel/mod.d.ts +3 -3
  35. package/dist/effect/WebChannel/mod.d.ts.map +1 -1
  36. package/dist/effect/WebChannel/mod.js +3 -3
  37. package/dist/effect/WebChannel/mod.js.map +1 -1
  38. package/dist/effect/WebLock.d.ts +1 -1
  39. package/dist/effect/WebLock.d.ts.map +1 -1
  40. package/dist/effect/WebLock.js.map +1 -1
  41. package/dist/effect/WebSocket.test.js +1 -1
  42. package/dist/effect/index.d.ts +22 -23
  43. package/dist/effect/index.d.ts.map +1 -1
  44. package/dist/effect/index.js +25 -26
  45. package/dist/effect/index.js.map +1 -1
  46. package/dist/env.js +1 -1
  47. package/dist/fast-deep-equal.d.ts.map +1 -1
  48. package/dist/fast-deep-equal.js +9 -8
  49. package/dist/fast-deep-equal.js.map +1 -1
  50. package/dist/global.js.map +1 -1
  51. package/dist/index.d.ts +18 -14
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +25 -17
  54. package/dist/index.js.map +1 -1
  55. package/dist/misc.d.ts.map +1 -1
  56. package/dist/misc.js +3 -3
  57. package/dist/misc.js.map +1 -1
  58. package/dist/node/ChildProcessRunner/ChildProcessRunner.d.ts.map +1 -1
  59. package/dist/node/ChildProcessRunner/ChildProcessRunner.js +3 -2
  60. package/dist/node/ChildProcessRunner/ChildProcessRunner.js.map +1 -1
  61. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/ChildProcessRunner.test.js +2 -2
  62. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/schema.d.ts +4 -4
  63. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/serializedWorker.js +3 -3
  64. package/dist/node/ChildProcessRunner/ChildProcessWorker.d.ts +1 -1
  65. package/dist/node/ChildProcessRunner/ChildProcessWorker.d.ts.map +1 -1
  66. package/dist/node/ChildProcessRunner/ChildProcessWorker.js +0 -1
  67. package/dist/node/ChildProcessRunner/ChildProcessWorker.js.map +1 -1
  68. package/dist/node/mod.d.ts +4 -4
  69. package/dist/node/mod.d.ts.map +1 -1
  70. package/dist/node/mod.js +5 -5
  71. package/dist/node/mod.js.map +1 -1
  72. package/dist/object/index.d.ts +3 -2
  73. package/dist/object/index.d.ts.map +1 -1
  74. package/dist/object/index.js +3 -2
  75. package/dist/object/index.js.map +1 -1
  76. package/dist/object/stringify-object.d.ts +9 -0
  77. package/dist/object/stringify-object.d.ts.map +1 -0
  78. package/dist/object/stringify-object.js +27 -0
  79. package/dist/object/stringify-object.js.map +1 -0
  80. package/dist/object/stringify-object.test.d.ts +2 -0
  81. package/dist/object/stringify-object.test.d.ts.map +1 -0
  82. package/dist/object/stringify-object.test.js +38 -0
  83. package/dist/object/stringify-object.test.js.map +1 -0
  84. package/package.json +43 -35
  85. package/src/NoopTracer.ts +2 -2
  86. package/src/base64.ts +2 -3
  87. package/src/cuid/cuid.browser.ts +20 -21
  88. package/src/cuid/cuid.node.ts +33 -34
  89. package/src/effect/Effect.ts +6 -3
  90. package/src/effect/Scheduler.ts +0 -1
  91. package/src/effect/Schema/debug-diff.test.ts +2 -2
  92. package/src/effect/Schema/index.ts +3 -3
  93. package/src/effect/Subscribable.ts +6 -5
  94. package/src/effect/WebChannel/WebChannel.test.ts +1 -1
  95. package/src/effect/WebChannel/WebChannel.ts +17 -21
  96. package/src/effect/WebChannel/broadcastChannelWithAck.ts +3 -3
  97. package/src/effect/WebChannel/mod.ts +3 -3
  98. package/src/effect/WebLock.ts +2 -2
  99. package/src/effect/WebSocket.test.ts +1 -1
  100. package/src/effect/index.ts +104 -110
  101. package/src/env.ts +1 -1
  102. package/src/fast-deep-equal.ts +9 -10
  103. package/src/index.ts +27 -17
  104. package/src/misc.ts +3 -3
  105. package/src/node/ChildProcessRunner/ChildProcessRunner.ts +1 -1
  106. package/src/node/ChildProcessRunner/ChildProcessRunnerTest/ChildProcessRunner.test.ts +3 -3
  107. package/src/node/ChildProcessRunner/ChildProcessRunnerTest/serializedWorker.ts +3 -3
  108. package/src/node/ChildProcessRunner/ChildProcessWorker.ts +1 -4
  109. package/src/node/mod.ts +6 -6
  110. package/src/object/index.ts +3 -2
  111. package/src/object/stringify-object.test.ts +44 -0
  112. package/src/object/stringify-object.ts +27 -0
@@ -15,32 +15,31 @@
15
15
  import crypto from 'node:crypto'
16
16
  import os from 'node:os'
17
17
 
18
- const lim = Math.pow(2, 32) - 1
18
+ const lim = 2 ** 32 - 1
19
19
 
20
20
  const getRandomValue = () => {
21
21
  return Math.abs(crypto.randomBytes(4).readInt32BE() / lim)
22
22
  }
23
23
 
24
24
  const pad = (num: number | string, size: number) => {
25
- const s = '000000000' + num
25
+ const s = `000000000${num}`
26
26
  return s.slice(s.length - size)
27
27
  }
28
28
 
29
29
  const fingerprint = () => {
30
- const padding = 2,
31
- pid = pad(process.pid.toString(36), padding),
32
- hostname = os.hostname(),
33
- length = hostname.length,
34
- hostId = pad(
35
- hostname
36
- .split('')
37
- .reduce((prev, char) => {
38
- // eslint-disable-next-line unicorn/prefer-code-point
39
- return +prev + char.charCodeAt(0)
40
- }, +length + 36)
41
- .toString(36),
42
- padding,
43
- )
30
+ const padding = 2
31
+ const pid = pad(process.pid.toString(36), padding)
32
+ const hostname = os.hostname()
33
+ const length = hostname.length
34
+ const hostId = pad(
35
+ hostname
36
+ .split('')
37
+ .reduce((prev, char) => {
38
+ return +prev + char.charCodeAt(0)
39
+ }, +length + 36)
40
+ .toString(36),
41
+ padding,
42
+ )
44
43
 
45
44
  return pid + hostId
46
45
  }
@@ -48,7 +47,7 @@ const fingerprint = () => {
48
47
  let c = 0
49
48
  const blockSize = 4
50
49
  const base = 36
51
- const discreteValues = Math.pow(base, blockSize)
50
+ const discreteValues = base ** blockSize
52
51
 
53
52
  const randomBlock = () => {
54
53
  return pad(Math.trunc(getRandomValue() * discreteValues).toString(base), blockSize)
@@ -63,28 +62,28 @@ const safeCounter = () => {
63
62
  export const cuid = () => {
64
63
  // Starting with a lowercase letter makes
65
64
  // it HTML element ID friendly.
66
- const letter = 'c', // hard-coded allows for sequential access
67
- // timestamp
68
- // warning: this exposes the exact date and time
69
- // that the uid was created.
70
- timestamp = Date.now().toString(base),
71
- // Prevent same-machine collisions.
72
- counter = pad(safeCounter().toString(base), blockSize),
73
- // A few chars to generate distinct ids for different
74
- // clients (so different computers are far less
75
- // likely to generate the same id)
76
- print = fingerprint(),
77
- // Grab some more chars from Math.random()
78
- random = randomBlock() + randomBlock()
65
+ const letter = 'c' // hard-coded allows for sequential access
66
+ // timestamp
67
+ // warning: this exposes the exact date and time
68
+ // that the uid was created.
69
+ const timestamp = Date.now().toString(base)
70
+ // Prevent same-machine collisions.
71
+ const counter = pad(safeCounter().toString(base), blockSize)
72
+ // A few chars to generate distinct ids for different
73
+ // clients (so different computers are far less
74
+ // likely to generate the same id)
75
+ const print = fingerprint()
76
+ // Grab some more chars from Math.random()
77
+ const random = randomBlock() + randomBlock()
79
78
 
80
79
  return letter + timestamp + counter + print + random
81
80
  }
82
81
 
83
82
  export const slug = () => {
84
- const date = Date.now().toString(36),
85
- counter = safeCounter().toString(36).slice(-4),
86
- print = fingerprint().slice(0, 1) + fingerprint().slice(-1),
87
- random = randomBlock().slice(-2)
83
+ const date = Date.now().toString(36)
84
+ const counter = safeCounter().toString(36).slice(-4)
85
+ const print = fingerprint().slice(0, 1) + fingerprint().slice(-1)
86
+ const random = randomBlock().slice(-2)
88
87
 
89
88
  return date.slice(-2) + counter + print + random
90
89
  }
@@ -5,8 +5,8 @@ import type { UnknownException } from 'effect/Cause'
5
5
  import { log } from 'effect/Console'
6
6
  import type { LazyArg } from 'effect/Function'
7
7
 
8
- import { isPromise } from '../index.js'
9
- import { UnknownError } from './Error.js'
8
+ import { isPromise } from '../index.ts'
9
+ import { UnknownError } from './Error.ts'
10
10
 
11
11
  export * from 'effect/Effect'
12
12
 
@@ -57,7 +57,10 @@ export const tryAll = <Res>(
57
57
  export const acquireReleaseLog = (label: string) =>
58
58
  Effect.acquireRelease(Effect.log(`${label} acquire`), (_, ex) => Effect.log(`${label} release`, ex))
59
59
 
60
- export const addFinalizerLog = (...msgs: any[]) => Effect.addFinalizer(() => Effect.log(...msgs))
60
+ export const addFinalizerLog = (...msgs: any[]) =>
61
+ Effect.addFinalizer((exit) =>
62
+ Effect.log(...msgs, exit._tag === 'Success' ? 'with success' : `with failure: ${Cause.pretty(exit.cause)}`),
63
+ )
61
64
 
62
65
  export const logBefore =
63
66
  (...msgs: any[]) =>
@@ -9,6 +9,5 @@ export const messageChannel = (shouldYield: Scheduler.Scheduler['shouldYield'] =
9
9
 
10
10
  messageChannel.port1.postMessage(undefined)
11
11
 
12
- // eslint-disable-next-line unicorn/prefer-add-event-listener
13
12
  messageChannel.port2.onmessage = task
14
13
  }, shouldYield)
@@ -1,8 +1,8 @@
1
1
  import { Schema } from 'effect'
2
2
  import { describe, expect, test } from 'vitest'
3
3
 
4
- import type { DiffItem } from './debug-diff.js'
5
- import { debugDiff } from './debug-diff.js'
4
+ import type { DiffItem } from './debug-diff.ts'
5
+ import { debugDiff } from './debug-diff.ts'
6
6
 
7
7
  describe('debug-diff', () => {
8
8
  test('simple object', () => {
@@ -4,11 +4,11 @@ import { Effect, Hash, ParseResult, Schema } from 'effect'
4
4
  import type { ParseError } from 'effect/ParseResult'
5
5
  import type { ParseOptions } from 'effect/SchemaAST'
6
6
 
7
- import { shouldNeverHappen } from '../../index.js'
7
+ import { shouldNeverHappen } from '../../index.ts'
8
8
 
9
9
  export * from 'effect/Schema'
10
- export * from './debug-diff.js'
11
- export * from './msgpack.js'
10
+ export * from './debug-diff.ts'
11
+ export * from './msgpack.ts'
12
12
 
13
13
  // NOTE this is a temporary workaround until Effect schema has a better way to hash schemas
14
14
  // https://github.com/Effect-TS/effect/issues/2719
@@ -49,13 +49,14 @@ class SubscribableImpl<in out A> extends Effectable.Class<A> implements Subscrib
49
49
  readonly [TypeId] = TypeId
50
50
  // @ts-expect-error type symbol
51
51
  readonly [Readable.TypeId] = Readable.TypeId
52
- constructor(
53
- readonly get: Effect.Effect<A>,
54
- readonly changes: Stream.Stream<A>,
55
- ) {
52
+ readonly get: Effect.Effect<A>
53
+ readonly changes: Stream.Stream<A>
54
+ constructor(get: Effect.Effect<A>, changes: Stream.Stream<A>) {
56
55
  super()
56
+ this.get = get
57
+ this.changes = changes
57
58
  }
58
- // eslint-disable-next-line prefer-arrow/prefer-arrow-functions
59
+
59
60
  commit() {
60
61
  return this.get
61
62
  }
@@ -2,7 +2,7 @@ import * as Vitest from '@effect/vitest'
2
2
  import { Effect, Schema, Stream } from 'effect'
3
3
  import { JSDOM } from 'jsdom'
4
4
 
5
- import * as WebChannel from './WebChannel.js'
5
+ import * as WebChannel from './WebChannel.ts'
6
6
 
7
7
  Vitest.describe('WebChannel', () => {
8
8
  Vitest.describe('windowChannel', () => {
@@ -1,20 +1,21 @@
1
1
  import { Deferred, Either, Exit, GlobalValue, identity, Option, PubSub, Queue, Scope } from 'effect'
2
2
  import type { DurationInput } from 'effect/Duration'
3
3
 
4
- import { shouldNeverHappen } from '../../misc.js'
5
- import * as Effect from '../Effect.js'
6
- import * as Schema from '../Schema/index.js'
7
- import * as Stream from '../Stream.js'
4
+ import { shouldNeverHappen } from '../../misc.ts'
5
+ import * as Effect from '../Effect.ts'
6
+ import * as Schema from '../Schema/index.ts'
7
+ import * as Stream from '../Stream.ts'
8
8
  import {
9
9
  DebugPingMessage,
10
10
  type InputSchema,
11
+ listenToDebugPing,
12
+ mapSchema,
11
13
  type WebChannel,
12
14
  WebChannelHeartbeat,
13
15
  WebChannelPing,
14
16
  WebChannelPong,
15
17
  WebChannelSymbol,
16
- } from './common.js'
17
- import { listenToDebugPing, mapSchema } from './common.js'
18
+ } from './common.ts'
18
19
 
19
20
  export const shutdown = <MsgListen, MsgSend>(webChannel: WebChannel<MsgListen, MsgSend>): Effect.Effect<void> =>
20
21
  Deferred.done(webChannel.closedDeferred, Exit.void)
@@ -158,13 +159,11 @@ export const windowChannel = <MsgListen, MsgSend, MsgListenEncoded, MsgSendEncod
158
159
  }).pipe(Effect.withSpan(`WebChannel:windowChannel`)),
159
160
  )
160
161
 
161
- export const messagePortChannel: {
162
- <MsgListen, MsgSend, MsgListenEncoded, MsgSendEncoded>(args: {
163
- port: MessagePort
164
- schema: InputSchema<MsgListen, MsgSend, MsgListenEncoded, MsgSendEncoded>
165
- debugId?: string | number
166
- }): Effect.Effect<WebChannel<MsgListen, MsgSend>, never, Scope.Scope>
167
- } = ({ port, schema: inputSchema, debugId }) =>
162
+ export const messagePortChannel: <MsgListen, MsgSend, MsgListenEncoded, MsgSendEncoded>(args: {
163
+ port: MessagePort
164
+ schema: InputSchema<MsgListen, MsgSend, MsgListenEncoded, MsgSendEncoded>
165
+ debugId?: string | number
166
+ }) => Effect.Effect<WebChannel<MsgListen, MsgSend>, never, Scope.Scope> = ({ port, schema: inputSchema, debugId }) =>
168
167
  Effect.scopeWithCloseable((scope) =>
169
168
  Effect.gen(function* () {
170
169
  const schema = mapSchema(inputSchema)
@@ -247,13 +246,11 @@ export const sameThreadChannel = <MsgListen, MsgSend, MsgListenEncoded, MsgSendE
247
246
  }),
248
247
  )
249
248
 
250
- export const messagePortChannelWithAck: {
251
- <MsgListen, MsgSend, MsgListenEncoded, MsgSendEncoded>(args: {
252
- port: MessagePort
253
- schema: InputSchema<MsgListen, MsgSend, MsgListenEncoded, MsgSendEncoded>
254
- debugId?: string | number
255
- }): Effect.Effect<WebChannel<MsgListen, MsgSend>, never, Scope.Scope>
256
- } = ({ port, schema: inputSchema, debugId }) =>
249
+ export const messagePortChannelWithAck: <MsgListen, MsgSend, MsgListenEncoded, MsgSendEncoded>(args: {
250
+ port: MessagePort
251
+ schema: InputSchema<MsgListen, MsgSend, MsgListenEncoded, MsgSendEncoded>
252
+ debugId?: string | number
253
+ }) => Effect.Effect<WebChannel<MsgListen, MsgSend>, never, Scope.Scope> = ({ port, schema: inputSchema, debugId }) =>
257
254
  Effect.scopeWithCloseable((scope) =>
258
255
  Effect.gen(function* () {
259
256
  const schema = mapSchema(inputSchema)
@@ -273,7 +270,6 @@ export const messagePortChannelWithAck: {
273
270
  const ChannelMessage = Schema.Union(ChannelRequest, ChannelRequestAck).annotations({
274
271
  title: 'webmesh.ChannelMessage',
275
272
  })
276
- type ChannelMessage = typeof ChannelMessage.Type
277
273
 
278
274
  const debugInfo = {
279
275
  sendTotal: 0,
@@ -1,8 +1,8 @@
1
1
  import { Deferred, Exit, Predicate, Queue, Schema, Scope, Stream } from 'effect'
2
2
 
3
- import * as Effect from '../Effect.js'
4
- import type { InputSchema, WebChannel } from './common.js'
5
- import { listenToDebugPing, mapSchema, WebChannelSymbol } from './common.js'
3
+ import * as Effect from '../Effect.ts'
4
+ import type { InputSchema, WebChannel } from './common.ts'
5
+ import { listenToDebugPing, mapSchema, WebChannelSymbol } from './common.ts'
6
6
 
7
7
  const ConnectMessage = Schema.TaggedStruct('ConnectMessage', {
8
8
  from: Schema.String,
@@ -1,3 +1,3 @@
1
- export * from './WebChannel.js'
2
- export * from './broadcastChannelWithAck.js'
3
- export * from './common.js'
1
+ export * from './broadcastChannelWithAck.ts'
2
+ export * from './common.ts'
3
+ export * from './WebChannel.ts'
@@ -12,7 +12,7 @@ export const withLock =
12
12
  onTaken?: Effect.Effect<void, E2>
13
13
  options?: Omit<LockOptions, 'signal'>
14
14
  }) =>
15
- <Ctx, E, A>(eff: Effect.Effect<A, E, Ctx>): Effect.Effect<A | void, E | E2, Ctx> =>
15
+ <Ctx, E, A>(eff: Effect.Effect<A, E, Ctx>): Effect.Effect<A, E | E2, Ctx> =>
16
16
  Effect.gen(function* () {
17
17
  const runtime = yield* Effect.runtime<Ctx>()
18
18
 
@@ -35,7 +35,7 @@ export const withLock =
35
35
 
36
36
  // TODO also propagate Effect interruption to the execution
37
37
  return Runtime.runPromiseExit(runtime)(eff)
38
- })
38
+ }) as unknown as Promise<Exit.Exit<A, E>>
39
39
  },
40
40
  catch: (err) => err as any as E,
41
41
  })
@@ -2,7 +2,7 @@ import { FetchHttpClient } from '@effect/platform'
2
2
  import * as Vitest from '@effect/vitest'
3
3
  import { Effect, Exit } from 'effect'
4
4
 
5
- import { makeWebSocket } from './WebSocket.js'
5
+ import { makeWebSocket } from './WebSocket.ts'
6
6
 
7
7
  Vitest.describe('WebSocket', () => {
8
8
  Vitest.scopedLive(
@@ -1,137 +1,131 @@
1
- import '../global.js'
1
+ import '../global.ts'
2
2
 
3
+ export * as OtelTracer from '@effect/opentelemetry/Tracer'
3
4
  export {
4
- Scope,
5
- Ref,
6
- SynchronizedRef,
7
- Queue,
5
+ Command,
6
+ CommandExecutor,
7
+ Error as PlatformError,
8
+ FetchHttpClient,
9
+ FileSystem,
10
+ Headers,
11
+ HttpClient,
12
+ HttpClientError,
13
+ HttpClientRequest,
14
+ HttpClientResponse,
15
+ HttpMiddleware,
16
+ HttpRouter,
17
+ HttpServer,
18
+ HttpServerRequest,
19
+ HttpServerResponse,
20
+ KeyValueStore,
21
+ Socket,
22
+ Terminal,
23
+ Transferable,
24
+ UrlParams,
25
+ Worker,
26
+ WorkerError,
27
+ WorkerRunner,
28
+ } from '@effect/platform'
29
+ export { BrowserWorker, BrowserWorkerRunner } from '@effect/platform-browser'
30
+ export {
31
+ Rpc,
32
+ RpcClient,
33
+ RpcGroup,
34
+ RpcMessage,
35
+ RpcMiddleware,
36
+ RpcSchema,
37
+ RpcSerialization,
38
+ RpcServer,
39
+ RpcTest,
40
+ RpcWorker,
41
+ } from '@effect/rpc'
42
+ export * as StandardSchema from '@standard-schema/spec'
43
+ export {
44
+ Array as ReadonlyArray,
45
+ Brand,
46
+ Cache,
47
+ Cause,
48
+ Channel,
49
+ Chunk,
50
+ // Logger,
51
+ Config,
52
+ Context,
53
+ Data,
54
+ Deferred,
55
+ Duration,
56
+ Either,
57
+ Equal,
58
+ ExecutionStrategy,
59
+ Exit,
8
60
  Fiber,
61
+ FiberHandle,
9
62
  FiberId,
10
- FiberSet,
11
63
  FiberMap,
12
- FiberHandle,
13
- Inspectable,
14
- RuntimeFlags,
15
- PubSub,
16
- Exit,
17
- Cause,
18
- Runtime,
19
64
  FiberRef,
20
65
  FiberRefs,
21
66
  FiberRefsPatch,
22
- Deferred,
23
- Metric,
24
- MetricState,
25
- Request,
26
- Tracer,
27
- Context,
28
- Data,
29
- Either,
30
- Brand,
67
+ FiberSet,
68
+ GlobalValue,
31
69
  Hash,
32
- Equal,
33
- Chunk,
34
- Duration,
35
- Array as ReadonlyArray,
36
- Record as ReadonlyRecord,
37
- SortedMap,
38
70
  HashMap,
39
71
  HashSet,
72
+ Inspectable,
73
+ identity,
74
+ Layer,
75
+ List,
76
+ LogLevel,
77
+ LogSpan,
78
+ Mailbox,
40
79
  ManagedRuntime,
41
- MutableHashSet,
80
+ Match,
81
+ Metric,
82
+ MetricState,
42
83
  MutableHashMap,
43
- TQueue,
84
+ MutableHashSet,
44
85
  Option,
45
- LogLevel,
46
- // Logger,
47
- Config,
48
- Layer,
49
- STM,
50
- TRef,
51
- Channel,
86
+ ParseResult,
52
87
  Predicate,
88
+ Pretty,
89
+ PrimaryKey,
90
+ PubSub,
53
91
  // Subscribable,
54
92
  pipe,
55
- identity,
56
- GlobalValue,
57
- Match,
93
+ Queue,
94
+ Record as ReadonlyRecord,
95
+ Ref,
96
+ Request,
97
+ Runtime,
98
+ RuntimeFlags,
99
+ Scope,
100
+ SortedMap,
101
+ STM,
102
+ SynchronizedRef,
58
103
  TestServices,
59
- Mailbox,
60
- ExecutionStrategy,
61
- PrimaryKey,
104
+ TQueue,
105
+ TRef,
106
+ Tracer,
62
107
  Types,
63
- Cache,
64
108
  } from 'effect'
65
-
66
- export * as StandardSchema from '@standard-schema/spec'
67
-
68
109
  export { dual } from 'effect/Function'
69
-
70
- export * as Stream from './Stream.js'
71
-
72
- export * as BucketQueue from './BucketQueue.js'
73
-
74
- export * as SubscriptionRef from './SubscriptionRef.js'
75
- export * as Subscribable from './Subscribable.js'
76
-
77
- export * as Logger from './Logger.js'
78
-
79
- export * as WebChannel from './WebChannel/mod.js'
80
- export * as WebSocket from './WebSocket.js'
81
-
82
- export * as SchemaAST from 'effect/SchemaAST'
83
110
  export { TreeFormatter } from 'effect/ParseResult'
84
- export { ParseResult, Pretty } from 'effect'
85
111
  export type { Serializable, SerializableWithResult } from 'effect/Schema'
86
- export * as Schema from './Schema/index.js'
87
- export * as OtelTracer from '@effect/opentelemetry/Tracer'
88
- export * as TaskTracing from './TaskTracing.js'
89
-
90
- export {
91
- Rpc,
92
- RpcGroup,
93
- RpcClient,
94
- RpcMessage,
95
- RpcSchema,
96
- RpcMiddleware,
97
- RpcServer,
98
- RpcSerialization,
99
- RpcTest,
100
- RpcWorker,
101
- } from '@effect/rpc'
102
112
 
103
- export {
104
- Transferable,
105
- FileSystem,
106
- Worker,
107
- WorkerError,
108
- WorkerRunner,
109
- Terminal,
110
- HttpServer,
111
- HttpClient,
112
- HttpClientError,
113
- HttpClientRequest,
114
- HttpClientResponse,
115
- FetchHttpClient,
116
- Socket,
117
- UrlParams,
118
- HttpServerRequest,
119
- Headers,
120
- HttpMiddleware,
121
- HttpRouter,
122
- HttpServerResponse,
123
- Command,
124
- CommandExecutor,
125
- KeyValueStore,
126
- Error as PlatformError,
127
- } from '@effect/platform'
128
- export { BrowserWorker, BrowserWorkerRunner } from '@effect/platform-browser'
113
+ export * as SchemaAST from 'effect/SchemaAST'
114
+ export * as BucketQueue from './BucketQueue.ts'
115
+ export * as Logger from './Logger.ts'
116
+ export * as Schema from './Schema/index.ts'
117
+ export * as Stream from './Stream.ts'
118
+ export * as Subscribable from './Subscribable.ts'
119
+ export * as SubscriptionRef from './SubscriptionRef.ts'
120
+ export * as TaskTracing from './TaskTracing.ts'
121
+ export * as WebChannel from './WebChannel/mod.ts'
122
+ export * as WebSocket from './WebSocket.ts'
129
123
 
130
124
  // export { DevTools as EffectDevtools } from '@effect/experimental'
131
125
 
132
- export * as Effect from './Effect.js'
133
- export * as Schedule from './Schedule.js'
134
- export * as Scheduler from './Scheduler.js'
135
- export * from './Error.js'
136
- export * as ServiceContext from './ServiceContext.js'
137
- export * as WebLock from './WebLock.js'
126
+ export * as Effect from './Effect.ts'
127
+ export * from './Error.ts'
128
+ export * as Schedule from './Schedule.ts'
129
+ export * as Scheduler from './Scheduler.ts'
130
+ export * as ServiceContext from './ServiceContext.ts'
131
+ export * as WebLock from './WebLock.ts'
package/src/env.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { envTruish } from './misc.js'
1
+ import { envTruish } from './misc.ts'
2
2
 
3
3
  export const env = (name: string): string | undefined => {
4
4
  if (typeof process !== 'undefined' && process.env !== undefined) {
@@ -1,19 +1,19 @@
1
- /* eslint-disable no-var */
2
-
3
1
  // Copied from fast-deep-equal
4
2
  // MIT License
5
3
 
6
4
  export const deepEqual = <T>(a: T, b: T): boolean => {
7
5
  if (a === b) return true
8
6
 
9
- if (a && b && typeof a == 'object' && typeof b == 'object') {
7
+ if (a && b && typeof a === 'object' && typeof b === 'object') {
10
8
  if (a.constructor !== b.constructor) return false
11
9
 
12
- var length, i, keys
10
+ let length: number
11
+ let i: any
12
+ let keys: any
13
13
  if (Array.isArray(a)) {
14
14
  length = a.length
15
15
  // @ts-expect-error ...
16
- if (length != b.length) return false
16
+ if (length !== b.length) return false
17
17
  for (i = length; i-- !== 0; )
18
18
  // @ts-expect-error ...
19
19
  if (!deepEqual(a[i], b[i])) return false
@@ -37,7 +37,7 @@ export const deepEqual = <T>(a: T, b: T): boolean => {
37
37
  // @ts-expect-error ...
38
38
  length = a.length
39
39
  // @ts-expect-error ...
40
- if (length != b.length) return false
40
+ if (length !== b.length) return false
41
41
  for (i = length; i-- !== 0; )
42
42
  // @ts-expect-error ...
43
43
  if (a[i] !== b[i]) return false
@@ -53,12 +53,10 @@ export const deepEqual = <T>(a: T, b: T): boolean => {
53
53
  length = keys.length
54
54
  if (length !== Object.keys(b).length) return false
55
55
 
56
- for (i = length; i-- !== 0; )
57
- // @ts-expect-error ...
58
- if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false
56
+ for (i = length; i-- !== 0; ) if (!Object.hasOwn(b, keys[i])) return false
59
57
 
60
58
  for (i = length; i-- !== 0; ) {
61
- var key = keys[i]
59
+ const key = keys[i]
62
60
 
63
61
  // @ts-expect-error ...
64
62
  if (!deepEqual(a[key], b[key])) return false
@@ -68,5 +66,6 @@ export const deepEqual = <T>(a: T, b: T): boolean => {
68
66
  }
69
67
 
70
68
  // true if both NaN, false otherwise
69
+ // biome-ignore lint/suspicious/noSelfCompare: comparing to itself is fine here
71
70
  return a !== a && b !== b
72
71
  }