Skip to content

Commit 65de148

Browse files
committed
add-debug
1 parent 3bd4379 commit 65de148

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/debug.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { any } from "./array.ts";
21
import { pipe } from "./composition.ts";
32
import { pairRight } from "./juxt.ts";
43
import { isPromise } from "./promise.ts";
@@ -16,6 +15,11 @@ export const sideLog = <T>(x: T) => {
1615
return x;
1716
};
1817

18+
export const sideLogJson = <T>(x: T) => {
19+
console.log(currentLocation(3), JSON.stringify(x, null, 2));
20+
return x;
21+
};
22+
1923
export const logAround = <F extends Func>(f: F): F => {
2024
const codeLocation = currentLocation(3);
2125
return ((...xs) => {

0 commit comments

Comments
 (0)