Skip to content

Commit

Permalink
Merge pull request #12 from junyiacademy/fix/firstNumericalParse-type
Browse files Browse the repository at this point in the history
Fix: add return number type in firstNumericalParse
  • Loading branch information
Kim716 authored Mar 25, 2024
2 parents 0175dfe + 473bce0 commit e3124c9
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 e3124c9

Please sign in to comment.