Browse Source

Add Inspect function

ApisNecros 1 year ago
parent
commit
e68a17da93
1 changed files with 10 additions and 0 deletions
  1. 10 0
      common.ts

+ 10 - 0
common.ts

@@ -1,5 +1,6 @@
 import * as fs from "fs";
 import * as readline from "readline";
+import * as util from "util";
 
 export async function LoadInput(dayNumber: number): Promise<string[]> {
 	const contents = [];
@@ -15,4 +16,13 @@ export async function LoadInput(dayNumber: number): Promise<string[]> {
 	}
 
 	return contents;
+}
+
+/**
+ * Inspect a variable in the console
+ *
+ * @param {any} value A value to inspect
+ */
+export function Inspect(value: any): void {
+	console.log(util.inspect(value, { breakLength: Infinity, colors: true, depth: 256 }));
 }