Comparing version 0.0.2 to 0.0.3
@@ -21,8 +21,7 @@ "use strict"; | ||
}; | ||
class Debux { | ||
module.exports = class Debux { | ||
constructor(options) { | ||
var _a, _b; | ||
this.maxCacheSize = (_a = options === null || options === void 0 ? void 0 : options.maxCacheSize) !== null && _a !== void 0 ? _a : defaultOptions.maxCacheSize; | ||
this.maxCacheSize = options?.maxCacheSize ?? defaultOptions.maxCacheSize; | ||
this.cache = []; | ||
this.logLevel = (_b = options === null || options === void 0 ? void 0 : options.logLevel) !== null && _b !== void 0 ? _b : defaultOptions.logLevel; | ||
this.logLevel = options?.logLevel ?? defaultOptions.logLevel; | ||
} | ||
@@ -57,9 +56,9 @@ log(s, options) { | ||
let msg = chalk_1.default.cyan(new Date().toUTCString()) + seperator; | ||
if (typeof (options === null || options === void 0 ? void 0 : options.process) == "string") | ||
if (typeof options?.process == "string") | ||
msg += chalk_1.default.magenta(options.process) + seperator; | ||
if (typeof (options === null || options === void 0 ? void 0 : options.class) == "string") | ||
if (typeof options?.class == "string") | ||
msg += chalk_1.default.yellow(options.class) + seperator; | ||
if (typeof (options === null || options === void 0 ? void 0 : options.event) == "string") | ||
if (typeof options?.event == "string") | ||
msg += chalk_1.default.green(options.event) + seperator; | ||
if (typeof (options === null || options === void 0 ? void 0 : options.function) == "string") | ||
if (typeof options?.function == "string") | ||
msg += chalk_1.default.blue(options.function) + seperator; | ||
@@ -73,3 +72,2 @@ return msg + s; | ||
} | ||
} | ||
exports.default = Debux; | ||
}; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const __1 = __importStar(require("..")); | ||
const debug = new __1.default({ maxCacheSize: 10, logLevel: __1.level.all }); | ||
//@ts-ignore | ||
const __1 = __importDefault(require("..")); | ||
const debug = new __1.default({ maxCacheSize: 10, logLevel: 4 }); | ||
debug.log("this is a log", { | ||
@@ -25,0 +10,0 @@ process: "process", |
{ | ||
"name": "debux", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Easy-to-use library for debugging your code", | ||
"main": "build/index.js", | ||
"types": "./typings/index.d.ts", | ||
"types": "./build/index.d.ts", | ||
"scripts": { | ||
@@ -8,0 +8,0 @@ "build": "rimraf ./build && tsc", |
@@ -30,3 +30,3 @@ import chalk from "chalk"; | ||
class Debux { | ||
module.exports = class Debux { | ||
private maxCacheSize: number; | ||
@@ -85,4 +85,2 @@ private cache: string[]; | ||
} | ||
} | ||
export default Debux; | ||
}; |
@@ -1,4 +0,5 @@ | ||
import Debux, { level } from ".."; | ||
//@ts-ignore | ||
import Debux from ".."; | ||
const debug = new Debux({ maxCacheSize: 10, logLevel: level.all }); | ||
const debug = new Debux({ maxCacheSize: 10, logLevel: 4 }); | ||
@@ -5,0 +6,0 @@ debug.log("this is a log", { |
{ | ||
"compilerOptions": { | ||
"target": "es2019", | ||
"target": "es2020", | ||
"module": "commonjs", | ||
"lib": ["es6"], | ||
"lib": ["ESNext"], | ||
"moduleResolution": "node", | ||
"declaration": true, | ||
"declarationMap": true, | ||
"allowJs": true, | ||
@@ -12,5 +15,6 @@ "outDir": "build", | ||
"esModuleInterop": true, | ||
"resolveJsonModule": true | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true | ||
}, | ||
"exclude": ["build", "node_modules"] | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import Debux from "../src"; | ||
import Debux from "../src/index"; | ||
@@ -3,0 +3,0 @@ declare module "debux" { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15
242
11129