bdy 1.18.6-dev → 1.18.7-dev

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.18.6-dev",
4
+ "version": "1.18.7-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -52,6 +52,7 @@ const interactive = async (client, workspace, prompt, tlds, onOwnerBehalf) => {
52
52
  output_1.default.arrowSign();
53
53
  output_1.default.normal(`Searching...`);
54
54
  let items = [];
55
+ const added = {};
55
56
  const createValue = (type, name, available) => {
56
57
  return `${type}:${name}:${available ? '1' : '0'}`;
57
58
  };
@@ -62,6 +63,7 @@ const interactive = async (client, workspace, prompt, tlds, onOwnerBehalf) => {
62
63
  if (claimable) {
63
64
  items.push(output_1.default.createMenuSeparator('Matched'));
64
65
  items.push(output_1.default.createMenuItem(output_1.default.formatDomainClaim(prompt, claimable.available), createValue('claim', prompt, claimable.available)));
66
+ added[prompt] = true;
65
67
  }
66
68
  else {
67
69
  const search = await client.domainSearch(workspace, [prompt]);
@@ -69,6 +71,7 @@ const interactive = async (client, workspace, prompt, tlds, onOwnerBehalf) => {
69
71
  if (buyable) {
70
72
  items.push(output_1.default.createMenuSeparator('Matched'));
71
73
  items.push(output_1.default.createMenuItem(output_1.default.formatDomain(buyable), createValue('domain', prompt, buyable.available && !buyable.premium)));
74
+ added[prompt] = true;
72
75
  }
73
76
  }
74
77
  }
@@ -94,23 +97,35 @@ const interactive = async (client, workspace, prompt, tlds, onOwnerBehalf) => {
94
97
  const domainsAvailable = search.domains.filter((d) => d.available && !d.premium);
95
98
  const domainsUnavailable = search.domains.filter((d) => !d.available || d.premium);
96
99
  domainsAvailable.forEach((d) => {
97
- items.push(output_1.default.createMenuItem(output_1.default.formatDomain(d), createValue('domain', d.name, true)));
100
+ if (!added[d.name]) {
101
+ items.push(output_1.default.createMenuItem(output_1.default.formatDomain(d), createValue('domain', d.name, true)));
102
+ added[d.name] = true;
103
+ }
98
104
  });
99
105
  claimsAvailable.forEach((c, i) => {
100
106
  const domain = `${prompt}.${c.domain}`;
101
- const item = output_1.default.createMenuItem(output_1.default.formatDomainClaim(domain, true), createValue('claim', domain, true));
102
- if (i < 5)
103
- items.unshift(item);
104
- else
105
- items.push(item);
107
+ if (!added[domain]) {
108
+ const item = output_1.default.createMenuItem(output_1.default.formatDomainClaim(domain, true), createValue('claim', domain, true));
109
+ if (i < 5)
110
+ items.unshift(item);
111
+ else
112
+ items.push(item);
113
+ added[domain] = true;
114
+ }
106
115
  });
107
116
  domainsUnavailable.forEach((d) => {
108
- items.push(output_1.default.createMenuItem(output_1.default.formatDomain(d), createValue('domain', d.name, false)));
117
+ if (!added[d.name]) {
118
+ items.push(output_1.default.createMenuItem(output_1.default.formatDomain(d), createValue('domain', d.name, false)));
119
+ added[d.name] = true;
120
+ }
109
121
  });
110
122
  claimsUnavailable.forEach((c) => {
111
123
  const domain = `${prompt}.${c.domain}`;
112
- const item = output_1.default.createMenuItem(output_1.default.formatDomainClaim(domain, false), createValue('claim', domain, false));
113
- items.push(item);
124
+ if (!added[domain]) {
125
+ const item = output_1.default.createMenuItem(output_1.default.formatDomainClaim(domain, false), createValue('claim', domain, false));
126
+ items.push(item);
127
+ added[domain] = true;
128
+ }
114
129
  });
115
130
  if (items.length > 10)
116
131
  items = items.filter((_, i) => i < 10);
@@ -124,14 +139,20 @@ const interactive = async (client, workspace, prompt, tlds, onOwnerBehalf) => {
124
139
  suggestions.claims.forEach((c) => {
125
140
  if (i >= 10)
126
141
  return;
127
- items.push(output_1.default.createMenuItem(output_1.default.formatDomainClaim(c, true), createValue('claim', c, true)));
128
- i += 1;
142
+ if (!added[c]) {
143
+ items.push(output_1.default.createMenuItem(output_1.default.formatDomainClaim(c, true), createValue('claim', c, true)));
144
+ added[c] = true;
145
+ i += 1;
146
+ }
129
147
  });
130
148
  suggestions.domains.forEach((d) => {
131
149
  if (i >= 10)
132
150
  return;
133
- items.push(output_1.default.createMenuItem(output_1.default.formatDomain(d), createValue('domain', d.name, true)));
134
- i += 1;
151
+ if (!added[d.name]) {
152
+ items.push(output_1.default.createMenuItem(output_1.default.formatDomain(d), createValue('domain', d.name, true)));
153
+ added[d.name] = true;
154
+ i += 1;
155
+ }
135
156
  });
136
157
  }
137
158
  output_1.default.clearPreviousLine();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.18.6-dev",
4
+ "version": "1.18.7-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {