Skip to content

Commit

Permalink
fix: add return number type in firstNumericalParse
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim716 committed Mar 25, 2024
1 parent 9652ce7 commit 473bce0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@junyiacademy/perseus-core",
"version": "1.0.27",
"version": "1.0.28",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type Props = {
answerType: PropsFor<typeof InputNumber.widget>["answerType"];
rightAlign: PropsFor<typeof InputNumber.widget>["rightAlign"];
onChange: (arg1: {
value?: ParsedValue | 0;
value?: ParsedValue | number;
simplify?: Props["simplify"];
size?: Props["size"];
inexact?: Props["inexact"];
Expand Down
4 changes: 3 additions & 1 deletion packages/perseus/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ function keScoreFromPerseusScore(
* Return the first valid interpretation of 'text' as a number, in the form
* {value: 2.3, exact: true}.
*/
function firstNumericalParse(text: string): ParsedValue | null | undefined {
function firstNumericalParse(
text: string,
): ParsedValue | null | undefined | number {
// TODO(alpert): This is sort of hacky...
let first;
const val = KhanAnswerTypes.predicate.createValidatorFunctional(
Expand Down

0 comments on commit 473bce0

Please sign in to comment.