summaryrefslogtreecommitdiff
path: root/u/trace/itrace.ts
diff options
context:
space:
mode:
authorElizabeth <lizhunt@amazon.com>2025-05-28 15:05:38 -0700
committerElizabeth <lizhunt@amazon.com>2025-05-28 15:05:38 -0700
commit3005cc83e605fb89b079cf0e6fd0ec95cd27b30e (patch)
tree992c5933f2ec4a75e32469ddd772c61dbcb2e2fd /u/trace/itrace.ts
parente3cf820b07e282221502cf2f116c9780b7375e0e (diff)
downloadci-3005cc83e605fb89b079cf0e6fd0ec95cd27b30e.tar.gz
ci-3005cc83e605fb89b079cf0e6fd0ec95cd27b30e.zip
Run prettier, add zed settings
Diffstat (limited to 'u/trace/itrace.ts')
-rw-r--r--u/trace/itrace.ts27
1 files changed, 5 insertions, 22 deletions
diff --git a/u/trace/itrace.ts b/u/trace/itrace.ts
index e6189d3..ed707c5 100644
--- a/u/trace/itrace.ts
+++ b/u/trace/itrace.ts
@@ -9,12 +9,7 @@ export interface ITrace<TraceWith> {
}
export type ITraceableTuple<T, TraceWith> = [T, BaseTraceWith | TraceWith];
-export type ITraceableMapper<
- T,
- U,
- TraceWith,
- W = ITraceable<T, TraceWith>,
-> = (
+export type ITraceableMapper<T, U, TraceWith, W = ITraceable<T, TraceWith>> = (
w: W,
) => U;
@@ -22,9 +17,7 @@ export interface ITraceable<T, Trace = BaseTraceWith> {
readonly trace: ITrace<Trace>;
get: Supplier<T>;
move: <U>(u: U) => ITraceable<U, Trace>;
- map: <U>(
- mapper: ITraceableMapper<T, U, Trace>,
- ) => ITraceable<U, Trace>;
+ map: <U>(mapper: ITraceableMapper<T, U, Trace>) => ITraceable<U, Trace>;
bimap: <U>(
mapper: ITraceableMapper<
T,
@@ -47,29 +40,19 @@ export class TraceableImpl<T, TraceWith> implements ITraceable<T, TraceWith> {
public readonly trace: ITrace<TraceWith>,
) {}
- public map<U>(
- mapper: ITraceableMapper<T, U, TraceWith>,
- ) {
+ public map<U>(mapper: ITraceableMapper<T, U, TraceWith>) {
const result = mapper(this);
return new TraceableImpl(result, this.trace);
}
public flatMap<U>(
- mapper: ITraceableMapper<
- T,
- ITraceable<U, TraceWith>,
- TraceWith
- >,
+ mapper: ITraceableMapper<T, ITraceable<U, TraceWith>, TraceWith>,
): ITraceable<U, TraceWith> {
return mapper(this);
}
public flatMapAsync<U>(
- mapper: ITraceableMapper<
- T,
- Promise<ITraceable<U, TraceWith>>,
- TraceWith
- >,
+ mapper: ITraceableMapper<T, Promise<ITraceable<U, TraceWith>>, TraceWith>,
): ITraceable<Promise<U>, TraceWith> {
return new TraceableImpl(
mapper(this).then((t) => t.get()),