0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-17 22:44:24 -05:00

[ci] format

This commit is contained in:
Arsh 2024-02-13 17:29:30 +00:00 committed by astrobot-houston
parent 71273edbb4
commit d851387a2d
2 changed files with 28 additions and 25 deletions

View file

@ -498,9 +498,9 @@ export const a11y: AuditRuleWithSelector[] = [
if (is_semantic_role_element(role, element.localName, getAttributeObject(element))) {
return;
}
const elementRoles = role.split(WHITESPACE_REGEX) as ARIARoleDefinitionKey[];
for(const elementRole of elementRoles) {
for (const elementRole of elementRoles) {
const { requiredProps } = roles.get(elementRole)!;
const required_role_props = Object.keys(requiredProps);
const missingProps = required_role_props.filter((prop) => !element.hasAttribute(prop));
@ -530,7 +530,7 @@ export const a11y: AuditRuleWithSelector[] = [
if (!role) return false;
const elementRoles = role.split(WHITESPACE_REGEX) as ARIARoleDefinitionKey[];
for(const elementRole of elementRoles) {
for (const elementRole of elementRoles) {
const { props } = roles.get(elementRole)!;
const attributes = getAttributeObject(element);
const unsupportedAttributes = aria.keys().filter((attribute) => !(attribute in props));

View file

@ -101,30 +101,33 @@ declare const Astro: {
return;
}
try {
await Astro[directive]!(
async () => {
const rendererUrl = this.getAttribute('renderer-url');
const [componentModule, { default: hydrator }] = await Promise.all([
import(this.getAttribute('component-url')!),
rendererUrl ? import(rendererUrl) : () => () => {},
]);
const componentExport = this.getAttribute('component-export') || 'default';
if (!componentExport.includes('.')) {
this.Component = componentModule[componentExport];
} else {
this.Component = componentModule;
for (const part of componentExport.split('.')) {
this.Component = this.Component[part];
await Astro[directive]!(
async () => {
const rendererUrl = this.getAttribute('renderer-url');
const [componentModule, { default: hydrator }] = await Promise.all([
import(this.getAttribute('component-url')!),
rendererUrl ? import(rendererUrl) : () => () => {},
]);
const componentExport = this.getAttribute('component-export') || 'default';
if (!componentExport.includes('.')) {
this.Component = componentModule[componentExport];
} else {
this.Component = componentModule;
for (const part of componentExport.split('.')) {
this.Component = this.Component[part];
}
}
}
this.hydrator = hydrator;
return this.hydrate;
},
opts,
this
)
this.hydrator = hydrator;
return this.hydrate;
},
opts,
this
);
} catch (e) {
console.error(`[astro-island] Error hydrating ${this.getAttribute('component-url')}`, e);
console.error(
`[astro-island] Error hydrating ${this.getAttribute('component-url')}`,
e
);
}
}
hydrate = async () => {