Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: coerce output to number if numeric #1407

Merged
merged 3 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
${{ runner.OS }}-node-
${{ runner.OS }}-
- run: npm ci
- run: npx lockfile-lint --type npm --path package-lock.json --validate-https --allowed-hosts npm
- run: npm run lint
compile:
name: Compile
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v1.14.8](https://github.com/opengovsg/checkfirst/compare/v1.14.7...v1.14.8)

- fix: coerce output to number if numeric [`8a5827a`](https://github.com/opengovsg/checkfirst/commit/8a5827a0ba208d27b3ee432841473875efbb001b)
- chore: remove lockfile-lint for spurious CI errors [`e566920`](https://github.com/opengovsg/checkfirst/commit/e5669204e4bd71166566d46cf7e2ecd6b49483a0)

#### [v1.14.7](https://github.com/opengovsg/checkfirst/compare/v1.14.6...v1.14.7)

> 6 June 2023

- build(ci): use ubuntu-latest [`#1395`](https://github.com/opengovsg/checkfirst/pull/1395)
- Release 2022-12-06 [`#1350`](https://github.com/opengovsg/checkfirst/pull/1350)
- [production] 1.14.5 [`#1342`](https://github.com/opengovsg/checkfirst/pull/1342)
Expand Down Expand Up @@ -266,12 +273,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- feat(sort-last-update): order checkers by last updated [`#389`](https://github.com/opengovsg/checkfirst/pull/389)
- feat(hover-state-desc): add hover state descriptions to icon buttons [`#370`](https://github.com/opengovsg/checkfirst/pull/370)
- [develop] Release 1.2.1 [`#379`](https://github.com/opengovsg/checkfirst/pull/379)
- fix: instantiate sequelize within lambda handler [`#385`](https://github.com/opengovsg/checkfirst/pull/385)

#### [v1.2.1](https://github.com/opengovsg/checkfirst/compare/v1.2.0...v1.2.1)

> 14 April 2021

- fix: instantiate sequelize within lambda handler [`#385`](https://github.com/opengovsg/checkfirst/pull/385)
- fix: change bg to white for login and otp inputs [`#377`](https://github.com/opengovsg/checkfirst/pull/377)
- fix: sort references based on order in question and logic tab [`#368`](https://github.com/opengovsg/checkfirst/pull/368)
- fix: make the AND/OR button in the IF/ELSE component obvious [`#362`](https://github.com/opengovsg/checkfirst/pull/362)
Expand Down
4 changes: 2 additions & 2 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
@@ -1,6 +1,6 @@
{
"name": "@opengovsg/checkfirst",
"version": "1.14.7",
"version": "1.14.8",
"description": "Calculators and eligibility checkers for Singapore Government policies",
"main": "build/server/index.js",
"homepage": "https://checkfirst.gov.sg",
Expand Down
3 changes: 2 additions & 1 deletion src/client/components/Checker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ export const Checker: FC<CheckerProps> = ({ config }) => {
}
)
} else if (isNumeric(output)) {
value = mathjs.format(output, { notation: 'fixed' })
// coerce `output`, since it could be a string
value = mathjs.format(Number(output), { notation: 'fixed' })
} else {
value = output.toString()
}
Expand Down