Skip to content

Instantly share code, notes, and snippets.

View JoshuaKimsey's full-sized avatar
🐺

Joshua Kimsey JoshuaKimsey

🐺
View GitHub Profile
const csvStringToArray = strData =>
{
const objPattern = new RegExp(("(\\,|\\r?\\n|\\r|^)(?:\"([^\"]*(?:\"\"[^\"]*)*)\"|([^\\,\\r\\n]*))"),"gi");
let arrMatches = null, arrData = [[]];
while (arrMatches = objPattern.exec(strData)){
if (arrMatches[1].length && arrMatches[1] !== ",")arrData.push([]);
arrData[arrData.length - 1].push(arrMatches[2] ?
arrMatches[2].replace(new RegExp( "\"\"", "g" ), "\"") :
arrMatches[3]);
}
@passcod
passcod / .gitignore
Last active August 6, 2023 00:24
License stats for crates on crates.io
/metacrate-*