/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
lib/util/extractUrlAndGlobal.js
19 строк
570 B
Aviv Keller
refactor: add basic descriptions (#20787)
10 апр 2026, 18:52
Не верифицирован
10 апр 2026, 18:52
16857f0
Код
Авторство
О чём код?
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Sam Chen @chenxsan */ "use strict"; /** * Returns script url and its global variable. * @param {string} urlAndGlobal the script request * @returns {string[]} script url and its global variable */ module.exports = function extractUrlAndGlobal(urlAndGlobal) { const index = urlAndGlobal.indexOf("@"); if (index <= 0 || index === urlAndGlobal.length - 1) { throw new Error(`Invalid request "${urlAndGlobal}"`); } return [urlAndGlobal.slice(index + 1), urlAndGlobal.slice(0, index)]; };