Skip to content

Commit

Permalink
fix: fail on build
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernankez committed Apr 17, 2024
1 parent 8462bfd commit 903d459
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// TODO fix https://github.com/Bernankez/utils/issues/11
import type { Awaitable } from "@bernankez/utils";
import { assert } from "./utils";
import { calculateRenderCount, calculateTranslate, measureText } from "./utils/shared";
import { degreeToAngle } from "./utils/math";
Expand All @@ -8,6 +6,8 @@ export * from "./renderer";
export * from "./utils/shared";
export * from "./utils/math";

export type Awaitable<T> = Promise<T> | T;

export interface BackmojiOptions {
degree?: number;
rowGap?: number;
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/utils/math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ export function degreeToAngle(degree: number) {
export function getRightAngleSides(hypotenuseLength: number, degree: number) {
const side1 = hypotenuseLength * Math.cos(degreeToAngle(degree)); // 对边
const side2 = hypotenuseLength * Math.sin(degreeToAngle(degree)); // 邻边
return [side1, side2];
return makeDestructurable({
side1,
side2,
}, [side1, side2]);
}

export function measureRectangle(width: number, height: number, degree: number) {
Expand Down

0 comments on commit 903d459

Please sign in to comment.