@effect/platform 0.12.1 → 0.13.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.
- package/internal/http/serverResponse.js +16 -4
- package/internal/http/serverResponse.js.map +1 -1
- package/mjs/internal/http/serverResponse.mjs +14 -3
- package/mjs/internal/http/serverResponse.mjs.map +1 -1
- package/package.json +1 -1
- package/src/internal/http/serverResponse.ts +15 -3
- package/Console.d.ts +0 -144
- package/Console.d.ts.map +0 -1
- package/Console.js +0 -130
- package/Console.js.map +0 -1
- package/internal/console.d.ts +0 -8
- package/internal/console.d.ts.map +0 -1
- package/internal/console.js +0 -160
- package/internal/console.js.map +0 -1
- package/mjs/Console.mjs +0 -102
- package/mjs/Console.mjs.map +0 -1
- package/mjs/internal/console.mjs +0 -132
- package/mjs/internal/console.mjs.map +0 -1
- package/src/Console.ts +0 -165
- package/src/internal/console.ts +0 -183
package/src/internal/console.ts
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { Tag } from "@effect/data/Context"
|
|
2
|
-
import * as Effect from "@effect/io/Effect"
|
|
3
|
-
import * as Layer from "@effect/io/Layer"
|
|
4
|
-
import type { Console as Console_ } from "@effect/platform/Console"
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @since 1.0.0
|
|
8
|
-
* @category tag
|
|
9
|
-
*/
|
|
10
|
-
export const Console = Tag<Console_>("@effect/platform/Console")
|
|
11
|
-
|
|
12
|
-
/** @internal */
|
|
13
|
-
const consoleImpl = Console.of({
|
|
14
|
-
assert(condition, ...args) {
|
|
15
|
-
return Effect.sync(() => {
|
|
16
|
-
console.assert(condition, ...args)
|
|
17
|
-
})
|
|
18
|
-
},
|
|
19
|
-
clear() {
|
|
20
|
-
return Effect.sync(() => {
|
|
21
|
-
console.clear()
|
|
22
|
-
})
|
|
23
|
-
},
|
|
24
|
-
count(label) {
|
|
25
|
-
return Effect.sync(() => {
|
|
26
|
-
console.count(label)
|
|
27
|
-
})
|
|
28
|
-
},
|
|
29
|
-
countReset(label) {
|
|
30
|
-
return Effect.sync(() => {
|
|
31
|
-
console.countReset(label)
|
|
32
|
-
})
|
|
33
|
-
},
|
|
34
|
-
debug(...args) {
|
|
35
|
-
return Effect.sync(() => {
|
|
36
|
-
console.debug(...args)
|
|
37
|
-
})
|
|
38
|
-
},
|
|
39
|
-
dir(...args) {
|
|
40
|
-
return Effect.sync(() => {
|
|
41
|
-
console.dir(...args)
|
|
42
|
-
})
|
|
43
|
-
},
|
|
44
|
-
dirxml(...args) {
|
|
45
|
-
return Effect.sync(() => {
|
|
46
|
-
console.dirxml(...args)
|
|
47
|
-
})
|
|
48
|
-
},
|
|
49
|
-
error(...args) {
|
|
50
|
-
return Effect.sync(() => {
|
|
51
|
-
console.error(...args)
|
|
52
|
-
})
|
|
53
|
-
},
|
|
54
|
-
group(options) {
|
|
55
|
-
return Effect.acquireRelease(
|
|
56
|
-
options?.collapsed ?
|
|
57
|
-
Effect.sync(() => console.groupCollapsed(options?.label)) :
|
|
58
|
-
Effect.sync(() => console.group(options?.label)),
|
|
59
|
-
() => Effect.sync(() => console.groupEnd())
|
|
60
|
-
)
|
|
61
|
-
},
|
|
62
|
-
info(...args) {
|
|
63
|
-
return Effect.sync(() => {
|
|
64
|
-
console.info(...args)
|
|
65
|
-
})
|
|
66
|
-
},
|
|
67
|
-
log(...args) {
|
|
68
|
-
return Effect.sync(() => {
|
|
69
|
-
console.log(...args)
|
|
70
|
-
})
|
|
71
|
-
},
|
|
72
|
-
table(tabularData, properties) {
|
|
73
|
-
return Effect.sync(() => {
|
|
74
|
-
console.table(tabularData, properties)
|
|
75
|
-
})
|
|
76
|
-
},
|
|
77
|
-
time(label) {
|
|
78
|
-
return Effect.acquireRelease(
|
|
79
|
-
Effect.sync(() => console.time(label)),
|
|
80
|
-
() => Effect.sync(() => console.timeEnd(label))
|
|
81
|
-
)
|
|
82
|
-
},
|
|
83
|
-
timeLog(label, ...args) {
|
|
84
|
-
return Effect.sync(() => {
|
|
85
|
-
console.timeLog(label, ...args)
|
|
86
|
-
})
|
|
87
|
-
},
|
|
88
|
-
trace(...args) {
|
|
89
|
-
return Effect.sync(() => {
|
|
90
|
-
console.trace(...args)
|
|
91
|
-
})
|
|
92
|
-
},
|
|
93
|
-
warn(...args) {
|
|
94
|
-
return Effect.sync(() => {
|
|
95
|
-
console.warn(...args)
|
|
96
|
-
})
|
|
97
|
-
},
|
|
98
|
-
withGroup(options) {
|
|
99
|
-
return (self) =>
|
|
100
|
-
Effect.acquireUseRelease(
|
|
101
|
-
options?.collapsed ?
|
|
102
|
-
Effect.sync(() => console.groupCollapsed(options?.label)) :
|
|
103
|
-
Effect.sync(() => console.group(options?.label)),
|
|
104
|
-
() => self,
|
|
105
|
-
() => Effect.sync(() => console.groupEnd())
|
|
106
|
-
)
|
|
107
|
-
},
|
|
108
|
-
withTime(label) {
|
|
109
|
-
return (self) =>
|
|
110
|
-
Effect.acquireUseRelease(
|
|
111
|
-
Effect.sync(() => console.time(label)),
|
|
112
|
-
() => self,
|
|
113
|
-
() => Effect.sync(() => console.timeEnd(label))
|
|
114
|
-
)
|
|
115
|
-
}
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
/** @internal */
|
|
119
|
-
export const layer = Layer.succeed(Console, consoleImpl)
|
|
120
|
-
|
|
121
|
-
/** @internal */
|
|
122
|
-
export const assert = (condition: boolean, ...args: ReadonlyArray<any>) =>
|
|
123
|
-
Effect.flatMap(Console, (_) => _.assert(condition, ...args))
|
|
124
|
-
|
|
125
|
-
/** @internal */
|
|
126
|
-
export const clear = () => Effect.flatMap(Console, (_) => _.clear())
|
|
127
|
-
|
|
128
|
-
/** @internal */
|
|
129
|
-
export const count = (label?: string) => Effect.flatMap(Console, (_) => _.count(label))
|
|
130
|
-
|
|
131
|
-
/** @internal */
|
|
132
|
-
export const countReset = (label?: string) => Effect.flatMap(Console, (_) => _.countReset(label))
|
|
133
|
-
|
|
134
|
-
/** @internal */
|
|
135
|
-
export const debug = (...args: ReadonlyArray<any>) => Effect.flatMap(Console, (_) => _.debug(...args))
|
|
136
|
-
|
|
137
|
-
/** @internal */
|
|
138
|
-
export const dir = (...args: ReadonlyArray<any>) => Effect.flatMap(Console, (_) => _.dir(...args))
|
|
139
|
-
|
|
140
|
-
/** @internal */
|
|
141
|
-
export const dirxml = (...args: ReadonlyArray<any>) => Effect.flatMap(Console, (_) => _.dirxml(...args))
|
|
142
|
-
|
|
143
|
-
/** @internal */
|
|
144
|
-
export const error = (...args: ReadonlyArray<any>) => Effect.flatMap(Console, (_) => _.error(...args))
|
|
145
|
-
|
|
146
|
-
/** @internal */
|
|
147
|
-
export const group = (options?: { label?: string; collapsed?: boolean }) =>
|
|
148
|
-
Effect.flatMap(Console, (_) => _.group(options))
|
|
149
|
-
|
|
150
|
-
/** @internal */
|
|
151
|
-
export const info = (...args: ReadonlyArray<any>) => Effect.flatMap(Console, (_) => _.info(...args))
|
|
152
|
-
|
|
153
|
-
/** @internal */
|
|
154
|
-
export const log = (...args: ReadonlyArray<any>) => Effect.flatMap(Console, (_) => _.log(...args))
|
|
155
|
-
|
|
156
|
-
/** @internal */
|
|
157
|
-
export const table = (tabularData: any, properties?: ReadonlyArray<string>) =>
|
|
158
|
-
Effect.flatMap(Console, (_) => _.table(tabularData, properties))
|
|
159
|
-
|
|
160
|
-
/** @internal */
|
|
161
|
-
export const time = (label?: string) => Effect.flatMap(Console, (_) => _.time(label))
|
|
162
|
-
|
|
163
|
-
/** @internal */
|
|
164
|
-
export const timeLog = (label?: string, ...args: ReadonlyArray<any>) =>
|
|
165
|
-
Effect.flatMap(Console, (_) => _.timeLog(label, ...args))
|
|
166
|
-
|
|
167
|
-
/** @internal */
|
|
168
|
-
export const trace = (...args: ReadonlyArray<any>) => Effect.flatMap(Console, (_) => _.trace(...args))
|
|
169
|
-
|
|
170
|
-
/** @internal */
|
|
171
|
-
export const warn = (...args: ReadonlyArray<any>) => Effect.flatMap(Console, (_) => _.warn(...args))
|
|
172
|
-
|
|
173
|
-
/** @internal */
|
|
174
|
-
export const withGroup = (options?: { label?: string; collapsed?: boolean }) =>
|
|
175
|
-
<R, E, A>(
|
|
176
|
-
self: Effect.Effect<R, E, A>
|
|
177
|
-
) => Effect.flatMap(Console, (_) => _.withGroup(options)(self))
|
|
178
|
-
|
|
179
|
-
/** @internal */
|
|
180
|
-
export const withTime = (label?: string) =>
|
|
181
|
-
<R, E, A>(
|
|
182
|
-
self: Effect.Effect<R, E, A>
|
|
183
|
-
) => Effect.flatMap(Console, (_) => _.withTime(label)(self))
|