effect 3.5.3 → 3.5.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.
@@ -1,4 +1,4 @@
1
- let moduleVersion = "3.5.3";
1
+ let moduleVersion = "3.5.5";
2
2
  export const getCurrentVersion = () => moduleVersion;
3
3
  export const setCurrentVersion = version => {
4
4
  moduleVersion = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "effect",
3
- "version": "3.5.3",
3
+ "version": "3.5.5",
4
4
  "description": "The missing standard library for TypeScript, for writing production-grade software.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/Channel.ts CHANGED
@@ -186,6 +186,20 @@ export interface ChannelException<out E> {
186
186
  readonly error: E
187
187
  }
188
188
 
189
+ /**
190
+ * @since 3.5.4
191
+ * @category refinements
192
+ */
193
+ export const isChannel: (u: unknown) => u is Channel<
194
+ unknown,
195
+ unknown,
196
+ unknown,
197
+ unknown,
198
+ unknown,
199
+ unknown,
200
+ unknown
201
+ > = core.isChannel
202
+
189
203
  /**
190
204
  * @since 2.0.0
191
205
  * @category constructors
package/src/Predicate.ts CHANGED
@@ -750,6 +750,8 @@ export const not = <A>(self: Predicate<A>): Predicate<A> => (a) => !self(a)
750
750
  * @since 2.0.0
751
751
  */
752
752
  export const or: {
753
+ <A, C extends A>(that: Refinement<A, C>): <B extends A>(self: Refinement<A, B>) => Refinement<A, B | C>
754
+ <A, B extends A, C extends A>(self: Refinement<A, B>, that: Refinement<A, C>): Refinement<A, B | C>
753
755
  <A>(that: Predicate<A>): (self: Predicate<A>) => Predicate<A>
754
756
  <A>(self: Predicate<A>, that: Predicate<A>): Predicate<A>
755
757
  } = dual(2, <A>(self: Predicate<A>, that: Predicate<A>): Predicate<A> => (a) => self(a) || that(a))
@@ -990,6 +990,9 @@ const renderErrorCause = (cause: PrettyError, prefix: string) => {
990
990
  for (let i = 1, len = lines.length; i < len; i++) {
991
991
  stack += `\n${prefix}${lines[i]}`
992
992
  }
993
+ if (cause.cause) {
994
+ stack += ` {\n${renderErrorCause(cause.cause as PrettyError, `${prefix} `)}\n${prefix}}`
995
+ }
993
996
  return stack
994
997
  }
995
998
 
@@ -42,6 +42,8 @@ const performanceNowNanos = (function() {
42
42
  const bigint1e6 = BigInt(1_000_000)
43
43
  if (typeof performance === "undefined") {
44
44
  return () => BigInt(Date.now()) * bigint1e6
45
+ } else if (typeof performance.timeOrigin === "number" && performance.timeOrigin === 0) {
46
+ return () => BigInt(Math.round(performance.now() * 1_000_000))
45
47
  }
46
48
  const origin = (BigInt(Date.now()) * bigint1e6) - BigInt(Math.round(performance.now() * 1_000_000))
47
49
  return () => origin + BigInt(Math.round(performance.now() * 1_000_000))
@@ -8343,4 +8343,4 @@ export const fromEventListener = <A = unknown>(
8343
8343
  }
8344
8344
  target.addEventListener(type, cb as any, options)
8345
8345
  return Effect.sync(() => target.removeEventListener(type, cb, options))
8346
- })
8346
+ }, "unbounded")
@@ -1,4 +1,4 @@
1
- let moduleVersion = "3.5.3"
1
+ let moduleVersion = "3.5.5"
2
2
 
3
3
  export const getCurrentVersion = () => moduleVersion
4
4