project bootstrap

This commit is contained in:
2023-11-25 18:12:47 -05:00
parent 5cd875ae80
commit 6ef22d88f9
39139 changed files with 4944609 additions and 2 deletions
+27
View File
@@ -0,0 +1,27 @@
"use strict";
exports.__esModule = true;
exports.expandState = expandState;
var _path = _interopRequireDefault(require("path"));
var _camelcase = _interopRequireDefault(require("camelcase"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const validCharacters = /[^a-zA-Z0-9_-]/g;
function getComponentName(state) {
if (!state.filePath) return 'SvgComponent';
const pascalCaseFileName = (0, _camelcase.default)(_path.default.parse(state.filePath).name.replace(validCharacters, ''), {
pascalCase: true
});
return `Svg${pascalCaseFileName}`;
}
function expandState(state) {
return {
componentName: state.componentName || getComponentName(state),
...state
};
}