Comparing version 0.0.14 to 0.0.15
@@ -379,11 +379,11 @@ "use strict"; | ||
}; | ||
Debug.timeIcon = 'đ'; | ||
Debug.timeIcon = 'âąī¸'; | ||
Debug.end = function end(...args) { | ||
return process.stdout.write(util.format.call(util, ...args) + '\n'); | ||
}; | ||
Debug.endIcon = 'đ'; | ||
Debug.endIcon = 'âąī¸'; | ||
Debug.timeEnd = function timeEnd(...args) { | ||
return process.stdout.write(util.format.call(util, ...args) + '\n'); | ||
}; | ||
Debug.timeEndIcon = 'đ'; | ||
Debug.timeEndIcon = 'âąī¸'; | ||
Debug.now = function now() { | ||
@@ -390,0 +390,0 @@ return process.hrtime(); |
@@ -79,8 +79,8 @@ /// <reference types="node" /> | ||
export declare class ProcessInfo { | ||
private static mainModule; | ||
private static mainFile; | ||
private static mainPackage; | ||
private static entry; | ||
private static rootPkg; | ||
private static packages; | ||
private static modules; | ||
private static rootItem; | ||
private static rootFile; | ||
private static serial; | ||
@@ -87,0 +87,0 @@ private static cpuUsage; |
@@ -120,5 +120,5 @@ "use strict"; | ||
const cache = Object.values(require.cache); | ||
this.rootItem = cache[0]; | ||
this.rootFile = String(this.rootItem.filename || this.rootItem.id || this.rootItem.i); | ||
this.rootPkg = { | ||
this.mainModule = process.mainModule; | ||
this.mainFile = this.mainModule && String(this.mainModule.filename || this.mainModule.id || this.mainModule.i) || '<main>'; | ||
this.mainPackage = { | ||
name: '.', | ||
@@ -136,6 +136,8 @@ // TODO: Find versions | ||
imports: [], | ||
path: null, | ||
path: this.mainFile, | ||
json: null | ||
}; | ||
this.packages['.'] = this.rootPkg; | ||
this.packages['.'] = this.mainPackage; | ||
if (this.mainModule) | ||
ProcessInfo.resolve(this.mainModule); | ||
for (const mod of cache) | ||
@@ -149,3 +151,3 @@ ProcessInfo.resolve(mod); | ||
return this.modules[id]; | ||
let name = (mod === this.rootItem) ? id : utils_1.Utils.relative(file, this.rootFile); | ||
let name = (mod === this.mainModule) ? id : utils_1.Utils.relative(file, this.mainFile); | ||
const parent = mod.parent && this.modules[mod.parent.id]; | ||
@@ -156,5 +158,5 @@ const level = parent && (parent.level + 1) || 0; | ||
this.modules[id] = info; | ||
if (mod === this.rootItem) { | ||
if (mod === this.mainModule) { | ||
this.entry = info; | ||
this.rootPkg.import = info; | ||
this.mainPackage.import = info; | ||
} | ||
@@ -198,9 +200,9 @@ const ix = name && name.indexOf('node_modules/'); | ||
else { | ||
info.package = this.rootPkg; | ||
this.rootPkg.size += info.size; | ||
if (!this.rootPkg.moduleCount) { | ||
this.rootPkg.path = file; | ||
info.package = this.mainPackage; | ||
this.mainPackage.size += info.size; | ||
if (!this.mainPackage.moduleCount) { | ||
this.mainPackage.path = file; | ||
} | ||
this.rootPkg.modules.push(info); | ||
this.rootPkg.moduleCount++; | ||
this.mainPackage.modules.push(info); | ||
this.mainPackage.moduleCount++; | ||
} | ||
@@ -207,0 +209,0 @@ for (const item of mod.children || []) { |
{ | ||
"name": "exer", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "Utils in TypeScript, Debug, NanoTimer ...", | ||
@@ -5,0 +5,0 @@ "author": "kbajalc@gmail.com", |
Sorry, the diff of this file is not supported yet
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
107196
1650