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/index.js
CHANGED
|
@@ -10018,34 +10018,39 @@ var isResistorComponent = (betterEasy) => {
|
|
|
10018
10018
|
};
|
|
10019
10019
|
|
|
10020
10020
|
// lib/websafe/convert-to-typescript-component/category-value-contains-switch.ts
|
|
10021
|
-
var
|
|
10022
|
-
if (typeof
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
|
|
10021
|
+
var getCategoryStrings = (category) => {
|
|
10022
|
+
if (typeof category === "string") return [category.toLowerCase()];
|
|
10023
|
+
if (Array.isArray(category)) return category.flatMap(getCategoryStrings);
|
|
10024
|
+
if (category && typeof category === "object") {
|
|
10025
|
+
return Object.values(category).flatMap(getCategoryStrings);
|
|
10026
|
+
}
|
|
10027
|
+
return [];
|
|
10028
|
+
};
|
|
10029
|
+
var categoryValueContainsSwitch = (category) => {
|
|
10030
|
+
const categoryStrings = getCategoryStrings(category);
|
|
10031
|
+
if (categoryStrings.some(
|
|
10032
|
+
(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(
|
|
10033
|
+
category2
|
|
10034
|
+
)
|
|
10035
|
+
)) {
|
|
10036
|
+
return false;
|
|
10034
10037
|
}
|
|
10035
|
-
return
|
|
10038
|
+
return categoryStrings.some(
|
|
10039
|
+
(category2) => /(?:slide|toggle|dip|key|micro|limit)\s+switch(?:es)?/.test(category2) || /(^|[^a-z])switch(?:es)?([^a-z]|$)/.test(category2)
|
|
10040
|
+
);
|
|
10036
10041
|
};
|
|
10037
10042
|
|
|
10038
10043
|
// lib/websafe/convert-to-typescript-component/is-switch-category-component.ts
|
|
10039
10044
|
var isSwitchCategoryComponent = (betterEasy) => {
|
|
10040
10045
|
const cPara = betterEasy.dataStr.head.c_para;
|
|
10041
|
-
return [
|
|
10046
|
+
return categoryValueContainsSwitch([
|
|
10042
10047
|
betterEasy.tags,
|
|
10043
10048
|
cPara.category,
|
|
10044
10049
|
cPara.Category,
|
|
10045
10050
|
cPara["LCSC Category"],
|
|
10046
10051
|
cPara["JLCPCB Category"],
|
|
10047
10052
|
betterEasy.category
|
|
10048
|
-
]
|
|
10053
|
+
]);
|
|
10049
10054
|
};
|
|
10050
10055
|
|
|
10051
10056
|
// lib/websafe/convert-to-typescript-component/index.tsx
|