Skip to content

Commit

Permalink
Revert deno support to Inspectable (#3727) (#3740)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart authored Oct 7, 2024
1 parent b06f17d commit 3b2ad1d
Show file tree
Hide file tree
Showing 36 changed files with 30 additions and 175 deletions.
8 changes: 8 additions & 0 deletions .changeset/neat-deers-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@effect/platform": patch
"effect": patch
"@effect/schema": patch
---

revert deno Inspectable changes

5 changes: 1 addition & 4 deletions packages/effect/src/BigDecimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import * as Equal from "./Equal.js"
import * as equivalence from "./Equivalence.js"
import { dual, pipe } from "./Function.js"
import * as Hash from "./Hash.js"
import { DenoInspectSymbol, type Inspectable, NodeInspectSymbol } from "./Inspectable.js"
import { type Inspectable, NodeInspectSymbol } from "./Inspectable.js"
import * as Option from "./Option.js"
import * as order from "./Order.js"
import type { Ordering } from "./Ordering.js"
Expand Down Expand Up @@ -74,9 +74,6 @@ const BigDecimalProto: Omit<BigDecimal, "value" | "scale" | "normalized"> = {
scale: this.scale
}
},
[DenoInspectSymbol](this: BigDecimal) {
return this.toJSON()
},
[NodeInspectSymbol](this: BigDecimal) {
return this.toJSON()
},
Expand Down
5 changes: 1 addition & 4 deletions packages/effect/src/Chunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as Equivalence from "./Equivalence.js"
import { dual, identity, pipe } from "./Function.js"
import * as Hash from "./Hash.js"
import type { TypeLambda } from "./HKT.js"
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import type { NonEmptyIterable } from "./NonEmptyIterable.js"
import type { Option } from "./Option.js"
import * as O from "./Option.js"
Expand Down Expand Up @@ -135,9 +135,6 @@ const ChunkProto: Omit<Chunk<unknown>, "backing" | "depth" | "left" | "length" |
values: toReadonlyArray(this).map(toJSON)
}
},
[DenoInspectSymbol]<A>(this: Chunk<A>) {
return this.toJSON()
},
[NodeInspectSymbol]<A>(this: Chunk<A>) {
return this.toJSON()
},
Expand Down
5 changes: 1 addition & 4 deletions packages/effect/src/Cron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as Equal from "./Equal.js"
import * as equivalence from "./Equivalence.js"
import { dual, pipe } from "./Function.js"
import * as Hash from "./Hash.js"
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol } from "./Inspectable.js"
import { format, type Inspectable, NodeInspectSymbol } from "./Inspectable.js"
import * as N from "./Number.js"
import { type Pipeable, pipeArguments } from "./Pipeable.js"
import { hasProperty } from "./Predicate.js"
Expand Down Expand Up @@ -67,9 +67,6 @@ const CronProto: Omit<Cron, "minutes" | "hours" | "days" | "months" | "weekdays"
weekdays: Arr.fromIterable(this.weekdays)
}
},
[DenoInspectSymbol](this: Cron) {
return this.toJSON()
},
[NodeInspectSymbol](this: Cron) {
return this.toJSON()
},
Expand Down
6 changes: 0 additions & 6 deletions packages/effect/src/DateTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ const Proto = {
pipe() {
return pipeArguments(this, arguments)
},
[Inspectable.DenoInspectSymbol](this: DateTime) {
return this.toString()
},
[Inspectable.NodeInspectSymbol](this: DateTime) {
return this.toString()
},
Expand Down Expand Up @@ -276,9 +273,6 @@ const ProtoZoned = {

const ProtoTimeZone = {
[TimeZoneTypeId]: TimeZoneTypeId,
[Inspectable.DenoInspectSymbol](this: TimeZone) {
return this.toString()
},
[Inspectable.NodeInspectSymbol](this: TimeZone) {
return this.toString()
}
Expand Down
5 changes: 1 addition & 4 deletions packages/effect/src/Duration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type * as equivalence from "./Equivalence.js"
import { dual } from "./Function.js"
import * as Hash from "./Hash.js"
import type { Inspectable } from "./Inspectable.js"
import { DenoInspectSymbol, NodeInspectSymbol } from "./Inspectable.js"
import { NodeInspectSymbol } from "./Inspectable.js"
import * as Option from "./Option.js"
import * as order from "./Order.js"
import type { Pipeable } from "./Pipeable.js"
Expand Down Expand Up @@ -160,9 +160,6 @@ const DurationProto: Omit<Duration, "value"> = {
return { _id: "Duration", _tag: "Infinity" }
}
},
[DenoInspectSymbol]() {
return this.toJSON()
},
[NodeInspectSymbol]() {
return this.toJSON()
},
Expand Down
3 changes: 0 additions & 3 deletions packages/effect/src/FiberHandle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ const Proto = {
state: this.state
}
},
[Inspectable.DenoInspectSymbol](this: FiberHandle) {
return this.toJSON()
},
[Inspectable.NodeInspectSymbol](this: FiberHandle) {
return this.toJSON()
},
Expand Down
3 changes: 0 additions & 3 deletions packages/effect/src/FiberMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ const Proto = {
state: this.state
}
},
[Inspectable.DenoInspectSymbol](this: FiberMap<unknown>) {
return this.toJSON()
},
[Inspectable.NodeInspectSymbol](this: FiberMap<unknown>) {
return this.toJSON()
},
Expand Down
3 changes: 0 additions & 3 deletions packages/effect/src/FiberSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ const Proto = {
state: this.state
}
},
[Inspectable.DenoInspectSymbol](this: FiberSet<unknown, unknown>) {
return this.toJSON()
},
[Inspectable.NodeInspectSymbol](this: FiberSet<unknown, unknown>) {
return this.toJSON()
},
Expand Down
22 changes: 0 additions & 22 deletions packages/effect/src/Inspectable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ export const NodeInspectSymbol = Symbol.for("nodejs.util.inspect.custom")
*/
export type NodeInspectSymbol = typeof NodeInspectSymbol

/**
* @since 3.9.0
* @category symbols
*/
export const DenoInspectSymbol = Symbol.for("Deno.customInspect")

/**
* @since 3.9.0
* @category symbols
*/
export type DenoInspectSymbol = typeof DenoInspectSymbol

/**
* @since 2.0.0
* @category models
Expand All @@ -36,7 +24,6 @@ export interface Inspectable {
toString(): string
toJSON(): unknown
[NodeInspectSymbol](): unknown
[DenoInspectSymbol](): unknown
}

/**
Expand Down Expand Up @@ -69,9 +56,6 @@ export const BaseProto: Inspectable = {
[NodeInspectSymbol]() {
return this.toJSON()
},
[DenoInspectSymbol]() {
return this.toJSON()
},
toString() {
return format(this.toJSON())
}
Expand All @@ -91,12 +75,6 @@ export abstract class Class {
[NodeInspectSymbol]() {
return this.toJSON()
}
/**
* @since 3.9.0
*/
[DenoInspectSymbol]() {
return this.toJSON()
}
/**
* @since 2.0.0
*/
Expand Down
8 changes: 1 addition & 7 deletions packages/effect/src/List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import * as Equal from "./Equal.js"
import * as Equivalence from "./Equivalence.js"
import { dual, identity, unsafeCoerce } from "./Function.js"
import * as Hash from "./Hash.js"
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import type { nonEmpty, NonEmptyIterable } from "./NonEmptyIterable.js"
import * as Option from "./Option.js"
import type { Pipeable } from "./Pipeable.js"
Expand Down Expand Up @@ -110,9 +110,6 @@ const ConsProto: Omit<Cons<unknown>, "head" | "tail" | typeof nonEmpty> = {
values: toArray(this).map(toJSON)
}
},
[DenoInspectSymbol]() {
return this.toJSON()
},
[NodeInspectSymbol]() {
return this.toJSON()
},
Expand Down Expand Up @@ -179,9 +176,6 @@ const NilProto: Nil<unknown> = {
_tag: "Nil"
}
},
[DenoInspectSymbol]() {
return this.toJSON()
},
[NodeInspectSymbol]() {
return this.toJSON()
},
Expand Down
8 changes: 1 addition & 7 deletions packages/effect/src/Micro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { constTrue, constVoid, dual, identity, type LazyArg } from "./Function.j
import { globalValue } from "./GlobalValue.js"
import type { TypeLambda } from "./HKT.js"
import type { Inspectable } from "./Inspectable.js"
import { DenoInspectSymbol, NodeInspectSymbol, toStringUnknown } from "./Inspectable.js"
import { NodeInspectSymbol, toStringUnknown } from "./Inspectable.js"
import * as doNotation from "./internal/doNotation.js"
import { StructuralPrototype } from "./internal/effectable.js"
import { SingleShotGen } from "./internal/singleShotGen.js"
Expand Down Expand Up @@ -323,9 +323,6 @@ abstract class MicroCauseImpl<Tag extends string, E> extends globalThis.Error im
toString() {
return this.stack
}
[DenoInspectSymbol]() {
return this.stack
}
[NodeInspectSymbol]() {
return this.stack
}
Expand Down Expand Up @@ -4100,9 +4097,6 @@ const YieldableError: new(message?: string) => YieldableError = (function() {
toJSON() {
return { ...this }
}
[DenoInspectSymbol](): string {
return this[NodeInspectSymbol]()
}
[NodeInspectSymbol](): string {
const stack = this.stack
if (stack) {
Expand Down
5 changes: 1 addition & 4 deletions packages/effect/src/MutableHashMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { NonEmptyArray } from "./Array.js"
import * as Equal from "./Equal.js"
import { dual } from "./Function.js"
import * as Hash from "./Hash.js"
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import * as Option from "./Option.js"
import type { Pipeable } from "./Pipeable.js"
import { pipeArguments } from "./Pipeable.js"
Expand Down Expand Up @@ -46,9 +46,6 @@ const MutableHashMapProto: Omit<MutableHashMap<unknown, unknown>, "referential"
values: Array.from(this).map(toJSON)
}
},
[DenoInspectSymbol]() {
return this.toJSON()
},
[NodeInspectSymbol]() {
return this.toJSON()
},
Expand Down
5 changes: 1 addition & 4 deletions packages/effect/src/MutableHashSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @since 2.0.0
*/
import * as Dual from "./Function.js"
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import * as MutableHashMap from "./MutableHashMap.js"
import type { Pipeable } from "./Pipeable.js"
import { pipeArguments } from "./Pipeable.js"
Expand Down Expand Up @@ -40,9 +40,6 @@ const MutableHashSetProto: Omit<MutableHashSet<unknown>, "keyMap"> = {
values: Array.from(this).map(toJSON)
}
},
[DenoInspectSymbol]() {
return this.toJSON()
},
[NodeInspectSymbol]() {
return this.toJSON()
},
Expand Down
5 changes: 1 addition & 4 deletions packages/effect/src/MutableList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @since 2.0.0
*/
import * as Dual from "./Function.js"
import { DenoInspectSymbol, format, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import { format, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import type { Inspectable } from "./Inspectable.js"
import type { Pipeable } from "./Pipeable.js"
import { pipeArguments } from "./Pipeable.js"
Expand Down Expand Up @@ -63,9 +63,6 @@ const MutableListProto: Omit<MutableList<unknown>, "head" | "tail"> = {
values: Array.from(this).map(toJSON)
}
},
[DenoInspectSymbol]() {
return this.toJSON()
},
[NodeInspectSymbol]() {
return this.toJSON()
},
Expand Down
5 changes: 1 addition & 4 deletions packages/effect/src/MutableQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import * as Chunk from "./Chunk.js"
import * as Dual from "./Function.js"
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import * as MutableList from "./MutableList.js"
import type { Pipeable } from "./Pipeable.js"
import { pipeArguments } from "./Pipeable.js"
Expand Down Expand Up @@ -59,9 +59,6 @@ const MutableQueueProto: Omit<MutableQueue<unknown>, "queue" | "capacity"> = {
values: Array.from(this).map(toJSON)
}
},
[DenoInspectSymbol]() {
return this.toJSON()
},
[NodeInspectSymbol]() {
return this.toJSON()
},
Expand Down
5 changes: 1 addition & 4 deletions packages/effect/src/MutableRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import * as Equal from "./Equal.js"
import * as Dual from "./Function.js"
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import type { Pipeable } from "./Pipeable.js"
import { pipeArguments } from "./Pipeable.js"

Expand Down Expand Up @@ -37,9 +37,6 @@ const MutableRefProto: Omit<MutableRef<unknown>, "current"> = {
current: toJSON(this.current)
}
},
[DenoInspectSymbol]() {
return this.toJSON()
},
[NodeInspectSymbol]() {
return this.toJSON()
},
Expand Down
5 changes: 1 addition & 4 deletions packages/effect/src/SortedMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as Equal from "./Equal.js"
import * as Dual from "./Function.js"
import { pipe } from "./Function.js"
import * as Hash from "./Hash.js"
import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import * as Option from "./Option.js"
import type { Order } from "./Order.js"
import type { Pipeable } from "./Pipeable.js"
Expand Down Expand Up @@ -62,9 +62,6 @@ const SortedMapProto: Omit<SortedMap<unknown, unknown>, "tree"> = {
values: Array.from(this).map(toJSON)
}
},
[DenoInspectSymbol]() {
return this.toJSON()
},
[NodeInspectSymbol]() {
return this.toJSON()
},
Expand Down
5 changes: 1 addition & 4 deletions packages/effect/src/SortedSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as Dual from "./Function.js"
import { pipe } from "./Function.js"
import * as Hash from "./Hash.js"
import type { Inspectable } from "./Inspectable.js"
import { DenoInspectSymbol, format, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import { format, NodeInspectSymbol, toJSON } from "./Inspectable.js"
import type { Order } from "./Order.js"
import type { Pipeable } from "./Pipeable.js"
import { pipeArguments } from "./Pipeable.js"
Expand Down Expand Up @@ -62,9 +62,6 @@ const SortedSetProto: Omit<SortedSet<unknown>, "keyTree"> = {
values: Array.from(this).map(toJSON)
}
},
[DenoInspectSymbol]() {
return this.toJSON()
},
[NodeInspectSymbol]() {
return this.toJSON()
},
Expand Down
5 changes: 1 addition & 4 deletions packages/effect/src/internal/cause.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { constFalse, constTrue, dual, identity, pipe } from "../Function.js"
import { globalValue } from "../GlobalValue.js"
import * as Hash from "../Hash.js"
import * as HashSet from "../HashSet.js"
import { DenoInspectSymbol, NodeInspectSymbol, toJSON } from "../Inspectable.js"
import { NodeInspectSymbol, toJSON } from "../Inspectable.js"
import * as Option from "../Option.js"
import { pipeArguments } from "../Pipeable.js"
import type { Predicate, Refinement } from "../Predicate.js"
Expand Down Expand Up @@ -69,9 +69,6 @@ const proto = {
toString<E>(this: Cause.Cause<E>) {
return pretty(this)
},
[DenoInspectSymbol]<E>(this: Cause.Cause<E>) {
return this.toJSON()
},
[NodeInspectSymbol]<E>(this: Cause.Cause<E>) {
return this.toJSON()
}
Expand Down
Loading

0 comments on commit 3b2ad1d

Please sign in to comment.