@livestore/utils 0.3.2-dev.0 → 0.3.2-dev.5
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.
- package/dist/.tsbuildinfo.json +1 -1
- package/dist/NoopTracer.d.ts.map +1 -1
- package/dist/NoopTracer.js.map +1 -1
- package/dist/base64.d.ts.map +1 -1
- package/dist/base64.js +0 -1
- package/dist/base64.js.map +1 -1
- package/dist/bun/mod.d.ts +0 -2
- package/dist/bun/mod.d.ts.map +1 -1
- package/dist/bun/mod.js +0 -6
- package/dist/bun/mod.js.map +1 -1
- package/dist/cuid/cuid.browser.d.ts.map +1 -1
- package/dist/cuid/cuid.browser.js +0 -1
- package/dist/cuid/cuid.browser.js.map +1 -1
- package/dist/cuid/cuid.node.d.ts.map +1 -1
- package/dist/cuid/cuid.node.js +0 -1
- package/dist/cuid/cuid.node.js.map +1 -1
- package/dist/effect/Effect.d.ts.map +1 -1
- package/dist/effect/Effect.js +3 -3
- package/dist/effect/Effect.js.map +1 -1
- package/dist/effect/Scheduler.d.ts.map +1 -1
- package/dist/effect/Scheduler.js +0 -1
- package/dist/effect/Scheduler.js.map +1 -1
- package/dist/effect/Schema/debug-diff.test.js +1 -1
- package/dist/effect/Schema/index.d.ts +2 -2
- package/dist/effect/Schema/index.js +3 -3
- package/dist/effect/Subscribable.d.ts.map +1 -1
- package/dist/effect/Subscribable.js +2 -3
- package/dist/effect/Subscribable.js.map +1 -1
- package/dist/effect/WebChannel/WebChannel.d.ts +3 -3
- package/dist/effect/WebChannel/WebChannel.js +5 -5
- package/dist/effect/WebChannel/WebChannel.test.js +1 -1
- package/dist/effect/WebChannel/broadcastChannelWithAck.d.ts +2 -2
- package/dist/effect/WebChannel/broadcastChannelWithAck.js +2 -2
- package/dist/effect/WebChannel/mod.d.ts +3 -3
- package/dist/effect/WebChannel/mod.d.ts.map +1 -1
- package/dist/effect/WebChannel/mod.js +3 -3
- package/dist/effect/WebChannel/mod.js.map +1 -1
- package/dist/effect/WebLock.js.map +1 -1
- package/dist/effect/WebSocket.test.js +1 -1
- package/dist/effect/index.d.ts +22 -23
- package/dist/effect/index.d.ts.map +1 -1
- package/dist/effect/index.js +25 -26
- package/dist/effect/index.js.map +1 -1
- package/dist/env.js +1 -1
- package/dist/fast-deep-equal.d.ts.map +1 -1
- package/dist/fast-deep-equal.js +0 -1
- package/dist/fast-deep-equal.js.map +1 -1
- package/dist/global.d.ts +3 -0
- package/dist/global.d.ts.map +1 -1
- package/dist/global.js.map +1 -1
- package/dist/index.d.ts +18 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -16
- package/dist/index.js.map +1 -1
- package/dist/misc.d.ts.map +1 -1
- package/dist/misc.js +0 -1
- package/dist/misc.js.map +1 -1
- package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/ChildProcessRunner.test.js +2 -2
- package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/schema.d.ts +2 -2
- package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/serializedWorker.js +3 -3
- package/dist/node/mod.d.ts +4 -4
- package/dist/node/mod.d.ts.map +1 -1
- package/dist/node/mod.js +5 -5
- package/dist/node/mod.js.map +1 -1
- package/dist/object/index.d.ts +3 -2
- package/dist/object/index.d.ts.map +1 -1
- package/dist/object/index.js +3 -2
- package/dist/object/index.js.map +1 -1
- package/dist/object/stringify-object.d.ts +9 -0
- package/dist/object/stringify-object.d.ts.map +1 -0
- package/dist/object/stringify-object.js +27 -0
- package/dist/object/stringify-object.js.map +1 -0
- package/dist/object/stringify-object.test.d.ts +2 -0
- package/dist/object/stringify-object.test.d.ts.map +1 -0
- package/dist/object/stringify-object.test.js +38 -0
- package/dist/object/stringify-object.test.js.map +1 -0
- package/package.json +17 -15
- package/src/NoopTracer.ts +0 -1
- package/src/base64.ts +0 -1
- package/src/bun/mod.ts +0 -8
- package/src/cuid/cuid.browser.ts +0 -1
- package/src/cuid/cuid.node.ts +0 -1
- package/src/effect/Effect.ts +6 -3
- package/src/effect/Scheduler.ts +0 -1
- package/src/effect/Schema/debug-diff.test.ts +2 -2
- package/src/effect/Schema/index.ts +3 -3
- package/src/effect/Subscribable.ts +6 -5
- package/src/effect/WebChannel/WebChannel.test.ts +1 -1
- package/src/effect/WebChannel/WebChannel.ts +5 -5
- package/src/effect/WebChannel/broadcastChannelWithAck.ts +3 -3
- package/src/effect/WebChannel/mod.ts +3 -3
- package/src/effect/WebLock.ts +1 -1
- package/src/effect/WebSocket.test.ts +1 -1
- package/src/effect/index.ts +104 -110
- package/src/env.ts +1 -1
- package/src/fast-deep-equal.ts +0 -2
- package/src/global.ts +4 -0
- package/src/index.ts +21 -16
- package/src/misc.ts +0 -1
- package/src/node/ChildProcessRunner/ChildProcessRunnerTest/ChildProcessRunner.test.ts +3 -3
- package/src/node/ChildProcessRunner/ChildProcessRunnerTest/serializedWorker.ts +3 -3
- package/src/node/mod.ts +6 -6
- package/src/object/index.ts +3 -2
- package/src/object/stringify-object.test.ts +44 -0
- package/src/object/stringify-object.ts +27 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livestore/utils",
|
|
3
|
-
"version": "0.3.2-dev.
|
|
3
|
+
"version": "0.3.2-dev.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"./dist/global.js"
|
|
@@ -8,35 +8,37 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"bun": "./src/index.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
13
|
},
|
|
14
14
|
"./cuid": {
|
|
15
15
|
"types": "./dist/cuid/cuid.node.d.ts",
|
|
16
|
-
"node": "./dist/cuid/cuid.node.js",
|
|
17
16
|
"browser": "./dist/cuid/cuid.browser.js",
|
|
18
|
-
"
|
|
19
|
-
"bun": "./src/cuid/cuid.node.ts"
|
|
17
|
+
"node": "./dist/cuid/cuid.node.js",
|
|
18
|
+
"bun": "./src/cuid/cuid.node.ts",
|
|
19
|
+
"react-native": "./dist/cuid/cuid.browser.js"
|
|
20
20
|
},
|
|
21
21
|
"./nanoid": {
|
|
22
22
|
"types": "./dist/nanoid/index.d.ts",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
23
|
+
"bun": "./src/nanoid/index.ts",
|
|
24
|
+
"default": "./dist/nanoid/index.js"
|
|
25
25
|
},
|
|
26
26
|
"./effect": {
|
|
27
27
|
"types": "./dist/effect/index.d.ts",
|
|
28
|
-
"
|
|
29
|
-
"bun": "./src/effect/index.ts"
|
|
28
|
+
"node": "./src/effect/index.ts",
|
|
29
|
+
"bun": "./src/effect/index.ts",
|
|
30
|
+
"default": "./dist/effect/index.js"
|
|
30
31
|
},
|
|
31
32
|
"./node": {
|
|
32
33
|
"types": "./dist/node/mod.d.ts",
|
|
33
|
-
"
|
|
34
|
-
"bun": "./src/node/mod.ts"
|
|
34
|
+
"node": "./src/node/mod.ts",
|
|
35
|
+
"bun": "./src/node/mod.ts",
|
|
36
|
+
"default": "./dist/node/mod.js"
|
|
35
37
|
},
|
|
36
38
|
"./bun": {
|
|
37
39
|
"types": "./dist/bun/mod.d.ts",
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
+
"bun": "./src/bun/mod.ts",
|
|
41
|
+
"default": "./dist/bun/mod.js"
|
|
40
42
|
}
|
|
41
43
|
},
|
|
42
44
|
"types": "./dist/index.d.ts",
|
|
@@ -84,7 +86,7 @@
|
|
|
84
86
|
"@opentelemetry/resources": "^2.0.0",
|
|
85
87
|
"@types/bun": "^1.2.5",
|
|
86
88
|
"@types/jsdom": "^21.1.7",
|
|
87
|
-
"@types/node": "
|
|
89
|
+
"@types/node": "22.15.33",
|
|
88
90
|
"@types/web": "^0.0.203",
|
|
89
91
|
"effect": "^3.16.12",
|
|
90
92
|
"jsdom": "^26.0.0",
|
package/src/NoopTracer.ts
CHANGED
package/src/base64.ts
CHANGED
|
@@ -113,7 +113,6 @@ export const decode = (b64: string): Uint8Array => {
|
|
|
113
113
|
const size = binString.length
|
|
114
114
|
const bytes = new Uint8Array(size)
|
|
115
115
|
for (let i = 0; i < size; i++) {
|
|
116
|
-
// eslint-disable-next-line unicorn/prefer-code-point
|
|
117
116
|
bytes[i] = binString.charCodeAt(i)
|
|
118
117
|
}
|
|
119
118
|
return bytes
|
package/src/bun/mod.ts
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import { $ } from 'bun'
|
|
2
|
-
import { Effect } from 'effect'
|
|
3
|
-
|
|
4
1
|
export * as PlatformBun from '@effect/platform-bun'
|
|
5
2
|
|
|
6
3
|
// TODO remove in favour of other `cmd` implementation
|
|
7
|
-
export const cmd = (_: string) =>
|
|
8
|
-
Effect.promise(() => {
|
|
9
|
-
console.log(`Running command: ${_}`)
|
|
10
|
-
return $`${{ raw: _ }}`
|
|
11
|
-
})
|
|
12
4
|
|
|
13
5
|
export { $ } from 'bun'
|
package/src/cuid/cuid.browser.ts
CHANGED
package/src/cuid/cuid.node.ts
CHANGED
package/src/effect/Effect.ts
CHANGED
|
@@ -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.
|
|
9
|
-
import { UnknownError } from './Error.
|
|
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[]) =>
|
|
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[]) =>
|
package/src/effect/Scheduler.ts
CHANGED
|
@@ -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.
|
|
5
|
-
import { debugDiff } from './debug-diff.
|
|
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.
|
|
7
|
+
import { shouldNeverHappen } from '../../index.ts'
|
|
8
8
|
|
|
9
9
|
export * from 'effect/Schema'
|
|
10
|
-
export * from './debug-diff.
|
|
11
|
-
export * from './msgpack.
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
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.
|
|
5
|
+
import * as WebChannel from './WebChannel.ts'
|
|
6
6
|
|
|
7
7
|
Vitest.describe('WebChannel', () => {
|
|
8
8
|
Vitest.describe('windowChannel', () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
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.
|
|
5
|
-
import * as Effect from '../Effect.
|
|
6
|
-
import * as Schema from '../Schema/index.
|
|
7
|
-
import * as Stream from '../Stream.
|
|
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,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
WebChannelPing,
|
|
16
16
|
WebChannelPong,
|
|
17
17
|
WebChannelSymbol,
|
|
18
|
-
} from './common.
|
|
18
|
+
} from './common.ts'
|
|
19
19
|
|
|
20
20
|
export const shutdown = <MsgListen, MsgSend>(webChannel: WebChannel<MsgListen, MsgSend>): Effect.Effect<void> =>
|
|
21
21
|
Deferred.done(webChannel.closedDeferred, Exit.void)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Deferred, Exit, Predicate, Queue, Schema, Scope, Stream } from 'effect'
|
|
2
2
|
|
|
3
|
-
import * as Effect from '../Effect.
|
|
4
|
-
import type { InputSchema, WebChannel } from './common.
|
|
5
|
-
import { listenToDebugPing, mapSchema, WebChannelSymbol } from './common.
|
|
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 './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
1
|
+
export * from './broadcastChannelWithAck.ts'
|
|
2
|
+
export * from './common.ts'
|
|
3
|
+
export * from './WebChannel.ts'
|
package/src/effect/WebLock.ts
CHANGED
|
@@ -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.
|
|
5
|
+
import { makeWebSocket } from './WebSocket.ts'
|
|
6
6
|
|
|
7
7
|
Vitest.describe('WebSocket', () => {
|
|
8
8
|
Vitest.scopedLive(
|
package/src/effect/index.ts
CHANGED
|
@@ -1,137 +1,131 @@
|
|
|
1
|
-
import '../global.
|
|
1
|
+
import '../global.ts'
|
|
2
2
|
|
|
3
|
+
export * as OtelTracer from '@effect/opentelemetry/Tracer'
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
23
|
-
|
|
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
|
-
|
|
80
|
+
Match,
|
|
81
|
+
Metric,
|
|
82
|
+
MetricState,
|
|
42
83
|
MutableHashMap,
|
|
43
|
-
|
|
84
|
+
MutableHashSet,
|
|
44
85
|
Option,
|
|
45
|
-
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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.
|
|
133
|
-
export *
|
|
134
|
-
export * as
|
|
135
|
-
export * from './
|
|
136
|
-
export * as ServiceContext from './ServiceContext.
|
|
137
|
-
export * as WebLock from './WebLock.
|
|
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
package/src/fast-deep-equal.ts
CHANGED
package/src/global.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export { default as prettyBytes } from 'pretty-bytes'
|
|
2
|
-
export * as base64 from './base64.
|
|
3
|
-
export * from './browser.
|
|
4
|
-
export * from './Deferred.
|
|
5
|
-
export * from './env.
|
|
6
|
-
export * from './fast-deep-equal.
|
|
7
|
-
export * from './guards.
|
|
8
|
-
export * from './misc.
|
|
9
|
-
export * from './NoopTracer.
|
|
10
|
-
export * from './object/index.
|
|
11
|
-
export * from './promise.
|
|
12
|
-
export * from './set.
|
|
13
|
-
export * from './string.
|
|
14
|
-
export * from './time.
|
|
2
|
+
export * as base64 from './base64.ts'
|
|
3
|
+
export * from './browser.ts'
|
|
4
|
+
export * from './Deferred.ts'
|
|
5
|
+
export * from './env.ts'
|
|
6
|
+
export * from './fast-deep-equal.ts'
|
|
7
|
+
export * from './guards.ts'
|
|
8
|
+
export * from './misc.ts'
|
|
9
|
+
export * from './NoopTracer.ts'
|
|
10
|
+
export * from './object/index.ts'
|
|
11
|
+
export * from './promise.ts'
|
|
12
|
+
export * from './set.ts'
|
|
13
|
+
export * from './string.ts'
|
|
14
|
+
export * from './time.ts'
|
|
15
15
|
|
|
16
16
|
import type * as otel from '@opentelemetry/api'
|
|
17
17
|
import type { Types } from 'effect'
|
|
18
18
|
|
|
19
|
-
import { objectToString } from './misc.
|
|
19
|
+
import { objectToString } from './misc.ts'
|
|
20
20
|
|
|
21
21
|
export type Prettify<T> = T extends infer U ? { [K in keyof U]: Prettify<U[K]> } : never
|
|
22
22
|
|
|
@@ -73,6 +73,11 @@ export const recRemoveUndefinedValues = (val: any): void => {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Replace non-alphanumeric characters with a dash.
|
|
78
|
+
*/
|
|
79
|
+
export const sluggify = (str: string, separator = '-') => str.replace(/[^a-zA-Z0-9]/g, separator)
|
|
80
|
+
|
|
76
81
|
export const prop =
|
|
77
82
|
<T extends {}, K extends keyof T>(key: K) =>
|
|
78
83
|
(obj: T): T[K] =>
|
|
@@ -86,7 +91,7 @@ export const isReadonlyArray = <I, T>(value: ReadonlyArray<I> | T): value is Rea
|
|
|
86
91
|
* Use this to make assertion at end of if-else chain that all members of a
|
|
87
92
|
* union have been accounted for.
|
|
88
93
|
*/
|
|
89
|
-
|
|
94
|
+
|
|
90
95
|
export function casesHandled(unexpectedCase: never): never {
|
|
91
96
|
// biome-ignore lint/suspicious/noDebugger: debugging
|
|
92
97
|
debugger
|
|
@@ -228,4 +233,4 @@ export const isPromise = (value: any): value is Promise<unknown> => typeof value
|
|
|
228
233
|
|
|
229
234
|
export const isIterable = <T>(value: any): value is Iterable<T> => typeof value?.[Symbol.iterator] === 'function'
|
|
230
235
|
|
|
231
|
-
export { objectToString as errorToString } from './misc.
|
|
236
|
+
export { objectToString as errorToString } from './misc.ts'
|
package/src/misc.ts
CHANGED
|
@@ -37,7 +37,6 @@ export const tryAsFunctionAndNew = <TArg, TResult>(
|
|
|
37
37
|
try {
|
|
38
38
|
// @ts-expect-error try out as constructor
|
|
39
39
|
return new fnOrConstructor(arg)
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
41
40
|
} catch (_e) {
|
|
42
41
|
// @ts-expect-error try out as function
|
|
43
42
|
return fnOrConstructor(arg)
|
|
@@ -5,9 +5,9 @@ import * as EffectWorker from '@effect/platform/Worker'
|
|
|
5
5
|
import { assert, describe, it } from '@effect/vitest'
|
|
6
6
|
import { Chunk, Effect, Stream } from 'effect'
|
|
7
7
|
|
|
8
|
-
import * as ChildProcessWorker from '../ChildProcessWorker.
|
|
9
|
-
import type { WorkerMessage } from './schema.
|
|
10
|
-
import { GetPersonById, GetUserById, InitialMessage, Person, User } from './schema.
|
|
8
|
+
import * as ChildProcessWorker from '../ChildProcessWorker.ts'
|
|
9
|
+
import type { WorkerMessage } from './schema.ts'
|
|
10
|
+
import { GetPersonById, GetUserById, InitialMessage, Person, User } from './schema.ts'
|
|
11
11
|
|
|
12
12
|
const WorkerLive = ChildProcessWorker.layer(() =>
|
|
13
13
|
ChildProcess.fork(
|
|
@@ -2,9 +2,9 @@ import * as Runner from '@effect/platform/WorkerRunner'
|
|
|
2
2
|
import { Context, Effect, Layer, Option, Stream } from 'effect'
|
|
3
3
|
|
|
4
4
|
// import { NodeRuntime, NodeWorkerRunner } from '@effect/platform-node'
|
|
5
|
-
import { PlatformNode } from '../../mod.
|
|
6
|
-
import * as ChildProcessRunner from '../ChildProcessRunner.
|
|
7
|
-
import { Person, User, WorkerMessage } from './schema.
|
|
5
|
+
import { PlatformNode } from '../../mod.ts'
|
|
6
|
+
import * as ChildProcessRunner from '../ChildProcessRunner.ts'
|
|
7
|
+
import { Person, User, WorkerMessage } from './schema.ts'
|
|
8
8
|
|
|
9
9
|
interface Name {
|
|
10
10
|
readonly _: unique symbol
|