easyeda 0.0.363 → 0.0.364
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/browser/index.js +21 -16
- package/dist/browser/index.js.map +1 -1
- package/dist/index.js +21 -16
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +22 -17
- package/dist/main.cjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -13645,34 +13645,39 @@ var isResistorComponent = (betterEasy) => {
|
|
|
13645
13645
|
};
|
|
13646
13646
|
|
|
13647
13647
|
// lib/websafe/convert-to-typescript-component/category-value-contains-switch.ts
|
|
13648
|
-
var
|
|
13649
|
-
if (typeof
|
|
13650
|
-
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
|
|
13654
|
-
|
|
13655
|
-
|
|
13656
|
-
|
|
13657
|
-
|
|
13658
|
-
|
|
13659
|
-
|
|
13660
|
-
|
|
13648
|
+
var getCategoryStrings = (category) => {
|
|
13649
|
+
if (typeof category === "string") return [category.toLowerCase()];
|
|
13650
|
+
if (Array.isArray(category)) return category.flatMap(getCategoryStrings);
|
|
13651
|
+
if (category && typeof category === "object") {
|
|
13652
|
+
return Object.values(category).flatMap(getCategoryStrings);
|
|
13653
|
+
}
|
|
13654
|
+
return [];
|
|
13655
|
+
};
|
|
13656
|
+
var categoryValueContainsSwitch = (category) => {
|
|
13657
|
+
const categoryStrings = getCategoryStrings(category);
|
|
13658
|
+
if (categoryStrings.some(
|
|
13659
|
+
(category2) => /analog[\s-]+switch/.test(category2) || /multiplex/.test(category2) || /switching\s+diodes?/.test(category2) || /\bics?\b/.test(category2) || /\b(?:power[\s-]+distribution|load)[\s-]+switch(?:es)?\b/.test(
|
|
13660
|
+
category2
|
|
13661
|
+
)
|
|
13662
|
+
)) {
|
|
13663
|
+
return false;
|
|
13661
13664
|
}
|
|
13662
|
-
return
|
|
13665
|
+
return categoryStrings.some(
|
|
13666
|
+
(category2) => /(?:slide|toggle|dip|key|micro|limit)\s+switch(?:es)?/.test(category2) || /(^|[^a-z])switch(?:es)?([^a-z]|$)/.test(category2)
|
|
13667
|
+
);
|
|
13663
13668
|
};
|
|
13664
13669
|
|
|
13665
13670
|
// lib/websafe/convert-to-typescript-component/is-switch-category-component.ts
|
|
13666
13671
|
var isSwitchCategoryComponent = (betterEasy) => {
|
|
13667
13672
|
const cPara = betterEasy.dataStr.head.c_para;
|
|
13668
|
-
return [
|
|
13673
|
+
return categoryValueContainsSwitch([
|
|
13669
13674
|
betterEasy.tags,
|
|
13670
13675
|
cPara.category,
|
|
13671
13676
|
cPara.Category,
|
|
13672
13677
|
cPara["LCSC Category"],
|
|
13673
13678
|
cPara["JLCPCB Category"],
|
|
13674
13679
|
betterEasy.category
|
|
13675
|
-
]
|
|
13680
|
+
]);
|
|
13676
13681
|
};
|
|
13677
13682
|
|
|
13678
13683
|
// lib/websafe/convert-to-typescript-component/index.tsx
|