Skip to content

Commit 98155c5

Browse files
authoredDec 13, 2022
feat: bind console log for performance (not really) (#105)
1 parent 16a71f3 commit 98155c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/greet.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { GreetOptions } from "./types.js";
22

3+
const boundConsoleLog = console.log.bind(console);
4+
35
export function greet(options: GreetOptions | string) {
46
const {
5-
logger = console.log.bind(console),
7+
logger = boundConsoleLog,
68
message,
79
times = 1,
810
} = typeof options === "string" ? { message: options } : options;

0 commit comments

Comments
 (0)
Please sign in to comment.