Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
lilnasy authored and astrobot-houston committed Feb 13, 2024
1 parent 71273ed commit d851387
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down
47 changes: 25 additions & 22 deletions packages/astro/src/runtime/server/astro-island.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit d851387

Please sign in to comment.