* Gets data to send to webworker * * @param {string} code * @param {string} lang * @return {object}
(code, lang)
| 173 | * @return {object} |
| 174 | */ |
| 175 | function _getWorkerData(code, lang) { |
| 176 | let options = {}; |
| 177 | if (typeof lang === 'object') { |
| 178 | options = lang; |
| 179 | lang = options.language; |
| 180 | } |
| 181 | |
| 182 | lang = aliases[lang] || lang; |
| 183 | |
| 184 | const workerData = { |
| 185 | id: id++, |
| 186 | code, |
| 187 | lang, |
| 188 | options: _getPrismOptions(options), |
| 189 | isNode |
| 190 | }; |
| 191 | |
| 192 | return workerData; |
| 193 | } |
| 194 | |
| 195 | /** |
| 196 | * Browser Only - Sends messages to web worker to highlight elements passed |
no test coverage detected