@tscircuit/core 0.0.9 → 0.0.10

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
@@ -133,7 +133,8 @@ function isMatchingSelector(component, selector) {
133
133
  if (classMatch) {
134
134
  return component.isMatchingNameOrAlias(classMatch[1]);
135
135
  }
136
- const [type, ...conditions] = selector.split(/(?=[#.[])/);
136
+ let [type, ...conditions] = selector.split(/(?=[#.[])/);
137
+ if (type === "pin") type = "port";
137
138
  if (type && type !== "*" && component.lowercaseComponentName !== type.toLowerCase()) {
138
139
  return false;
139
140
  }
@@ -0,0 +1,12 @@
1
+ export const extendAliases = (
2
+ aliases: string[],
3
+ additionalAliases: Record<string, string[]>,
4
+ ): string[] => {
5
+ return Array.from(
6
+ new Set(
7
+ aliases.flatMap((alias) => {
8
+ return [alias, ...(additionalAliases[alias] || [])]
9
+ }),
10
+ ),
11
+ )
12
+ }
@@ -33,7 +33,9 @@ export function isMatchingSelector(
33
33
  }
34
34
 
35
35
  // Split the selector into type and conditions
36
- const [type, ...conditions] = selector.split(/(?=[#.[])/)
36
+ let [type, ...conditions] = selector.split(/(?=[#.[])/)
37
+
38
+ if (type === "pin") type = "port"
37
39
 
38
40
  // Check if the component type matches
39
41
  if (
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "module": "index.ts",
4
4
  "type": "module",
5
5
  "types": "index.ts",
6
- "version": "0.0.9",
6
+ "version": "0.0.10",
7
7
  "main": "dist/index.js",
8
8
  "files": [
9
9
  "index.ts",