Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Añadir parte del EsDom API #9

Open
wants to merge 32 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c9871f1
Añadir @es-js/runtime
Trollhunters501PC Nov 2, 2024
059d932
Arreglar Error
Trollhunters501PC Nov 2, 2024
dd9d530
Añadir recomentacion de coderabbitai
Trollhunters501PC Nov 2, 2024
17e8d2d
Añadir ventana, navegador y algunas funciones
Trollhunters501PC Nov 9, 2024
4123e43
añadir mas funciones
Trollhunters501PC Nov 9, 2024
17ba72d
Arreglar Error
Trollhunters501PC Nov 9, 2024
bf2da0d
Arreglar
Trollhunters501PC Nov 9, 2024
b24ed2d
Añadir Apoderado = Proxy
Trollhunters501PC Nov 9, 2024
ac72d9a
Añadir tipos
Trollhunters501PC Nov 9, 2024
bdc5860
.
Trollhunters501PC Nov 9, 2024
0a7ff97
añadir mas funciones,
Trollhunters501PC Nov 9, 2024
b9a220b
Arreglar Error en Simbolo
Trollhunters501PC Nov 9, 2024
e3913e1
Añadir Numero Grande
Trollhunters501PC Nov 10, 2024
47341ed
Arreglar Proxy y añadir NumeroGrande a tipos
Trollhunters501PC Nov 10, 2024
11d2c6f
Añadir Documento
Trollhunters501PC Nov 12, 2024
7f96e0d
Merge branch 'develop' into main-runtime
enzonotario Nov 12, 2024
1bda6df
Arreglar Errores
Trollhunters501PC Nov 13, 2024
f60f5aa
Arreglar error de ventana caches
Trollhunters501PC Nov 14, 2024
c7f2644
Arreglar propiedades de simbolo
Trollhunters501PC Nov 20, 2024
16b6683
Cambiar documento a document estatico
Trollhunters501PC Nov 20, 2024
b379625
Arreglar simbolo aCadena propiedad a etiquetaCadena
Trollhunters501PC Nov 20, 2024
0c4ff03
Arreglar Documento
Trollhunters501PC Nov 20, 2024
ead21f9
chore(tests): add Plugins fixtures
enzonotario Nov 22, 2024
02e8f78
chore(tests): plugins fixtures
enzonotario Nov 22, 2024
8216fbf
Update packages/core/src/plugins/ventana/index.ts
enzonotario Nov 22, 2024
928fbd3
Update packages/core/src/plugins/documento/index.ts
enzonotario Nov 22, 2024
88d5a56
Update packages/core/src/plugins/ventana/index.ts
enzonotario Nov 22, 2024
d5b357a
Update packages/core/src/plugins/documento/index.ts
enzonotario Nov 22, 2024
30b3fce
Update packages/core/src/plugins/documento/index.ts
enzonotario Nov 22, 2024
b2186ca
change(documento): cambiar `agregar` por `anexar`; eliminar funciones…
enzonotario Nov 28, 2024
ae5c4c3
chore(documento): fix fixture
enzonotario Nov 28, 2024
59f7e68
Update packages/core/src/plugins/ventana/index.ts
enzonotario Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 140 additions & 0 deletions packages/core/src/plugins/documento/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
import {
replaceExpressionMethods,
enzonotario marked this conversation as resolved.
Show resolved Hide resolved
replaceInstanceof,
replaceObjectStaticProperties,
replaceObjectStaticMethods,
replaceObjects,
} from '../utils'

export const report = () => 'Converts Documento methods to JavaScript'
enzonotario marked this conversation as resolved.
Show resolved Hide resolved

export const methods = new Map<string, string>([
['adoptarNodo', 'adoptNode'],
['agregar', 'append'],
['temasNavegador', 'browsingTopics'],
enzonotario marked this conversation as resolved.
Show resolved Hide resolved
['posicionCursorPunto', 'caretPositionFromPoint'],
['rangoCursorPunto', 'caretRangeFromPoint'],
['crearAtributo', 'createAttribute'],
['crearAtributoNS', 'createAttributeNS'],
['crearSeccionCDATA', 'createCDATASection'],
['crearComentario', 'createComment'],
['crearFragmentoDocumento', 'createDocumentFragment'],
['crearElemento', 'createElement'],
['crearElementoNS', 'createElementNS'],
['crearEvento', 'createEvent'],
['crearIteradorNodo', 'createNodeIterator'],
['crearInstruccionProcesamiento', 'createProcessingInstruction'],
['crearRango', 'createRange'],
['crearNodoTexto', 'createTextNode'],
['crearToque', 'createTouch'],
['crearListaToque', 'createTouchList'],
['crearCaminanteArboles', 'createTreeWalker'],
['elementoDesdePunto', 'elementFromPoint'],
['elementosDesdePunto', 'elementsFromPoint'],
['salirPantallaCompleta', 'exitFullscreen'],
['salirPantallaEnPantalla', 'exitPictureInPicture'],
['salirBloqueoPuntero', 'exitPointerLock'],
['obtenerAnimaciones', 'getAnimations'],
['obtenerElementoPorId', 'getElementById'],
['obtenerElementosPorNombreClase', 'getElementsByClassName'],
['obtenerElementosPorNombreEtiqueta', 'getElementsByTagName'],
['obtenerElementosPorNombreNSEtiqueta', 'getElementsByTagNameNS'],
['obtenerSeleccion', 'getSelection'],
['tieneAccesoAlmacenamiento', 'hasStorageAccess'],
['tieneAccesoCookiesSinParticiones', 'hasUnpartitionedCookieAccess'],
['importarNodo', 'importNode'],
['mozEstablecerElementoImagen', 'mozSetImageElement'],
['anteponer', 'prepend'],
['consultarSeleccion', 'querySelector'],
['consultarSelectoresTodo', 'querySelectorAll'],
['liberarCaptura', 'releaseCapture'],
['reemplazarSecundario', 'replaceChildren'],
['solicitarAccesoAlmacenamiento', 'requestStorageAccess'],
['solicitarAccesoAlmacenamientoPara', 'requestStorageAccessFor'],
enzonotario marked this conversation as resolved.
Show resolved Hide resolved
['iniciarVerTransicion', 'startViewTransition'],
['crearExpresion', 'createExpression'],
['crearSolucionarNS', 'createNSResolver'],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Corrección de traducción: 'createNSResolver' debería ser 'crearResolverNS'

El método 'createNSResolver' se traduce más apropiadamente como 'crearResolverNS', ya que 'resolver' es 'resolver' en este contexto. 'Solucionar' se refiere más a 'solve' que a 'resolve'.

Aplicar el siguiente cambio:

-['crearSolucionarNS', 'createNSResolver'],
+['crearResolverNS', 'createNSResolver'],
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
['crearSolucionarNS', 'createNSResolver'],
['crearResolverNS', 'createNSResolver'],

['evaluar', 'evaluate'],
['cerrar', 'close'],
['ejecutarComando', 'execCommand'],
['obtenerElementosPorNombre', 'getElementsByName'],
['estaEnfocado', 'hasFocus'],
['abrir', 'open'],
['consultarComandoActivo', 'queryCommandEnabled'],
['escribir', 'write'],
['escribirEn', 'writeln'],
enzonotario marked this conversation as resolved.
Show resolved Hide resolved
['analizarHTMLInseguro', 'parseHTMLUnsafe']
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Verificar la existencia del método parseHTMLUnsafe en el objeto document

El método parseHTMLUnsafe no es estándar y no existe en el objeto document. Esto puede causar errores en tiempo de ejecución. Se recomienda eliminar esta línea o reemplazarla por una implementación válida.

])

export const properties = new Map<string, string>([
['elementoActivo', 'activeElement'],
['hojasEstiloAdoptadas', 'adoptedStyleSheets'],
['cuerpo', 'body'],
['conjuntoCaracteres', 'characterSet'],
['longitudElementosSecundarios', 'childElementCount'],
['secundarios', 'children'],
Comment on lines +71 to +72
Copy link

@coderabbitai coderabbitai bot Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Unificar terminología: Reemplazar 'Secundario' por 'Hijo'

El término "hijo" es la traducción más comúnmente aceptada para "child" en programación y DOM. Se recomienda reemplazar "Secundario" por "Hijo" para mejorar la claridad y alinearse con las convenciones estándar.

Aplicar el siguiente cambio:

-['longitudElementosSecundarios', 'childElementCount'],
-['secundarios', 'children'],
-['primerElementoSecundario', 'firstElementChild'],
-['ultimoElementoSecundario', 'lastElementChild'],
+['longitudElementosHijos', 'childElementCount'],
+['hijos', 'children'],
+['primerElementoHijo', 'firstElementChild'],
+['ultimoElementoHijo', 'lastElementChild'],

Also applies to: 87-87, 96-96

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crea un commit para esto

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enzonotario, entiendo su solicitud, pero no puedo crear un commit directamente en el repositorio. Por favor, aplique el cambio sugerido en su entorno local y realice el commit correspondiente.

Comment on lines +71 to +72
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Unificar terminología: Reemplazar 'Secundario' por 'Hijo'

El término "hijo" es más apropiado para referirse a 'child' en el contexto del DOM.

Aplicar los siguientes cambios:

- ['longitudElementosSecundarios', 'childElementCount'],
- ['secundarios', 'children'],
- ['primerElementoSecundario', 'firstElementChild'],
- ['ultimoElementoSecundario', 'lastElementChild'],
+ ['longitudElementosHijos', 'childElementCount'],
+ ['hijos', 'children'],
+ ['primerElementoHijo', 'firstElementChild'],
+ ['ultimoElementoHijo', 'lastElementChild'],

Also applies to: 84-85, 93-93

['modoEstricto', 'compatMode'],
['tipoContenido', 'contentType'],
['scriptActual', 'currentScript'],
['tipoDoc', 'doctype'],
['elementoDocumento', 'documentElement'],
['documentoURI', 'documentURI'],
['incrustados', 'embeds'],
['politicaCaracteristicas', 'featurePolicy'],
['primerElementoSecundario', 'firstElementChild'],
['fuentes', 'fonts'],
['formularios', 'forms'],
['fragmentoDirectivo', 'fragmentDirective'],
['elementoPantallaCompleta', 'fullscreenElement'],
['cabecera', 'head'],
['oculta', 'hidden'],
['imagenes', 'images'],
['implementacion', 'implementation'],
['ultimoElementoSecundario', 'lastElementChild'],
['links', 'links'],
['elementoImagenEnImagen', 'pictureInPictureElement'],
['imagenEnImagenActivo', 'pictureInPictureEnabled'],
Copy link

@coderabbitai coderabbitai bot Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Corrección de traducción: Reemplazar 'Activo/Activa' por 'Habilitado/Habilitada'

La palabra "Enabled" se traduce más apropiadamente como "Habilitado" o "Habilitada" en lugar de "Activo/Activa". Para mayor precisión en la traducción de las propiedades, se sugiere actualizar los nombres.

Aplicar el siguiente cambio:

-['imagenEnImagenActivo', 'pictureInPictureEnabled'],
+['imagenEnImagenHabilitado', 'pictureInPictureEnabled'],

-['pantallaCompletaActiva', 'fullscreenEnabled'],
+['pantallaCompletaHabilitada', 'fullscreenEnabled'],

Also applies to: 112-112

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crea un commit para esto

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enzonotario, lo siento, pero no tengo la capacidad de crear commits en el repositorio. Sin embargo, puedes aplicar los cambios sugeridos para corregir las traducciones.

Copy link

@coderabbitai coderabbitai bot Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Corrección de traducción: Reemplazar 'Activo/Activa' por 'Habilitado/Habilitada'

Para mayor precisión, se sugiere usar 'Habilitado' en lugar de 'Activo'.

Aplicar los siguientes cambios:

- ['imagenEnImagenActivo', 'pictureInPictureEnabled'],
+ ['imagenEnImagenHabilitado', 'pictureInPictureEnabled'],

- ['pantallaCompletaActiva', 'fullscreenEnabled'],
+ ['pantallaCompletaHabilitada', 'fullscreenEnabled'],

Also applies to: 109-109

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crea un commit para esto

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enzonotario, entiendo tu solicitud, pero como asistente, no puedo crear commits directamente en el repositorio. Por favor, aplica los cambios sugeridos manualmente en tu PR.

['complementos', 'plugins'],
['bloqueoPunteroElemento', 'pointerLockElement'],
['preRenderizacion', 'prerendering'],
['scripts', 'scripts'],
['desplazarElemento', 'scrollingElement'],
['hojasEstilo', 'styleSheets'],
['lineaTiempo', 'timeline'],
['estadoVisibilidad', 'visibilityState'],
['cookie', 'cookie'],
['vistaPorDefecto', 'defaultView'],
['modoDiseño', 'designMode'],
['dir', 'dir'],
['pantallaCompletaActiva', 'fullscreenEnabled'],
['ultimaModificacion', 'lastModified'],
['ubicacion', 'location'],
['estadoCarga', 'readyState'],
['referencia', 'referrer'],
['titulo', 'title'],
['URL', 'URL']
])

export const objects = new Map<string, string>([['Documento', 'Document']])

export function replace() {
return {
...replaceObjectStaticMethods({
from: 'documento',
to: 'document',
methods: methods,
}),
...replaceObjectStaticProperties({
from: 'documento',
to: 'document',
properties,
}),
...replaceInstanceof({
from: 'Documento',
to: 'Document',
}),
...replaceObjects({
objects,
}),
enzonotario marked this conversation as resolved.
Show resolved Hide resolved
}
}
12 changes: 12 additions & 0 deletions packages/core/src/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import * as soporte from './soporte'
import * as funcion from './funcion'
import * as json from './json'
import * as tipos from './tipos'
import * as navegador from './navegador'
import * as ventana from './ventana'
import * as puente from './puente'
import * as simbolo from './simbolo'
import * as numerogrande from './numerogrande'
import * as documento from './documento'

export const plugins = [
['consola', consola],
Expand All @@ -25,6 +31,12 @@ export const plugins = [
['soporte', soporte],
['json', json],
['tipos', tipos],
['navegador', navegador],
['ventana', ventana],
['puente', puente],
['simbolo', simbolo],
['numerogrande', numerogrande],
['documento', documento]
]

export { setToEsJS }
72 changes: 72 additions & 0 deletions packages/core/src/plugins/navegador/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import {
replaceObjectStaticMethods,
replaceObjectStaticProperties,
replaceObjects
} from '../utils'
export const report = () => 'Converts navegador to navigator'

export const properties = new Map<string, string>([
["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"],
["claves", "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"],
["re", "xr"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Sugerencia: Revisar la traducción de 're' a 'xr'

La clave "re" se está traduciendo a "xr". Puede que "re" no sea la representación más clara en español para "XR" (realidad extendida). Considera utilizar "xr" directamente o una traducción más descriptiva como "realidadExtendida".

])

export const objects = new Map<string, string>([['navegador', 'navigator']])

export const methods = new Map<string, string>([
["puedeCompartir", "canShare"],
["borrarInsigniaApp", "clearAppBadge"],
["obtenerBateria", "getBattery"],
["registrarControladorProtocolo", "registerProtocolHandler"],
["solicitarClavesMultimedia", "requestMediaKeySystemAccess"],
["solicitarAccesoMIDI", "requestMIDIAccess"],
["enviarBeacon", "sendBeacon"],
["establecerInsigniaApp", "setAppBadge"],
["compartir", "share"],
["vibrar", "vibrate"],
['javaHabilitado', 'javaEnabled'],
['obtenerNotificaciones', 'getNotifications']
])
Comment on lines +52 to +54
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Mantener consistencia en el uso de comillas

En las líneas 52 a 54, las claves están entre comillas simples ('javaHabilitado', 'obtenerNotificaciones'), mientras que en el resto del archivo se utilizan comillas dobles. Para mantener la consistencia y legibilidad, sería recomendable unificar el estilo de comillas en todo el mapa.


export function replace() {
return {
...replaceObjectStaticMethods({
from: 'navegador',
to: 'navigator',
methods,
}),
...replaceObjectStaticProperties({
from: 'navegador',
to: 'navigator',
properties,
}),
...replaceObjects({
objects,
})
}
}
enzonotario marked this conversation as resolved.
Show resolved Hide resolved
49 changes: 49 additions & 0 deletions packages/core/src/plugins/numerogrande/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import {
replaceExpressionMethods,
replaceInstanceof,
replaceObjectProperties,
replaceObjectStaticMethods,
replaceObjects,
} from '../utils'

export const report = () => 'Converts NumeroGrande methods to JavaScript'
enzonotario marked this conversation as resolved.
Show resolved Hide resolved

export const staticMethods = new Map<string, string>([
['comoNumeroSig', 'asIntN'],
['comoNumero', 'asUintN']
])
enzonotario marked this conversation as resolved.
Show resolved Hide resolved

export const properties = new Map<string, string>([
['etiquetaCadena', 'toStringTag']
])

export const methods = new Map<string, string>([
['aCadenaLocalizada', 'toLocaleString'],
['aCadena', 'toString'],
['valorDe', 'valueOf']
])
enzonotario marked this conversation as resolved.
Show resolved Hide resolved

export const objects = new Map<string, string>([['NumeroGrande', 'BigInt']])
enzonotario marked this conversation as resolved.
Show resolved Hide resolved

export function replace() {
return {
...replaceObjectStaticMethods({
from: 'NumeroGrande',
to: 'BigInt',
methods: staticMethods,
}),
...replaceExpressionMethods({
methods,
}),
...replaceObjectProperties({
properties,
}),
...replaceInstanceof({
from: 'NumeroGrande',
to: 'BigInt',
}),
...replaceObjects({
objects,
}),
}
}
enzonotario marked this conversation as resolved.
Show resolved Hide resolved
31 changes: 31 additions & 0 deletions packages/core/src/plugins/puente/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {
replaceInstanceof,
replaceObjectStaticMethods,
replaceObjects,
} from '../utils'

export const report = () => 'Converts Puente methods to JavaScript'

export const staticMethods = new Map<string, string>([
["revocable", "revocable"]
])

export const objects = new Map<string, string>([['Puente', 'Proxy']])

export function replace() {
return {
...replaceObjectStaticMethods({
from: 'Puente',
to: 'Proxy',
methods: staticMethods,
}),
...replaceInstanceof({
from: 'Puente',
to: 'Proxy',
}),
...replaceObjects({
objects,
}),
}
}

73 changes: 73 additions & 0 deletions packages/core/src/plugins/simbolo/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import {
replaceExpressionMethods,
replaceInstanceof,
replaceObjectProperties,
replaceObjectStaticProperties,
replaceObjectStaticMethods,
replaceObjects,
} from '../utils'

export const report = () => 'Converts Simbolo methods to JavaScript'
enzonotario marked this conversation as resolved.
Show resolved Hide resolved

export const methods = new Map<string, string>([
['aCadena', 'toString'],
['valorDe', 'valueOf'],
['aPrimitivo', 'toPrimitive']
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Revisar la clasificación de 'aPrimitivo'

El método 'aPrimitivo' está mapeado en methods a 'toPrimitive'. Sin embargo, Symbol.toPrimitive es un símbolo utilizado como clave de propiedad para convertir objetos a valores primitivos, no es un método. Sería más apropiado mover 'aPrimitivo' al mapeo de properties para reflejar su uso correcto.

Aplica este cambio para corregir la ubicación:

 export const methods = new Map<string, string>([
   ['aCadena', 'toString'],
   ['valorDe', 'valueOf'],
-  ['aPrimitivo', 'toPrimitive']
 ])

 export const properties = new Map<string, string>([
   ['descripcion', 'description'],
   ['etiquetaCadena', 'toStringTag'],
+  ['aPrimitivo', 'toPrimitive']
 ])

Committable suggestion skipped: line range outside the PR's diff.

])
enzonotario marked this conversation as resolved.
Show resolved Hide resolved

export const properties = new Map<string, string>([
['descripcion', 'description'],
['etiquetaCadena', 'toStringTag']
])
Comment on lines +18 to +21
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Revisar la duplicación del mapeo etiquetaCadena

La propiedad etiquetaCadena está mapeada a 'toStringTag' tanto en properties como en staticProperties, lo cual puede generar confusión y redundancia.

Sugerencia:

  • Mantener etiquetaCadena'toStringTag' en properties.
  • Eliminar etiquetaCadena de staticProperties si no es necesario.

Aplica este cambio para eliminar la duplicación:

 export const staticProperties = new Map<string, string>([
     ['iteradorAsincrono', 'asyncIterator'],
     ['tieneInstancia', 'hasInstance'],
     ['esConcatExtendible', 'isConcatSpreadable'],
     ['iterador', 'iterator'],
     ['coincidir', 'match'],
     ['coincidirTodo', 'matchAll'],
     ['reemplazar', 'replace'],
     ['buscarRegex', 'search'],
     ['derivados', 'species'],
     ['dividir', 'split'],
     ['aPrimitivo', 'toPrimitive'],
-    ['etiquetaCadena', 'toStringTag'],
     ['imposibleDescifrar', 'unscopables']
   ])

Also applies to: 23-37


export const staticProperties = new Map<string, string>([
['iteradorAsincrono', 'asyncIterator'],
['tieneInstancia', 'hasInstance'],
['esConcatExtendible', 'isConcatSpreadable'],
['iterador', 'iterator'],
['coincidir', 'match'],
['coincidirTodo', 'matchAll'],
['reemplazar', 'replace'],
['buscarRegex', 'search'],
['derivados', 'species'],
['dividir', 'split'],
['aPrimitivo', 'toPrimitive'],
['etiquetaCadena', 'toStringTag'],
Comment on lines +20 to +35
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Eliminar duplicación del mapeo 'etiquetaCadena'

La propiedad 'etiquetaCadena' está mapeada a 'toStringTag' tanto en properties como en staticProperties, lo cual puede causar confusión y redundancia.

Sugerencia:

  • Mantener 'etiquetaCadena''toStringTag' en properties.
  • Eliminar 'etiquetaCadena' de staticProperties si no es necesario.

Aplica este cambio para eliminar la duplicación:

 export const staticProperties = new Map<string, string>([
     ['iteradorAsincrono', 'asyncIterator'],
     ['tieneInstancia', 'hasInstance'],
     ['esConcatExtendible', 'isConcatSpreadable'],
     ['iterador', 'iterator'],
     ['coincidir', 'match'],
     ['coincidirTodo', 'matchAll'],
     ['reemplazar', 'replace'],
     ['buscarRegex', 'search'],
     ['derivados', 'species'],
     ['dividir', 'split'],
     ['aPrimitivo', 'toPrimitive'],
-    ['etiquetaCadena', 'toStringTag'],
     ['imposibleDescifrar', 'unscopables']
   ])

Committable suggestion skipped: line range outside the PR's diff.

['imposibleDescifrar', 'unscopables']
])

export const staticMethods = new Map<string, string>([
['para', 'for'],
['paraLlave', 'keyFor']
])

export const objects = new Map<string, string>([['Simbolo', 'Symbol']])
enzonotario marked this conversation as resolved.
Show resolved Hide resolved

export function replace() {
return {
...replaceObjectStaticMethods({
from: 'Simbolo',
to: 'Symbol',
methods: staticMethods,
}),
...replaceExpressionMethods({
methods,
}),
...replaceObjectProperties({
properties,
}),
...replaceObjectStaticProperties({
from: 'Simbolo',
to: 'Symbol',
properties: staticProperties,
}),
...replaceInstanceof({
from: 'Simbolo',
to: 'Symbol',
}),
...replaceObjects({
objects,
}),
}
}
enzonotario marked this conversation as resolved.
Show resolved Hide resolved

Loading
Loading