AugurProject/augur-ui

View on GitHub
src/modules/routes/helpers/parse-string-to-array.js

Summary

Maintainability
A
0 mins
Test Coverage
export default function parseStringToArray(words, delimiter) {
  const cleanWords = cleanString(words);
  return cleanWords ? cleanWords.split(delimiter || " ") : [];
}

function cleanString(words) {
  return (words || "").replace(/\s+/g, " ").trim();
}