ts-node-client 2.1.1 → 2.1.2

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.
@@ -39,7 +39,7 @@ Scanner.prototype.scan = function scan(cb) {
39
39
  const dependency = self.walk(data);
40
40
  const result = new ScanResult(
41
41
  options.project,
42
- data.name,
42
+ data.name,
43
43
  `npm:${data.name}`,
44
44
  dependency
45
45
  );
@@ -74,15 +74,15 @@ Scanner.prototype.walk = function walk(npmDependency, level) {
74
74
  printDependency(npmDependency, level);
75
75
 
76
76
  if (npmDependency.name) {
77
- const dependency = new Dependency(
78
- npmDependency.name,
79
- npmDependency.version,
80
- 'npm',
81
- npmDependency.description,
82
- npmDependency.private,
83
- npmDependency.licenses || npmDependency.license,
84
- npmDependency.homepage,
85
- npmDependency.repository ? npmDependency.repository.url : undefined
77
+ const dependency = new Dependency(
78
+ npmDependency.name,
79
+ npmDependency.version,
80
+ 'npm',
81
+ npmDependency.description,
82
+ npmDependency.private,
83
+ npmDependency.licenses || npmDependency.license,
84
+ npmDependency.homepage,
85
+ npmDependency.repository ? npmDependency.repository.url : undefined
86
86
  );
87
87
 
88
88
  if (npmDependency.dependencies) {
package/lib/pkg.js CHANGED
@@ -29,7 +29,7 @@ PackageURL.get = function get(manager, org, key, version) {
29
29
 
30
30
  function fixPart(str) {
31
31
  const newStr = encodeURI(str);
32
- return newStr.replace('%3A', ':');
32
+ return newStr.split('%3A').join(':');
33
33
  }
34
34
 
35
35
  module.exports = PackageURL;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ts-node-client",
3
3
  "description": "npm / node module to transfer dependency information to TrustSource server.",
4
- "version": "2.1.1",
4
+ "version": "2.1.2",
5
5
  "private": false,
6
6
  "homepage": "https://app.trustsource.io/",
7
7
  "author": {
@@ -36,23 +36,23 @@ describe('Dependency', () => {
36
36
  it('should set license as object', () => {
37
37
  assert.deepEqual(new Dependency('---', '---', '---', '', true, 'MIT').licenses[0], { name: 'MIT' });
38
38
  assert.deepEqual(new Dependency('---', '---', '---', '', true, { type: 'MIT' }).licenses[0], { name: 'MIT' });
39
- assert.deepEqual(
39
+ assert.deepEqual(
40
40
  new Dependency('---', '---', '---', '', true, { type: 'MIT', url: 'https://test' }).licenses[0],
41
- { name: 'MIT', url: 'https://test' }
41
+ { name: 'MIT', url: 'https://test' }
42
42
  );
43
43
  });
44
44
 
45
45
  it('should set license as array', () => {
46
- assert.deepEqual(
46
+ assert.deepEqual(
47
47
  new Dependency('---', '---', '---', '', true, ['MIT', 'Apache']).licenses,
48
- [{ name: 'MIT' }, { name: 'Apache' }]
48
+ [{ name: 'MIT' }, { name: 'Apache' }]
49
49
  );
50
50
  });
51
51
 
52
52
  it('should set license as array of objects', () => {
53
- assert.deepEqual(
53
+ assert.deepEqual(
54
54
  new Dependency('---', '---', '---', '', true, [{ type: 'MIT', url: 'url' }, { type: 'Apache' }]).licenses,
55
- [{ name: 'MIT', url: 'url' }, { name: 'Apache' }]
55
+ [{ name: 'MIT', url: 'url' }, { name: 'Apache' }]
56
56
  );
57
57
  });
58
58
 
@@ -148,31 +148,31 @@ describe('Dependency', () => {
148
148
  });
149
149
 
150
150
  it('should extract additional repo-protocol from url', () => {
151
- assert.deepEqual(
152
- new Dependency(
153
- 'name',
154
- 'version',
155
- '---',
156
- 'description',
157
- '---',
158
- '---',
159
- 'home',
160
- 'git+https://github.com/eacg-gmbh/ecs-grunt-plugin.git'
151
+ assert.deepEqual(
152
+ new Dependency(
153
+ 'name',
154
+ 'version',
155
+ '---',
156
+ 'description',
157
+ '---',
158
+ '---',
159
+ 'home',
160
+ 'git+https://github.com/eacg-gmbh/ecs-grunt-plugin.git'
161
161
  ).repoUrl,
162
- 'https://github.com/eacg-gmbh/ecs-grunt-plugin.git'
162
+ 'https://github.com/eacg-gmbh/ecs-grunt-plugin.git'
163
163
  );
164
- assert.deepEqual(
165
- new Dependency(
166
- 'name',
167
- 'version',
168
- '---',
169
- 'description',
170
- '---',
171
- '---',
172
- 'home',
173
- 'svn+http://svnrepo.com/test.svn'
164
+ assert.deepEqual(
165
+ new Dependency(
166
+ 'name',
167
+ 'version',
168
+ '---',
169
+ 'description',
170
+ '---',
171
+ '---',
172
+ 'home',
173
+ 'svn+http://svnrepo.com/test.svn'
174
174
  ).repoUrl,
175
- 'http://svnrepo.com/test.svn'
175
+ 'http://svnrepo.com/test.svn'
176
176
  );
177
177
  });
178
178