1
1
import { AsyncFunction , Func , ReturnTypeUnwrapped } from "./typing.ts" ;
2
2
3
- import { currentLocation } from "./trace.ts" ;
4
- import { pairRight } from "./juxt.ts" ;
3
+ import { randomUUID } from "node:crypto" ;
5
4
import { pipe } from "./composition.ts" ;
5
+ import { pairRight } from "./juxt.ts" ;
6
6
import { isPromise } from "./promise.ts" ;
7
+ import { currentLocation } from "./trace.ts" ;
7
8
8
9
export const sideLog = < T > ( x : T ) => {
9
10
console . log ( currentLocation ( 3 ) , x ) ;
@@ -146,7 +147,7 @@ const makeErrorWithId = (id: string) => {
146
147
} ;
147
148
148
149
export const throwerCatcher = ( ) => {
149
- const id = crypto . randomUUID ( ) ;
150
+ const id = randomUUID ( ) ;
150
151
const catcher = catchErrorWithId ( id ) ;
151
152
const thrower = ( ) => {
152
153
throw makeErrorWithId ( id ) ;
@@ -171,7 +172,7 @@ async (...xs: Parameters<F>) => {
171
172
} ;
172
173
173
174
export const throwerCatcherWithValue = < T > ( ) => {
174
- const id = crypto . randomUUID ( ) ;
175
+ const id = randomUUID ( ) ;
175
176
const catcher = catchErrorWithIdAndValue < T > ( id ) ;
176
177
const thrower = ( value : T ) => {
177
178
const e = makeErrorWithId ( id ) ;
0 commit comments