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

fix: layer with shared encoding ignore repeater #9246

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
style: auto-formatting [CI]
GitHub Actions Bot committed Feb 1, 2024
commit 74fb9c10ea78d3ff1b3f85873f95b367d5b3a90e
13 changes: 6 additions & 7 deletions src/normalize/core.ts
Original file line number Diff line number Diff line change
@@ -176,7 +176,7 @@ export class CoreNormalizer extends SpecMapper<NormalizerParams, FacetedUnitSpec
(isArray(repeat)
? `${varName(repeatValue)}`
: (repeat.row ? `row_${varName(rowValue)}` : '') +
(repeat.column ? `column_${varName(columnValue)}` : ''));
(repeat.column ? `column_${varName(columnValue)}` : ''));

const child = this.map(childSpec, {...params, repeater: childRepeater, repeaterPrefix: childName});
child.name = childName;
@@ -213,9 +213,9 @@ export class CoreNormalizer extends SpecMapper<NormalizerParams, FacetedUnitSpec
}
private isEmpty(obj: any) {
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be a helper function outside of this class, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, move this outside the class

if (obj == null) {
return true
return true;
}
return Object.keys(obj).length === 0
return Object.keys(obj).length === 0;
}

private mapUnitWithParentEncodingOrProjection(
@@ -241,9 +241,9 @@ export class CoreNormalizer extends SpecMapper<NormalizerParams, FacetedUnitSpec
...params,
config: config,
repeater: params.repeater
})
}
else {
}
);
} else {
return this.mapUnit(
{
...spec,
@@ -254,7 +254,6 @@ export class CoreNormalizer extends SpecMapper<NormalizerParams, FacetedUnitSpec
config
}
);

}
}