oportunidades 8
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-14 08:25:30 +02:00
parent 287e991486
commit ba1c0340ea
9112 changed files with 2199795 additions and 856 deletions
@@ -0,0 +1,19 @@
'use strict';
module.exports = (key) => {
const env = {};
if (typeof WorkerGlobalScope !== 'undefined') {
env.type = 'webworker';
} else if (typeof document === 'object') {
env.type = 'browser';
} else if (typeof process === 'object' && typeof require === 'function') {
env.type = 'node';
}
if (typeof key === 'undefined') {
return env;
}
return env[key];
};
@@ -0,0 +1,5 @@
'use strict';
module.exports = (prefix, cnt) => (
`${prefix}-${cnt}-${Math.random().toString(16).slice(3, 8)}`
);
@@ -0,0 +1,11 @@
'use strict';
let logging = false;
exports.logging = logging;
exports.setLogging = (_logging) => {
logging = _logging;
};
exports.log = (...args) => (logging ? console.log.apply(this, args) : null);
@@ -0,0 +1,15 @@
'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;
};