Skip to content

Commit 028c108

Browse files
committed
fix(main): fix type error of toTuples
1 parent e509195 commit 028c108

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/jp-numerals.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export class Numeral {
2424
return Math.floor(this.raw / Math.pow(10, this.rank * 4)) % Math.pow(10, 4)
2525
}
2626

27+
toTuple(): [number, string] {
28+
const { character, digits } = this
29+
return [digits, character]
30+
}
2731
toString(): string {
2832
return `${this.digits}${this.character}`
2933
}
@@ -70,7 +74,7 @@ export const jpNumerals = (n: number, base: JpNumeralUnit = JpNumeralUnit.零):
7074

7175
return {
7276
toArray: () => numerals,
73-
toTuples: () => numerals.map(numeral => [numeral.digits, numeral.character]),
77+
toTuples: () => numerals.map(numeral => numeral.toTuple()),
7478
toNumeralObjs: () => numerals.map(numeral => numeral.toNumeralObj()),
7579
toString: () => numerals.reduce((s, numeral) => `${s}${numeral}`, ''),
7680
toNumber: () => raw

0 commit comments

Comments
 (0)