Making package browser compatible

This commit is contained in:
Fabian
2019-03-25 21:50:26 -04:00
parent 58ff2fd2ea
commit 9417264850
10 changed files with 1296 additions and 311 deletions

View File

@ -1,6 +1,6 @@
import { Logging, LoggingBase } from "./index";
import { randomBytes } from "crypto";
import * as fs from "fs";
import { Logging, LoggingExtended } from "./index";
const deleteFolderRecursive = function (path: string) {
if (fs.existsSync(path)) {
fs.readdirSync(path).forEach(function (file, index) {
@ -28,13 +28,13 @@ Logging.log("\x1b[31m\x1b[31m\x1b[31m\x1b[31m\x1b[31m\x1b[31m TEST \x1b[31m\x1b[
let err = new Error()
if (typeof err.stack !== "string") console.log("Stacktrace invalid", err.stack)
let cus = new LoggingBase({ name: "test" });
let cus = new LoggingExtended({ name: "test" });
cus.log("Hello from custom Logger")
let cus2 = new LoggingBase("test2");
let cus2 = new LoggingExtended("test2");
cus2.log("Hello from custom Logger 2")
let cus22 = new LoggingBase("test2");
let cus22 = new LoggingExtended("test2");
cus22.log("Hello from custom Logger 22")
cus2.log("Hello from custom Logger 2")
cus22.log("Hello from custom Logger 22")
@ -46,7 +46,7 @@ cus2.log("Hello from custom Logger 2")
cus22.log("Hello from custom Logger 22")
cus2.log("Hello from custom Logger 2")
const BenchmarkLogger = new LoggingBase({
const BenchmarkLogger = new LoggingExtended({
console: false,
name: "bench"
})