File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @awell-health/awell-score" ,
3
- "version" : " 1.0.7 " ,
3
+ "version" : " 1.0.8 " ,
4
4
"description" : " Library of Medical Score functions" ,
5
5
"packageManager" : " yarn@4.6.0" ,
6
6
"main" : " dist/index.js" ,
Original file line number Diff line number Diff line change @@ -151,7 +151,9 @@ export class Score<
151
151
* @returns The cast value.
152
152
*/
153
153
const castInputToExactType = ( input_value : unknown , key : string ) => {
154
- const inputTypeSchema = this . inputSchema [ key ] . type
154
+ const inputTypeSchema = this . inputSchema [ key ] ?. type
155
+
156
+ if ( ! inputTypeSchema ) return input_value
155
157
156
158
/**
157
159
* Retrieves the base Zod type, unwrapping optional types if necessary.
Original file line number Diff line number Diff line change
1
+ import { test_calculation } from './test_caculation'
2
+ import { Score } from '../../classes/Score'
3
+
4
+ const calculation = new Score ( test_calculation )
5
+
6
+ describe ( 'Test Calculation' , ( ) => {
7
+ it ( 'should calculate the result' , ( ) => {
8
+ const result = calculation . calculate ( {
9
+ payload : {
10
+ simpleNumberInput : '100' ,
11
+ height : '100' ,
12
+ weight : '100' ,
13
+ hello : 'world' ,
14
+ } ,
15
+ } )
16
+ expect ( result . result ) . toBe ( 10 )
17
+ } )
18
+ } )
You can’t perform that action at this time.
0 commit comments