Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
unhideCard(cardName) {
const name = lowerCase(camelCase(cardName));
const cards = this.stations
? this.stations.reduce((acc, s) => acc.concat(s.cards), [])
: [];
cards.forEach(card => {
if (
card &&
(lowerCase(camelCase(card.name)) === name ||
lowerCase(camelCase(card.component)) === name)
) {
card.hidden = false;
}
});
}
// Command Line
function currentLayer(newLayerName, layerName) {
// UpperCase
let name = newLayerName.replace(/%\*u%/gi, changeCase.upperCase(layerName))
// LowerCase
name = name.replace(/%\*l%/gi, changeCase.lowerCase(layerName))
// Title Case
name = name.replace(/%\*t%/gi, toTitleCase(layerName))
// UpperCase First
name = name.replace(/%\*uf%/gi, changeCase.upperCaseFirst(layerName))
// Camel Case
name = name.replace(/%\*c%/gi, changeCase.camelCase(layerName))
// Param Case
name = name.replace(/%\*pc%/gi, changeCase.paramCase(layerName))
// Layername
name = name.replace(/%\*/g, layerName)
{item.hasChildren &&
(menuOpen && currentMenu === item.label ? (
) : (
))}
<div>
{docsTableOfContents[lowerCase(item.label)] &&
docsTableOfContents[lowerCase(item.label)].children.map(
child => this.renderNode(child, true)
)}
</div>
))}
const packageCase = (input) => lowerCase(camelCase(input))
? tasks.filter(({ node: { metadata: { name } } }) =>
lowerCase(name).includes(searchTerm)
)
{() => null}
{ItemRenderer}
) : (
No
{filter ? ` ${lowerCase(filter)}` : ''} tasks available
)}
);
}
}
getPageInfo() {
const menuItem = DOCS_MENU_ITEMS.find(
({ path }) =>
window.location.pathname !== DOCS_PATH_PREFIX &&
path !== DOCS_PATH_PREFIX &&
window.location.pathname.startsWith(path)
);
if (!menuItem) {
return null;
}
const rootNode = docsTableOfContents[lowerCase(menuItem.label)];
return this.findChildFromRootNode(rootNode) || rootNode;
}
getPageInfo() {
const menuItem = DOCS_MENU_ITEMS.find(
({ path }) =>
window.location.pathname !== DOCS_PATH_PREFIX &&
path !== DOCS_PATH_PREFIX &&
window.location.pathname.startsWith(path)
);
if (!menuItem) {
return null;
}
const rootNode = docsTableOfContents[lowerCase(menuItem.label)];
return this.findChildFromRootNode(rootNode);
}
render() {
const { sortBy, sortDirection, tasks } = this.state;
const { classes, filter, searchTerm } = this.props;
const iconSize = 16;
const items = createSortedTasks(
tasks,
sortBy,
sortDirection,
filter,
lowerCase(searchTerm)
);
const itemCount = items.length;
const ItemRenderer = ({ index, style }) => {
const taskGroup = items[index].node;
return (
cards.forEach(card => {
if (
card &&
(lowerCase(camelCase(card.name)) === name ||
lowerCase(camelCase(card.component)) === name)
) {
card.hide();
}
});
}