@es-js/core
Version:
EsJS es un lenguaje de programación con sintaxis en Español que compila a JavaScript. Esto permite a las personas hispanohablantes escribir código de manera más familiar y accesible, sin renunciar al poder y versatilidad de JavaScript.
1,297 lines (1,254 loc) • 33.9 kB
JavaScript
;
const utils = require('../utils.cjs');
let toEsJS = false;
function setToEsJS(value) {
toEsJS = value;
}
function getToEsJS() {
return toEsJS;
}
function replaceObjectNew({
from,
to
}) {
const a = toEsJS ? to : from;
const b = toEsJS ? from : to;
return {
[`new ${a}(__args)`]: `new ${b}(__args)`,
[`new ${a}.__a`]: `new ${b}.__a`,
[`new ${a}()`]: `new ${b}()`
};
}
function replaceObjectCall({
from,
to
}) {
const a = toEsJS ? to : from;
const b = toEsJS ? from : to;
return {
[`${a}(__args)`]: `${b}(__args)`,
[`${a}.__a`]: `${b}.__a`
};
}
function replaceObject({
from,
to
}) {
return {
...replaceObjectNew({
from,
to
}),
...replaceObjectCall({
from,
to
})
};
}
function replaceObjects({
objects
}) {
const rules = [];
for (const [from, to] of objects) {
rules.push(
replaceObject({
from,
to
})
);
}
return Object.assign({}, ...rules);
}
function replaceExpressionMethods({
methods
}) {
const dictionary = toEsJS ? utils.invertMap(methods) : methods;
return Object.fromEntries(
[...dictionary].map(([key, value]) => {
return [`__a.${key}`, `__a.${value}`];
})
);
}
function replaceObjectStaticMethods({
from,
to,
methods
}) {
const a = toEsJS ? to : from;
const b = toEsJS ? from : to;
const dictionary = toEsJS ? utils.invertMap(methods) : methods;
return Object.fromEntries(
[...dictionary].map(([key, value]) => {
return [`${a}.${key}`, `${b}.${value}`];
})
);
}
function replaceObjectProperties({
properties
}) {
const dictionary = toEsJS ? utils.invertMap(properties) : properties;
return Object.fromEntries(
[...dictionary].map(([key, value]) => {
return [`__a.${key}`, `__a.${value}`];
})
);
}
function replaceObjectStaticProperties({
from,
to,
properties
}) {
const a = toEsJS ? to : from;
const b = toEsJS ? from : to;
const dictionary = toEsJS ? utils.invertMap(properties) : properties;
return Object.fromEntries(
[...dictionary].map(([key, value]) => {
return [`${a}.${key}`, `${b}.${value}`];
})
);
}
function replaceGlobalMethods({
methods
}) {
const dictionary = toEsJS ? utils.invertMap(methods) : methods;
return Object.fromEntries(
[...dictionary].map(([key, value]) => {
return [key, value];
})
);
}
function replaceKeyword({
from,
to
}) {
const a = toEsJS ? to : from;
const b = toEsJS ? from : to;
return {
[a]: b
};
}
function replaceInstanceof({
from,
to
}) {
const a = toEsJS ? to : from;
const b = toEsJS ? from : to;
return {
[`__a instanceof ${a}`]: `__a instanceof ${b}`
};
}
function replaceKeywords({
keywords
}) {
const rules = [];
for (const [from, to] of keywords) {
rules.push(
replaceKeyword({
from,
to
})
);
}
return Object.assign({}, ...rules);
}
const report$i = () => "Converts Apoderado methods to JavaScript";
const staticMethods$8 = /* @__PURE__ */ new Map([
["revocable", "revocable"]
]);
const objects$f = /* @__PURE__ */ new Map([["Apoderado", "Proxy"]]);
function replace$h() {
return {
...replaceObjectStaticMethods({
from: "Apoderado",
to: "Proxy",
methods: staticMethods$8
}),
...replaceInstanceof({
from: "Apoderado",
to: "Proxy"
}),
...replaceObjects({
objects: objects$f
})
};
}
const apoderado = {
__proto__: null,
objects: objects$f,
replace: replace$h,
report: report$i,
staticMethods: staticMethods$8
};
const report$h = () => "Converts Booleano methods to JavaScript";
const methods$e = /* @__PURE__ */ new Map([]);
const objects$e = /* @__PURE__ */ new Map([["Booleano", "Boolean"]]);
function replace$g() {
return {
...replaceInstanceof({
from: "Booleano",
to: "Boolean"
}),
...replaceObjects({
objects: objects$e
})
};
}
const booleano = {
__proto__: null,
methods: methods$e,
objects: objects$e,
replace: replace$g,
report: report$h
};
const report$g = () => "Converts Cadena methods to JavaScript";
const methods$d = /* @__PURE__ */ new Map([
["enPosicion", "at"],
["caracterEn", "charAt"],
["codigoDeCaracterEn", "charCodeAt"],
["puntoDeCodigoEn", "codePointAt"],
["concatenar", "concat"],
["terminaCon", "endsWith"],
["incluye", "includes"],
["indiceDe", "indexOf"],
["ultimoIndiceDe", "lastIndexOf"],
["compararLocalizada", "localeCompare"],
["coincidir", "match"],
["coincidirTodo", "matchAll"],
["normalizar", "normalize"],
["rellenarAlFinal", "padEnd"],
["rellenarAlComienzo", "padStart"],
["repetir", "repeat"],
["reemplazar", "replace"],
["reemplazarTodo", "replaceAll"],
["buscarRegex", "search"],
["recortar", "slice"],
["dividir", "split"],
["comienzaCon", "startsWith"],
["subcadena", "substring"],
["aMinusculasLocalizada", "toLocaleLowerCase"],
["aMayusculasLocalizada", "toLocaleUpperCase"],
["aMinusculas", "toLowerCase"],
["aMayusculas", "toUpperCase"],
["aCadena", "toString"],
["recortarEspacios", "trim"],
["recortarEspaciosAlFinal", "trimEnd"],
["recortarEspaciosAlComienzo", "trimStart"],
["valorDe", "valueOf"]
]);
const staticMethods$7 = /* @__PURE__ */ new Map([
["desdeCodigoDeCaracter", "fromCharCode"],
["desdePuntoDeCodigo", "fromCodePoint"],
["crudo", "raw"]
]);
const properties$5 = /* @__PURE__ */ new Map([["longitud", "length"]]);
const objects$d = /* @__PURE__ */ new Map([["Cadena", "String"]]);
function replace$f() {
return {
...replaceObjectStaticMethods({
from: "Cadena",
to: "String",
methods: staticMethods$7
}),
...replaceExpressionMethods({
methods: methods$d
}),
...replaceObjectProperties({
properties: properties$5
}),
...replaceInstanceof({
from: "Cadena",
to: "String"
}),
...replaceObjects({
objects: objects$d
})
};
}
const cadena = {
__proto__: null,
methods: methods$d,
objects: objects$d,
properties: properties$5,
replace: replace$f,
report: report$g,
staticMethods: staticMethods$7
};
const report$f = () => "Converts consola to console";
const methods$c = /* @__PURE__ */ new Map([
["afirmar", "assert"],
["limpiar", "clear"],
["contar", "count"],
["reiniciarContador", "countReset"],
["depurar", "debug"],
["listar", "dir"],
["listarXml", "dirxml"],
["error", "error"],
["agrupar", "group"],
["agruparColapsado", "groupCollapsed"],
["finalizarAgrupacion", "groupEnd"],
["info", "info"],
["escribir", "log"],
["perfil", "profile"],
["finalizarPerfil", "profileEnd"],
["tabla", "table"],
["tiempo", "time"],
["finalizarTiempo", "timeEnd"],
["registrarTiempo", "timeLog"],
["marcaDeTiempo", "timeStamp"],
["rastrear", "trace"],
["advertencia", "warn"]
]);
const objects$c = /* @__PURE__ */ new Map([["consola", "console"]]);
function replace$e() {
return {
...replaceObjectStaticMethods({
from: "consola",
to: "console",
methods: methods$c
})
};
}
const consola = {
__proto__: null,
methods: methods$c,
objects: objects$c,
replace: replace$e,
report: report$f
};
const report$e = () => "Converts Documento methods to JavaScript";
const methods$b = /* @__PURE__ */ new Map([
["adoptarNodo", "adoptNode"],
["anexar", "append"],
["temasNavegador", "browsingTopics"],
["posicionCursorDesdePunto", "caretPositionFromPoint"],
["crearAtributo", "createAttribute"],
["crearAtributoNS", "createAttributeNS"],
["crearSeccionCDATA", "createCDATASection"],
["crearComentario", "createComment"],
["crearFragmentoDocumento", "createDocumentFragment"],
["crearElemento", "createElement"],
["crearElementoNS", "createElementNS"],
["crearIteradorNodo", "createNodeIterator"],
["crearInstruccionProcesamiento", "createProcessingInstruction"],
["crearRango", "createRange"],
["crearNodoTexto", "createTextNode"],
["crearCaminanteArbol", "createTreeWalker"],
["elementoDesdePunto", "elementFromPoint"],
["elementosDesdePunto", "elementsFromPoint"],
["salirPantallaCompleta", "exitFullscreen"],
["salirImagenEnImagen", "exitPictureInPicture"],
["salirBloqueoPuntero", "exitPointerLock"],
["obtenerAnimaciones", "getAnimations"],
["obtenerElementoPorId", "getElementById"],
["obtenerElementosPorClase", "getElementsByClassName"],
["obtenerElementosPorEtiqueta", "getElementsByTagName"],
["obtenerElementosPorEtiquetaNS", "getElementsByTagNameNS"],
["obtenerSeleccion", "getSelection"],
["tieneAccesoAlmacenamiento", "hasStorageAccess"],
["tieneAccesoCookiesSinParticiones", "hasUnpartitionedCookieAccess"],
["importarNodo", "importNode"],
["mozEstablecerElementoImagen", "mozSetImageElement"],
["anteponer", "prepend"],
["consultarSelector", "querySelector"],
["consultarTodosSelectores", "querySelectorAll"],
["liberarCaptura", "releaseCapture"],
["reemplazarHijos", "replaceChildren"],
["solicitarAccesoAlmacenamiento", "requestStorageAccess"],
["solicitarAccesoAlmacenamientoPara", "requestStorageAccessFor"],
["iniciarTransicionVista", "startViewTransition"],
["crearExpresion", "createExpression"],
["evaluar", "evaluate"],
["cerrar", "close"],
["obtenerElementosPorNombre", "getElementsByName"],
["tieneFoco", "hasFocus"],
["abrir", "open"],
["escribirLinea", "writeln"],
["analizarHTMLInseguro", "parseHTMLUnsafe"]
]);
const properties$4 = /* @__PURE__ */ new Map([
["elementoActivo", "activeElement"],
["hojasEstiloAdoptadas", "adoptedStyleSheets"],
["cuerpo", "body"],
["conjuntoCaracteres", "characterSet"],
["conteoElementosHijos", "childElementCount"],
["hijos", "children"],
["modoCompatibilidad", "compatMode"],
["tipoContenido", "contentType"],
["scriptActual", "currentScript"],
["tipoDocumento", "doctype"],
["elementoDocumento", "documentElement"],
["documentoURI", "documentURI"],
["incrustados", "embeds"],
["politicaCaracteristicas", "featurePolicy"],
["primerElementoHijo", "firstElementChild"],
["fuentes", "fonts"],
["formularios", "forms"],
["directivaFragmento", "fragmentDirective"],
["elementoPantallaCompleta", "fullscreenElement"],
["cabecera", "head"],
["oculto", "hidden"],
["imagenes", "images"],
["implementacion", "implementation"],
["ultimoElementoHijo", "lastElementChild"],
["enlaces", "links"],
["elementoImagenEnImagen", "pictureInPictureElement"],
["imagenEnImagenHabilitado", "pictureInPictureEnabled"],
["complementos", "plugins"],
["elementoBloqueoPuntero", "pointerLockElement"],
["preRenderizado", "prerendering"],
["scripts", "scripts"],
["elementoDesplazamiento", "scrollingElement"],
["hojasEstilo", "styleSheets"],
["lineaTiempo", "timeline"],
["estadoVisibilidad", "visibilityState"],
["cookie", "cookie"],
["vistaPredeterminada", "defaultView"],
["modoDise\xF1o", "designMode"],
["direccion", "dir"],
["pantallaCompletaHabilitada", "fullscreenEnabled"],
["ultimaModificacion", "lastModified"],
["ubicacion", "location"],
["estadoPreparacion", "readyState"],
["referente", "referrer"],
["titulo", "title"],
["URL", "URL"]
]);
const objects$b = /* @__PURE__ */ new Map([["Documento", "Document"]]);
function replace$d() {
return {
...replaceObjectStaticMethods({
from: "documento",
to: "document",
methods: methods$b
}),
...replaceObjectStaticProperties({
from: "documento",
to: "document",
properties: properties$4
}),
...replaceInstanceof({
from: "Documento",
to: "Document"
}),
...replaceObjects({
objects: objects$b
})
};
}
const documento = {
__proto__: null,
methods: methods$b,
objects: objects$b,
properties: properties$4,
replace: replace$d,
report: report$e
};
const report$d = () => "Converts EnteroGrande methods to JavaScript";
const staticMethods$6 = /* @__PURE__ */ new Map([
["comoEntero", "asIntN"],
["comoEnteroSinSigno", "asUintN"]
]);
const methods$a = /* @__PURE__ */ new Map([
["aCadenaLocalizada", "toLocaleString"],
["aCadena", "toString"],
["valorDe", "valueOf"]
]);
const objects$a = /* @__PURE__ */ new Map([["EnteroGrande", "BigInt"]]);
function replace$c() {
return {
...replaceObjectStaticMethods({
from: "EnteroGrande",
to: "BigInt",
methods: staticMethods$6
}),
...replaceExpressionMethods({
methods: methods$a
}),
...replaceInstanceof({
from: "EnteroGrande",
to: "BigInt"
}),
...replaceObjects({
objects: objects$a
})
};
}
const enterogrande = {
__proto__: null,
methods: methods$a,
objects: objects$a,
replace: replace$c,
report: report$d,
staticMethods: staticMethods$6
};
const report$c = () => "Converts Fecha methods to JavaScript";
const methods$9 = /* @__PURE__ */ new Map([
["obtenerDia", "getDate"],
["obtenerDiaSemana", "getDay"],
["obtenerAnio", "getFullYear"],
["obtenerA\xF1o", "getFullYear"],
["obtenerHoras", "getHours"],
["obtenerMilisegundos", "getMilliseconds"],
["obtenerMinutos", "getMinutes"],
["obtenerMes", "getMonth"],
["obtenerSegundos", "getSeconds"],
["obtenerTiempo", "getTime"],
["obtenerDesfaseDeZonaHoraria", "getTimezoneOffset"],
["obtenerDiaUTC", "getUTCDate"],
["obtenerDiaSemanaUTC", "getUTCDay"],
["obtenerAnioUTC", "getUTCFullYear"],
["obtenerA\xF1oUTC", "getUTCFullYear"],
["obtenerHorasUTC", "getUTCHours"],
["obtenerMilisegundosUTC", "getUTCMilliseconds"],
["obtenerMinutosUTC", "getUTCMinutes"],
["obtenerMesUTC", "getUTCMonth"],
["obtenerSegundosUTC", "getUTCSeconds"],
["establecerFecha", "setDate"],
["establecerAnio", "setFullYear"],
["establecerA\xF1o", "setFullYear"],
["establecerHoras", "setHours"],
["establecerMilisegundos", "setMilliseconds"],
["establecerMinutos", "setMinutes"],
["establecerMes", "setMonth"],
["establecerSegundos", "setSeconds"],
["establecerTiempo", "setTime"],
["establecerFechaUTC", "setUTCDate"],
["establecerAnioUTC", "setUTCFullYear"],
["establecerA\xF1oUTC", "setUTCFullYear"],
["establecerHorasUTC", "setUTCHours"],
["establecerMilisegundosUTC", "setUTCMilliseconds"],
["establecerMinutosUTC", "setUTCMinutes"],
["establecerMesUTC", "setUTCMonth"],
["establecerSegundosUTC", "setUTCSeconds"],
["aCadenaFecha", "toDateString"],
["aCadenaISO", "toISOString"],
["aJSON", "toJSON"],
["aCadenaFechaLocale", "toLocaleDateString"],
["aCadenaLocale", "toLocaleString"],
["aCadenaTiempoLocale", "toLocaleTimeString"],
["aCadena", "toString"],
["aCadenaTiempo", "toTimeString"],
["aCadenaUTC", "toUTCString"],
["valorDe", "valueOf"]
]);
const staticMethods$5 = /* @__PURE__ */ new Map([
["ahora", "now"],
["analizar", "parse"],
["UTC", "UTC"]
]);
const objects$9 = /* @__PURE__ */ new Map([["Fecha", "Date"]]);
function replace$b() {
return {
...replaceObjectStaticMethods({
from: "Fecha",
to: "Date",
methods: staticMethods$5
}),
...replaceExpressionMethods({
methods: methods$9
}),
...replaceInstanceof({
from: "Fecha",
to: "Date"
}),
...replaceObjects({
objects: objects$9
})
};
}
const fecha = {
__proto__: null,
methods: methods$9,
objects: objects$9,
replace: replace$b,
report: report$c,
staticMethods: staticMethods$5
};
const report$b = () => "Converts Funcion methods to JavaScript";
const methods$8 = /* @__PURE__ */ new Map([]);
const objects$8 = /* @__PURE__ */ new Map([["Funcion", "Function"]]);
function replace$a() {
return {
...replaceInstanceof({
from: "Funcion",
to: "Function"
}),
...replaceObjects({
objects: objects$8
})
};
}
const funcion = {
__proto__: null,
methods: methods$8,
objects: objects$8,
replace: replace$a,
report: report$b
};
const report$a = () => "Converts JSON methods to JavaScript";
const methods$7 = /* @__PURE__ */ new Map([]);
const staticMethods$4 = /* @__PURE__ */ new Map([
["esJSONCrudo", "isRawJSON"],
["analizar", "parse"],
["JSONCrudo", "rawJSON"],
["aTexto", "stringify"]
]);
const objects$7 = /* @__PURE__ */ new Map([["Fecha", "Date"]]);
function replace$9() {
return {
...replaceObjectStaticMethods({
from: "JSON",
to: "JSON",
methods: staticMethods$4
})
};
}
const json = {
__proto__: null,
methods: methods$7,
objects: objects$7,
replace: replace$9,
report: report$a,
staticMethods: staticMethods$4
};
const report$9 = () => "Converts Mate methods to JavaScript";
const methods$6 = /* @__PURE__ */ new Map([
["absoluto", "abs"],
["arcocoseno", "acos"],
["arcocosenoHiperbolico", "acosh"],
["arcoseno", "asin"],
["arcosenoHiperbolico", "asinh"],
["arcotangente", "atan"],
["arcotangente2", "atan2"],
["arcotangenteHiperbolica", "atanh"],
["raizCubica", "cbrt"],
["redondearHaciaArriba", "ceil"],
["cerosALaIzquierdaEn32Bits", "clz32"],
["coseno", "cos"],
["cosenoHiperbolico", "cosh"],
["exponencial", "exp"],
["exponencialMenos1", "expm1"],
["redondearHaciaAbajo", "floor"],
["redondearAComaFlotante", "fround"],
["hipotenusa", "hypot"],
["multiplicacionEntera", "imul"],
["logaritmo", "log"],
["logaritmoBase10", "log10"],
["logaritmoDe1Mas", "log1p"],
["logaritmoBase2", "log2"],
["maximo", "max"],
["minimo", "min"],
["potencia", "pow"],
["aleatorio", "random"],
["redondear", "round"],
["signo", "sign"],
["seno", "sin"],
["senoHiperbolico", "sinh"],
["raizCuadrada", "sqrt"],
["tangente", "tan"],
["tangenteHiperbolica", "tanh"],
["truncar", "trunc"]
]);
const objects$6 = /* @__PURE__ */ new Map([["Mate", "Math"]]);
const properties$3 = /* @__PURE__ */ new Map([
["PI", "PI"],
["E", "E"],
["LN2", "LN2"],
["LN10", "LN10"],
["LOG2E", "LOG2E"],
["LOG10E", "LOG10E"],
["RAIZ1_2", "SQRT1_2"],
["RAIZ2", "SQRT2"]
]);
function replace$8() {
return {
...replaceObjectStaticMethods({
from: "Mate",
to: "Math",
methods: methods$6
}),
...replaceObjectStaticProperties({
from: "Mate",
to: "Math",
properties: properties$3
})
};
}
const mate = {
__proto__: null,
methods: methods$6,
objects: objects$6,
properties: properties$3,
replace: replace$8,
report: report$9
};
const report$8 = () => "Converts Matriz methods to JavaScript";
const methods$5 = /* @__PURE__ */ new Map([
["posicion", "at"],
["concatenar", "concat"],
["copiarDentro", "copyWithin"],
["entradas", "entries"],
["cada", "every"],
["llenar", "fill"],
["filtrar", "filter"],
["buscar", "find"],
["buscarIndice", "findIndex"],
["buscarUltimo", "findLast"],
["buscarUltimoIndice", "findLastIndex"],
["plano", "flat"],
["planoMapear", "flatMap"],
["paraCada", "forEach"],
["grupo", "group"],
["grupoAMapear", "groupToMap"],
["incluye", "includes"],
["indiceDe", "indexOf"],
["juntar", "join"],
["claves", "keys"],
["ultimoIndiceDe", "lastIndexOf"],
["mapear", "map"],
["sacar", "pop"],
["agregar", "push"],
["reducir", "reduce"],
["reducirDerecha", "reduceRight"],
["reverso", "reverse"],
["sacarPrimero", "shift"],
["rodaja", "slice"],
["algun", "some"],
["ordenar", "sort"],
["empalmar", "splice"],
["aCadenaLocalizada", "toLocaleString"],
["aCadena", "toString"],
["agregarInicio", "unshift"],
["valores", "values"]
]);
const staticMethods$3 = /* @__PURE__ */ new Map([
["desde", "from"],
["desdeAsincrono", "fromAsync"],
["esMatriz", "isArray"],
["de", "of"]
]);
const objects$5 = /* @__PURE__ */ new Map([
["Arreglo", "Array"],
["Matriz", "Array"]
]);
function replace$7() {
return {
...replaceObjectStaticMethods({
from: "Matriz",
to: "Array",
methods: staticMethods$3
}),
...replaceExpressionMethods({
methods: methods$5
}),
...replaceInstanceof({
from: "Matriz",
to: "Array"
}),
...replaceInstanceof({
from: "Arreglo",
to: "Array"
}),
...replaceObjects({
objects: objects$5
})
};
}
const matriz = {
__proto__: null,
methods: methods$5,
objects: objects$5,
replace: replace$7,
report: report$8,
staticMethods: staticMethods$3
};
const report$7 = () => "Converts navegador to navigator";
const properties$2 = /* @__PURE__ */ new Map([
["credenciales", "credentials"],
["memoriaDispositivo", "deviceMemory"],
["concurrenciaHardware", "hardwareConcurrency"],
["idioma", "language"],
["idiomas", "languages"],
["puntosContactoMax", "maxTouchPoints"],
["enLinea", "onLine"],
["visorPdfHabilitado", "pdfViewerEnabled"],
["agenteUsuario", "userAgent"],
["controladorWeb", "webdriver"],
["conexion", "connection"],
["cookieHabilitada", "cookieEnabled"],
["geolocalizacion", "geolocation"],
["teclado", "keyboard"],
["bloqueos", "locks"],
["capacidadesMedio", "mediaCapabilities"],
["dispositivosMultimedia", "mediaDevices"],
["sesionMultimedia", "mediaSession"],
["permisos", "permissions"],
["presentacion", "presentation"],
["servicioTrabajo", "serviceWorker"],
["almacenamiento", "storage"],
["activacionUsuario", "userActivation"],
["datosAgenteUsuario", "userAgentData"],
["controlesVentanaSuperpuestos", "windowControlsOverlay"],
["hid", "hid"],
["serial", "serial"],
["xr", "xr"],
["bluetooth", "bluetooth"],
["portapapeles", "clipboard"]
]);
const objects$4 = /* @__PURE__ */ new Map([["navegador", "navigator"]]);
const methods$4 = /* @__PURE__ */ new Map([
["puedeCompartir", "canShare"],
["borrarInsigniaApp", "clearAppBadge"],
["obtenerBateria", "getBattery"],
["registrarControladorProtocolo", "registerProtocolHandler"],
["solicitarClavesMultimedia", "requestMediaKeySystemAccess"],
["solicitarAccesoMIDI", "requestMIDIAccess"],
["enviarBeacon", "sendBeacon"],
["establecerInsigniaApp", "setAppBadge"],
["compartir", "share"],
["vibrar", "vibrate"],
["obtenerNotificaciones", "getNotifications"]
]);
function replace$6() {
return {
...replaceObjectStaticMethods({
from: "navegador",
to: "navigator",
methods: methods$4
}),
...replaceObjects({
objects: objects$4
}),
...replaceObjectStaticProperties({
from: "navegador",
to: "navigator",
properties: properties$2
})
};
}
const navegador = {
__proto__: null,
methods: methods$4,
objects: objects$4,
properties: properties$2,
replace: replace$6,
report: report$7
};
const report$6 = () => "Converts Numero methods to JavaScript";
const methods$3 = /* @__PURE__ */ new Map([
["aExponencial", "toExponential"],
["fijarDecimales", "toFixed"],
["aCadenaLocalizada", "toLocaleString"],
["aPrecision", "toPrecision"],
["aCadena", "toString"],
["valorDe", "valueOf"]
]);
const staticMethods$2 = /* @__PURE__ */ new Map([
["esFinito", "isFinite"],
["esEntero", "isInteger"],
["esNan", "isNaN"],
["esEnteroSeguro", "isSafeInteger"],
["interpretarDecimal", "parseFloat"],
["interpretarEntero", "parseInt"]
]);
const objects$3 = /* @__PURE__ */ new Map([
["N\xFAmero", "Number"],
["Numero", "Number"]
]);
const globalMethods = /* @__PURE__ */ new Map([
["interpretarEntero", "parseInt"],
["interpretarDecimal", "parseFloat"]
]);
function replace$5() {
return {
...replaceObjectStaticMethods({
from: "N\xFAmero",
to: "Number",
methods: staticMethods$2
}),
...replaceObjectStaticMethods({
from: "Numero",
to: "Number",
methods: staticMethods$2
}),
...replaceExpressionMethods({
methods: methods$3
}),
...replaceInstanceof({
from: "Numero",
to: "Number"
}),
...replaceObjects({
objects: objects$3
}),
...replaceGlobalMethods({
methods: globalMethods
})
};
}
const numero = {
__proto__: null,
globalMethods: globalMethods,
methods: methods$3,
objects: objects$3,
replace: replace$5,
report: report$6,
staticMethods: staticMethods$2
};
const report$5 = () => "Converts prop types to JavaScript";
const types = /* @__PURE__ */ new Map([
["Numero", "Number"],
["Cadena", "String"],
["Booleano", "Boolean"],
["Objeto", "Object"],
["Arreglo", "Array"],
["Matriz", "Array"],
["Funcion", "Function"],
["Simbolo", "Symbol"],
["Fecha", "Date"],
["Error", "Error"],
["ExpReg", "RegExp"],
["Mapa", "Map"],
["Conjunto", "Set"],
["Apoderado", "Proxy"],
["EnteroGrande", "BigInt"],
["Documento", "Document"]
]);
function traverse() {
return {
ObjectProperty(path) {
const { node } = path;
if (isIdentifier(node.value)) {
const typeName = node.value.name;
const toEsJS = getToEsJS();
const dictionary = toEsJS ? utils.invertMap(types) : types;
if (dictionary.has(typeName)) {
node.value = identifier(dictionary.get(typeName));
}
}
}
};
}
function isIdentifier(node, opts) {
if (!node) {
return false;
}
return node.type === "Identifier";
}
function identifier(name) {
return {
type: "Identifier",
name
};
}
const tipos = {
__proto__: null,
report: report$5,
traverse: traverse,
types: types
};
const report$4 = () => "Converts Objects to JavaScript";
function replace$4() {
return {
...replaceObjects({
objects: types
})
};
}
const objetos = {
__proto__: null,
replace: replace$4,
report: report$4
};
const report$3 = () => "Converts Promesa methods to JavaScript";
const methods$2 = /* @__PURE__ */ new Map([
["capturar", "catch"],
["finalmente", "finally"],
["luego", "then"]
]);
const staticMethods$1 = /* @__PURE__ */ new Map([
["todos", "all"],
["todosTerminados", "allSettled"],
["cualquiera", "any"],
["carrera", "race"],
["rechaza", "reject"],
["resuelve", "resolve"]
]);
const objects$2 = /* @__PURE__ */ new Map([["Promesa", "Promise"]]);
function replace$3() {
return {
...replaceObjectStaticMethods({
from: "Promesa",
to: "Promise",
methods: staticMethods$1
}),
...replaceExpressionMethods({
methods: methods$2
}),
...replaceObjects({
objects: objects$2
})
};
}
const promesa = {
__proto__: null,
methods: methods$2,
objects: objects$2,
replace: replace$3,
report: report$3,
staticMethods: staticMethods$1
};
const report$2 = () => "Converts Simbolo methods to JavaScript";
const methods$1 = /* @__PURE__ */ new Map([
["valorDe", "valueOf"]
]);
const properties$1 = /* @__PURE__ */ new Map([
["descripcion", "description"],
["aCadenaEtiqueta", "toStringTag"]
]);
const staticProperties = /* @__PURE__ */ new Map([
["iteradorAsincrono", "asyncIterator"],
["tieneInstancia", "hasInstance"],
["esConcatenableExtendido", "isConcatSpreadable"],
["iterador", "iterator"],
["coincidir", "match"],
["coincidirTodo", "matchAll"],
["reemplazar", "replace"],
["buscarRegex", "search"],
["derivados", "species"],
["dividir", "split"],
["aPrimitivo", "toPrimitive"],
["aCadenaEtiqueta", "toStringTag"],
["excluibles", "unscopables"]
]);
const staticMethods = /* @__PURE__ */ new Map([
["para", "for"],
["paraLlave", "keyFor"]
]);
const objects$1 = /* @__PURE__ */ new Map([["Simbolo", "Symbol"]]);
function replace$2() {
return {
...replaceObjectStaticMethods({
from: "Simbolo",
to: "Symbol",
methods: staticMethods
}),
...replaceExpressionMethods({
methods: methods$1
}),
...replaceObjectProperties({
properties: properties$1
}),
...replaceInstanceof({
from: "Simbolo",
to: "Symbol"
}),
...replaceObjects({
objects: objects$1
}),
...replaceObjectStaticProperties({
from: "Simbolo",
to: "Symbol",
properties: staticProperties
})
};
}
const simbolo = {
__proto__: null,
methods: methods$1,
objects: objects$1,
properties: properties$1,
replace: replace$2,
report: report$2,
staticMethods: staticMethods,
staticProperties: staticProperties
};
const report$1 = () => "Converts support functions to JavaScript";
const keywords = /* @__PURE__ */ new Map([
["establecerTemporizador", "setTimeout"],
["establecerIntervalo", "setInterval"],
["esNuN", "isNaN"],
["limpiarTemporizador", "clearTimeout"],
["limpiarIntervalo", "clearInterval"],
["alerta", "alert"],
["preguntar", "prompt"],
["confirmar", "confirm"],
["consultar", "fetch"],
["decodificarURI", "decodeURI"],
["decodificarComponenteURI", "decodeURIComponent"],
["codificarURI", "encodeURI"],
["codificarComponenteURI", "encodeURIComponent"]
]);
function replace$1() {
return {
...replaceKeywords({
keywords
})
};
}
const soporte = {
__proto__: null,
keywords: keywords,
replace: replace$1,
report: report$1
};
const report = () => "Converts ventana to window";
const properties = /* @__PURE__ */ new Map([
["caches", "caches"],
["cerrado", "closed"],
["consola", "console"],
["cookieAlmacen", "cookieStore"],
["sinCredenciales", "credentialless"],
["origenCruzadoAislado", "crossOriginIsolated"],
["cripto", "crypto"],
["elementosPersonalizados", "customElements"],
["relacionPixelesDispositivo", "devicePixelRatio"],
["documento", "document"],
["documentoImagenEnImagen", "documentPictureInPicture"],
["barrera", "fence"],
["elementoMarco", "frameElement"],
["marcos", "frames"],
["pantallaCompleta", "fullScreen"],
["historia", "history"],
["BDindexada", "indexedDB"],
["alturaInterna", "innerHeight"],
["anchuraInterna", "innerWidth"],
["esContextoSeguro", "isSecureContext"],
["colaLanzamiento", "launchQueue"],
["longitud", "length"],
["almacenamientoLocal", "localStorage"],
["ubicacion", "location"],
["barraUbicacion", "locationbar"],
["barraMenu", "menubar"],
["pantallaInternaXmoz", "mozInnerScreenX"],
["pantallaInternaYmoz", "mozInnerScreenY"],
["nombre", "name"],
["navegacion", "navigation"],
["navegador", "navigator"],
["abridor", "opener"],
["origen", "origin"],
["clusterAgentesOrigen", "originAgentCluster"],
["alturaExterna", "outerHeight"],
["anchuraExterna", "outerWidth"],
["desplazamientoPaginaX", "pageXOffset"],
["desplazamientoPaginaY", "pageYOffset"],
["padre", "parent"],
["rendimiento", "performance"],
["barraPersonal", "personalbar"],
["programador", "scheduler"],
["pantalla", "screen"],
["pantallaX", "screenX"],
["pantallaIzquierda", "screenLeft"],
["pantallaY", "screenY"],
["pantallaSuperior", "screenTop"],
["barrasDesplazamiento", "scrollbars"],
["desplazamientoXmax", "scrollMaxX"],
["desplazamientoYmax", "scrollMaxY"],
["desplazamientoX", "scrollX"],
["desplazamientoY", "scrollY"],
["miMismo", "self"],
["almacenamientoSesion", "sessionStorage"],
["almacenamientoCompartido", "sharedStorage"],
["sintesisVoz", "speechSynthesis"],
["barraEstado", "statusbar"],
["barraHerramientas", "toolbar"],
["arriba", "top"],
["tiposConfiable", "trustedTypes"],
["ventanaGrafica", "visualViewport"],
["ventana", "window"]
]);
const objects = /* @__PURE__ */ new Map([["ventana", "window"]]);
const methods = /* @__PURE__ */ new Map([
["decodificarBase64", "atob"],
["alerta", "alert"],
["codificarBase64", "btoa"],
["cancelarCuadroAnimacion", "cancelAnimationFrame"],
["cancelarCallbackInactivo", "cancelIdleCallback"],
["limpiarIntervalo", "clearInterval"],
["limpiarTemporizador", "clearTimeout"],
["cerrar", "close"],
["confirmar", "confirm"],
["crearMapaBitsImagen", "createImageBitmap"],
["volcar", "dump"],
["consultar", "fetch"],
["buscar", "find"],
["enfocar", "focus"],
["obtenerEstiloComputado", "getComputedStyle"],
["obtenerEstiloComputadoPorDefecto", "getDefaultComputedStyle"],
["obtenerDetallesPantalla", "getScreenDetails"],
["obtenerSeleccion", "getSelection"],
["coincidirMedios", "matchMedia"],
["moverPor", "moveBy"],
["moverA", "moveTo"],
["abrir", "open"],
["publicarMensaje", "postMessage"],
["imprimir", "print"],
["preguntar", "prompt"],
["consultarFuentesLocales", "queryLocalFonts"],
["encolarMicrotarea", "queueMicrotask"],
["reportarError", "reportError"],
["solicitarCuadroAnimacion", "requestAnimationFrame"],
["solicitarCallbackInactivo", "requestIdleCallback"],
["redimensionarPor", "resizeBy"],
["redimensionarA", "resizeTo"],
["desplazar", "scroll"],
["desplazarPor", "scrollBy"],
["desplazarPorLineas", "scrollByLines"],
["desplazarPorPaginas", "scrollByPages"],
["desplazarA", "scrollTo"],
["establecerIntervalo", "setInterval"],
["establecerTemporizador", "setTimeout"],
["mostrarSelectorDirectorio", "showDirectoryPicker"],
["mostrarSelectorAbrirArchivo", "showOpenFilePicker"],
["mostrarSelectorGuardarArchivo", "showSaveFilePicker"],
["parar", "stop"],
["clonEstructurado", "structuredClone"]
]);
function replace() {
return {
...replaceObjectStaticMethods({
from: "ventana",
to: "window",
methods
}),
...replaceObjects({
objects
}),
...replaceObjectStaticProperties({
from: "ventana",
to: "window",
properties
})
};
}
const ventana = {
__proto__: null,
methods: methods,
objects: objects,
properties: properties,
replace: replace,
report: report
};
const plugins = [
["consola", consola],
["matriz", matriz],
["cadena", cadena],
["fecha", fecha],
["numero", numero],
["promesa", promesa],
["mate", mate],
["booleano", booleano],
["funcion", funcion],
["soporte", soporte],
["json", json],
["navegador", navegador],
["ventana", ventana],
["apoderado", apoderado],
["simbolo", simbolo],
["enterogrande", enterogrande],
["documento", documento],
["tipos", tipos],
["objetos", objetos]
];
exports.plugins = plugins;
exports.setToEsJS = setToEsJS;