Skip to content

Commit 71f0096

Browse files
committed
import-crypto
1 parent c3e50d2 commit 71f0096

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/debug.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { AsyncFunction, Func, ReturnTypeUnwrapped } from "./typing.ts";
22

3-
import { currentLocation } from "./trace.ts";
4-
import { pairRight } from "./juxt.ts";
3+
import { randomUUID } from "node:crypto";
54
import { pipe } from "./composition.ts";
5+
import { pairRight } from "./juxt.ts";
66
import { isPromise } from "./promise.ts";
7+
import { currentLocation } from "./trace.ts";
78

89
export const sideLog = <T>(x: T) => {
910
console.log(currentLocation(3), x);
@@ -146,7 +147,7 @@ const makeErrorWithId = (id: string) => {
146147
};
147148

148149
export const throwerCatcher = () => {
149-
const id = crypto.randomUUID();
150+
const id = randomUUID();
150151
const catcher = catchErrorWithId(id);
151152
const thrower = () => {
152153
throw makeErrorWithId(id);
@@ -171,7 +172,7 @@ async (...xs: Parameters<F>) => {
171172
};
172173

173174
export const throwerCatcherWithValue = <T>() => {
174-
const id = crypto.randomUUID();
175+
const id = randomUUID();
175176
const catcher = catchErrorWithIdAndValue<T>(id);
176177
const thrower = (value: T) => {
177178
const e = makeErrorWithId(id);

0 commit comments

Comments
 (0)