circuitscript 0.6.0 → 0.6.1

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.
@@ -26,21 +26,15 @@ class ComponentAnnotater {
26
26
  else {
27
27
  const type = instance.typeProp ?? 'conn';
28
28
  if (this.counter[type] === undefined && type.length <= 2) {
29
- for (const [, value] of Object.entries(visitor_js_1.ComponentRefDesPrefixes)) {
30
- if (value === type) {
31
- throw "Refdes prefix is already in use!";
32
- }
33
- }
34
- if (visitor_js_1.ComponentRefDesPrefixes[type] === undefined) {
35
- visitor_js_1.ComponentRefDesPrefixes[type] = type;
36
- this.counter[type] = 1;
37
- }
29
+ visitor_js_1.ComponentRefDesPrefixes[type] = type;
30
+ this.counter[type] = 1;
38
31
  }
32
+ let useType = type;
39
33
  if (visitor_js_1.ComponentRefDesPrefixes[type] === undefined) {
40
- return null;
34
+ useType = 'conn';
41
35
  }
42
- usePrefix = visitor_js_1.ComponentRefDesPrefixes[type];
43
- useCounterKey = type;
36
+ usePrefix = visitor_js_1.ComponentRefDesPrefixes[useType];
37
+ useCounterKey = useType;
44
38
  }
45
39
  let prefix = '';
46
40
  let resultRefdes = '';