Skip to content

Instantly share code, notes, and snippets.

@ridomin
Created February 10, 2021 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ridomin/db71d86bbb03a0c33b48f324adc0ddd9 to your computer and use it in GitHub Desktop.
Save ridomin/db71d86bbb03a0c33b48f324adc0ddd9 to your computer and use it in GitHub Desktop.
geLlinesFromTextArea.js
/**
* @param {string} id - element id
* @returns {HTMLElement}
*/
const gbid = (id) => {
const el = document.getElementById(id)
if (el === null) {
throw new Error('element not found: ' + id)
}
return el
}
const lines = gbid('repos').value.replace(/(\r\n|\n|\r)/gm, '').split(';')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment