@heronlabs/terminal-cli 2.1.3 → 2.1.4

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.
@@ -35,14 +35,20 @@ let DatabaseUrlService = class DatabaseUrlService {
35
35
  const tail = value.slice(index + delimiter.length);
36
36
  return [head, tail];
37
37
  }
38
+ stripNameSuffix(name) {
39
+ const [withoutFragment] = this.splitFirst(name, '#');
40
+ const [withoutQuery] = this.splitFirst(withoutFragment, '?');
41
+ return withoutQuery;
42
+ }
38
43
  async parse() {
39
44
  try {
40
45
  const databaseUrl = await this.ssmConfigService.getOrThrow('DB_URL');
41
46
  const [, rest = ''] = this.splitFirst(databaseUrl, '://');
42
47
  const [userinfo, remainder] = this.splitLast(rest, '@');
43
- const [hostport, name = ''] = this.splitFirst(remainder, '/');
48
+ const [hostport, rawName = ''] = this.splitFirst(remainder, '/');
44
49
  const [user, password = ''] = this.splitFirst(userinfo, ':');
45
50
  const [host, port = ''] = this.splitFirst(hostport, ':');
51
+ const name = this.stripNameSuffix(rawName);
46
52
  const connection = { host, port, name, user, password };
47
53
  const missing = ['host', 'name', 'user'].filter(field => connection[field] === '');
48
54
  if (missing.length > 0) {
package/package.json CHANGED
@@ -97,5 +97,5 @@
97
97
  "test:mutation": "stryker run stryker.conf.json",
98
98
  "test:unit": "vitest run"
99
99
  },
100
- "version": "2.1.3"
100
+ "version": "2.1.4"
101
101
  }