Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(() => transforms.transformReferenceIdentifiers(oldPath, changeCase.pascal(oldName), changeCase.pascal(newName)))
.then(() => transforms.transformReferenceIdentifiers(oldPath, changeCase.camel(oldName), changeCase.camel(newName)));
if (prefix !== '') {
if (!size) {
if (isGlyph) {
return prefix + pascal(name) + 'Glyph';
}
return prefix + pascal(name);
}
return prefix + pascal(name) + size;
}
if (!size) {
if (isGlyph) {
return pascal(name) + 'Glyph';
}
return pascal(name);
}
if (isNaN(name[0])) {
return pascal(name) + size;
}
return '_' + pascal(name) + size;
}
ngModelController.$validators.variableNameUnique = function (value) {
var variableName = $scope.$parent.isClass ? pascalcase(value) : camelcase(value);
var allVariableNames = $scope.allVariableNames();
var result = !_.contains(allVariableNames, variableName);
return result;
};
}
return prefix + pascal(name) + size;
}
if (!size) {
if (isGlyph) {
return pascal(name) + 'Glyph';
}
return pascal(name);
}
if (isNaN(name[0])) {
return pascal(name) + size;
}
return '_' + pascal(name) + size;
}
export default function componentTransformer (file, options) {
let { oldName, newName, oldPath, newPath } = options;
return transforms.transformIdentifiers(file, pascal(oldName), pascal(newName))
.then(() => transforms.transformIdentifiers(file, camel(oldName), camel(newName)))
.then(() => transforms.transformMetadata(file, null, oldName, newName))
.then(() => transforms.transformReferences('components', oldPath, newPath, oldName, newName))
.then(() => transforms.transformReferenceIdentifiers(oldPath, pascal(oldName), pascal(newName)))
.then(() => transforms.transformReferenceIdentifiers(oldPath, camel(oldName), camel(newName)));
}
.map((table) => {
const constraints = table.constraints;
const tsProperties: string = Object.values(table.columns)
.map((column) => mapDbMetaColumnToTypescriptProperty(column, constraints, enums))
.join("\n");
return `export interface I${pascal(table.name)} {\n${tsProperties}\n}`;
})
.join("\n\n");
static toControllerName(name) {
name = changeCase.pascal(name);
name = name.replace(/Ctrl$/, 'Controller');
if (!name.match(/Controller$/)) {
name += 'Controller';
}
return name;
}
function getModuleName(name, size, prefixParts) {
const prefix = prefixParts
.filter(size => isNaN(size))
.map(pascal)
.join('');
if (prefix !== '') {
if (!size) {
return prefix + pascal(name) + 'Glyph';
}
return prefix + pascal(name) + size;
}
if (!size) {
return pascal(name) + 'Glyph';
}
if (isNaN(name[0])) {
return pascal(name) + size;
}
return '_' + pascal(name) + size;
}
(sourceName: string) => new Handlebars.SafeString(changeCase.pascal(sourceName)),
);
iconFiles.forEach((file: string) => {
const sourceFilePath: string = path.resolve(sourceDir, file);
const fileName: string = pascal(getFileNameFromPath(sourceFilePath));
const destFilePath: string = path.resolve(destDir, `${fileName}.tsx`);
const reactNativeSvgSource: string = createReactNativeSvgSource(sourceFilePath);
fs.writeFileSync(destFilePath, reactNativeSvgSource);
});
}