Skip to content

Commit

Permalink
refactor: fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Aidosmf committed Dec 27, 2024
1 parent 9034697 commit bcd68d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/relottie-parse/playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function emptyCompiler(this: Plugin<[], Root, string>): void {
Object.assign(this, { Compiler: compiler });
}

const name = 'slots';
const name = 'auto-orient';
const path = `../../__fixtures__/features/${name}.json`;

const lottieJsonFile = readFileSync(path, 'utf8');
Expand Down
12 changes: 8 additions & 4 deletions packages/relottie-parse/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ const getTitleFromMemberValue = (
dependent: Dependent,
file: VFile,
): AnyTitle | undefined => {
const { key, resultTitle: parentTitle, type } = dependent;
const { key, resultTitle, type } = dependent;

switch (type) {
case 'Constant':
if (!is<MomoaString>(node, 'String') && !is<MomoaNumber>(node, 'Number')) break;

const { defaultValue, prefix, values } = parentTitle;
const { defaultValue, prefix, values } = resultTitle;

const defaultConstTitle = values[defaultValue];

Expand Down Expand Up @@ -223,7 +223,11 @@ const getTitleFromMemberValue = (

if (!matchedMember) break;

return parentTitle;
if (parentNodeTitle === 'assets') {
console.log('DA', key, resultTitle, type);

Check warning on line 227 in packages/relottie-parse/src/helpers.ts

View workflow job for this annotation

GitHub Actions / Validate (20)

Unexpected console statement
}

return resultTitle;

default:
if (type !== node.type) {
Expand All @@ -233,7 +237,7 @@ const getTitleFromMemberValue = (
break;
}

return parentTitle;
return resultTitle;
}

return undefined;
Expand Down

0 comments on commit bcd68d3

Please sign in to comment.