Skip to content

Commit

Permalink
fix v8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
reececomo committed Apr 27, 2024
1 parent 2e2bfd5 commit 9ffa882
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "lint"
name: "eslint"

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "test"
name: "tests"

on:
push:
Expand Down
70 changes: 35 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"tweening"
],
"peerDependencies": {
"pixi.js": ">=6.1.0"
"pixi.js": "^6.1.0 || ^7.0.0 || ^8.0.0"
},
"devDependencies": {
"pixi.js": "^6.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ export class RunOnChildAction extends Action {
throw new TypeError('The target did not have children.');
}

const child: any = target.children
.find((child: any) => child.name === this.nameOrLabel || child.label === this.nameOrLabel);
let child: any;

if ('getChildByLabel' in target as any) {
child = (target as any).getChildByLabel(this.nameOrLabel); // PixiJS v8
}
else {
child = target.children
.find((child: any) => child.label === this.nameOrLabel || child.name === this.nameOrLabel);
}

if (child) {
child.run(this.action);
Expand Down
2 changes: 1 addition & 1 deletion src/actions/display-object/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './RemoveFromParentAction';
export * from './RunOnChildWithNameAction';
export * from './RunOnChildAction';
export * from './SetVisibleAction';

0 comments on commit 9ffa882

Please sign in to comment.