whatap 0.4.60 → 0.4.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/core/agent.js CHANGED
@@ -79,7 +79,7 @@ NodeAgent.prototype.findRoot = function () {
79
79
  var self = this;
80
80
  var root = process.cwd();
81
81
  while(root.length > 1) {
82
- var dir_name = path.join(root, 'node_modules');
82
+ var dir_name = path.join(root, 'package.json');
83
83
  if(fs.existsSync(dir_name)) {
84
84
  self._conf['app.root'] = root;
85
85
  return;
@@ -89,7 +89,7 @@ NodeAgent.prototype.findRoot = function () {
89
89
 
90
90
  root = path.dirname(require.main.filename);
91
91
  while(root.length > 1) {
92
- var dir_name = path.join(root, 'node_modules');
92
+ var dir_name = path.join(root, 'package.json');
93
93
  if(fs.existsSync(dir_name)) {
94
94
  self._conf['app.root'] = root;
95
95
  return;
@@ -202,10 +202,11 @@ function getFunctionName(func) {
202
202
  if(ret[0] === '(') {
203
203
  return null;
204
204
  }
205
- ret = ret.substr('function '.length);
205
+ if(ret.indexOf('function ') >= 0 ) {
206
+ ret = ret.substr('function '.length);
207
+ }
206
208
  ret = ret.substr(0, ret.indexOf('('));
207
209
  } catch (e) {
208
-
209
210
  }
210
211
  return ret;
211
212
  };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "whatap",
3
3
  "homepage": "http://www.whatap.io",
4
- "version": "0.4.60",
5
- "releaseDate": "20220824",
4
+ "version": "0.4.62",
5
+ "releaseDate": "20220920",
6
6
  "description": "Monitoring and Profiling Service",
7
7
  "main": "index.js",
8
8
  "scripts": {},