File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
adminforth/dataConnectors Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ export default class AdminForthBaseConnector implements IAdminForthDataSourceCon
236236 let number : any ;
237237 if ( typeof value === "number" ) {
238238 number = value ;
239- } else if ( typeof value === "object" && value !== null ) {
239+ } else if ( typeof value === "object" ) {
240240 number = ( value as any ) . valueOf ( ) ;
241241 } else {
242242 number = NaN ;
@@ -269,7 +269,7 @@ export default class AdminForthBaseConnector implements IAdminForthDataSourceCon
269269 throw new Error ( `Value is not a decimal. Field ${ field . name } got: ${ value } (string)` ) ;
270270 }
271271
272- if ( typeof value === "object" && value ) {
272+ if ( typeof value === "object" ) {
273273 if ( typeof value . toString !== "function" ) {
274274 throw new Error ( `Decimal object has no toString(). Field ${ field . name } got: ${ String ( value ) } ` ) ;
275275 }
Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ const escapeRegex = (value) => {
1212function normalizeMongoValue ( v : any ) {
1313 if ( v == null ) return v ;
1414 if ( v instanceof Decimal128 ) return v . toString ( ) ;
15+ if ( v instanceof Double ) return v . valueOf ( ) ;
1516 if ( typeof v === "object" && v . $numberDecimal ) return String ( v . $numberDecimal ) ;
17+ if ( typeof v === "object" && v . $numberDouble ) return Number ( v . $numberDouble ) ;
1618 return v ;
1719}
1820
You can’t perform that action at this time.
0 commit comments