myoperator-ui 0.0.59 → 0.0.60
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 +13 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2963,6 +2963,19 @@ async function add(components, options) {
|
|
|
2963
2963
|
}
|
|
2964
2964
|
components = selectedComponents;
|
|
2965
2965
|
}
|
|
2966
|
+
const normalizeComponentName = (name) => {
|
|
2967
|
+
return name.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase();
|
|
2968
|
+
};
|
|
2969
|
+
components = components.map((c) => {
|
|
2970
|
+
const normalized = normalizeComponentName(c);
|
|
2971
|
+
if (availableComponents.includes(normalized)) {
|
|
2972
|
+
return normalized;
|
|
2973
|
+
}
|
|
2974
|
+
const match = availableComponents.find(
|
|
2975
|
+
(available) => available.toLowerCase() === c.toLowerCase()
|
|
2976
|
+
);
|
|
2977
|
+
return match || c;
|
|
2978
|
+
});
|
|
2966
2979
|
const invalidComponents = components.filter((c) => !availableComponents.includes(c));
|
|
2967
2980
|
if (invalidComponents.length > 0) {
|
|
2968
2981
|
console.log(chalk.red(`
|