node-power-user 0.0.23 → 0.0.24

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/dist/index.js CHANGED
@@ -110,9 +110,10 @@ const self = this;
110
110
  .forEach(async (dep, i) => {
111
111
  const packageVersion = _coerce(self.proj_packageJSON.dependencies[dep]);
112
112
  const installedVersion = _coerce(
113
- (await asyncCommand(`npm list ${dep} --depth=0 | grep ${dep}`))
114
- .split(' ')[1]
115
- .split('@')[1]
113
+ _getVersion(
114
+ (await asyncCommand(`npm list ${dep} --depth=0 | grep ${dep}`))
115
+ .split(' ')[1]
116
+ )
116
117
  );
117
118
  const isEqual = _isEqual(installedVersion, packageVersion);
118
119
  const verb = isEqual ? 'green' : 'yellow'
@@ -227,3 +228,8 @@ function _isEqual(v1, v2) {
227
228
  return false;
228
229
  }
229
230
  }
231
+
232
+ function _getVersion(v) {
233
+ v = v.split('@');
234
+ return v[v.length - 1]
235
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-power-user",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "description": "Easy tools for every Node.js developer!",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -46,4 +46,4 @@
46
46
  "mocha": "^8.4.0",
47
47
  "prepare-package": "^0.0.16"
48
48
  }
49
- }
49
+ }
package/src/index.js CHANGED
@@ -110,9 +110,10 @@ const self = this;
110
110
  .forEach(async (dep, i) => {
111
111
  const packageVersion = _coerce(self.proj_packageJSON.dependencies[dep]);
112
112
  const installedVersion = _coerce(
113
- (await asyncCommand(`npm list ${dep} --depth=0 | grep ${dep}`))
114
- .split(' ')[1]
115
- .split('@')[1]
113
+ _getVersion(
114
+ (await asyncCommand(`npm list ${dep} --depth=0 | grep ${dep}`))
115
+ .split(' ')[1]
116
+ )
116
117
  );
117
118
  const isEqual = _isEqual(installedVersion, packageVersion);
118
119
  const verb = isEqual ? 'green' : 'yellow'
@@ -227,3 +228,8 @@ function _isEqual(v1, v2) {
227
228
  return false;
228
229
  }
229
230
  }
231
+
232
+ function _getVersion(v) {
233
+ v = v.split('@');
234
+ return v[v.length - 1]
235
+ }