1
0
mirror of https://github.com/Lissy93/dashy.git synced 2025-04-08 17:06:18 +02:00

🩹 Removes trailing curly brace

This commit is contained in:
Alicia Sykes 2021-10-27 22:02:06 +01:00
parent b3b84c6a13
commit f135de5129

@ -30,7 +30,7 @@ export const sanitize = (string) => {
const makeItemId = (sectionStr, itemStr, index) => {
const charSum = sectionStr.split('').map((a) => a.charCodeAt(0)).reduce((x, y) => x + y);
const itemTitleStr = itemStr.replace(/\s+/g, '-').replace(/[^a-zA-Z ]/g, '').toLowerCase();
return `${index}_${charSum}_${itemTitleStr}}`;
return `${index}_${charSum}_${itemTitleStr}`;
};
/* Given an array of sections, apply a unique ID to each item, and return modified array */