Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function ordinalFromAccessory(guid: string) {
const name = getAccessoryName(guid);
if (!name) {
return 1;
}
const parts = name.split("_");
return Number(parts[parts.length - 1]);
}
return createSelector(accessorizerBehavior, behavior => {
if (!behavior) {
return null;
}
const { accessories } = behavior.templateData;
const accessory = getAccessoryOfType(accessories, accessoryType);
if (!accessory) {
return null;
}
return getAccessoryName(accessory);
});
}