/
githubmirror
/
tesseract.js
Обзор
Документация
Войти
/
githubmirror
/
tesseract.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/utils/resolvePaths.js
15 строк
413 B
Frazer Smith
Add strict mode directive (#1003)
01 апр 2025, 08:31
Не верифицирован
01 апр 2025, 08:31
ff0e327
Код
Авторство
О чём код?
'use strict'; const isBrowser = require('./getEnvironment')('type') === 'browser'; const resolveURL = isBrowser ? s => (new URL(s, window.location.href)).href : s => s; // eslint-disable-line module.exports = (options) => { const opts = { ...options }; ['corePath', 'workerPath', 'langPath'].forEach((key) => { if (options[key]) { opts[key] = resolveURL(opts[key]); } }); return opts; };