Skip to content

Commit

Permalink
fix: Use explanatory variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
clepski committed Jul 10, 2024
1 parent fcccc4c commit 1356490
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/plugins/src/editors/subscription/foundation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ export function getExtRef(
control: Element | undefined
): Element | undefined {
function createCriteria(attributeName: string, value: string | null): string {
// If ExtRef is missing 'srcLNClass', it defaults to 'LLN0' as specified in the standard
if (attributeName === 'srcLNClass' && value === 'LLN0') {
// For ExtRef the attribute 'srcLNClass' is optional and defaults to 'LLN0', here we ignore 'srcLNClass' completely for 'LLN0'
// because otherwise we would have to extend the querySelector to multiple selector groups checking for 'LLN0' or missing 'srcLNClass'
const shouldIgnoreCriteria = attributeName === 'srcLNClass' && value === 'LLN0';
if (shouldIgnoreCriteria) {
return '';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ function checkEditionSpecificRequirements(
const lnElement = controlElement?.closest('LN0') ?? undefined;

// If ExtRef is missing 'srcLNClass', it defaults to 'LLN0' as specified in the standard
const canIgnoreSrcLNClass = lnElement?.getAttribute('lnClass') === 'LLN0' && !extRefElement.hasAttribute('srcLNClass');
const extRefIsMissingSrcLNClass = !extRefElement.hasAttribute('srcLNClass');
const isLnClassLLN0 = lnElement?.getAttribute('lnClass') === 'LLN0';
const canIgnoreSrcLNClass = isLnClassLLN0 && extRefIsMissingSrcLNClass;

// For the 2007B and 2007B4 Edition we need to check some extra attributes.
return (
Expand Down

0 comments on commit 1356490

Please sign in to comment.