File tree Expand file tree Collapse file tree
projects/angular-odata/src/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ export const binary = (value: string): QueryCustomType => ({
106106 value,
107107} ) ;
108108export const isQueryCustomType = ( value : any ) =>
109- typeof value === 'object' && 'type' in value && value . type in QueryCustomTypes ;
109+ value !== null && value !== undefined && typeof value === 'object' && 'type' in value && value . type in QueryCustomTypes ;
110110
111111export const isRawType = ( value : any ) =>
112112 isQueryCustomType ( value ) && ( value as QueryCustomType ) . type === QueryCustomTypes . Raw ;
Original file line number Diff line number Diff line change @@ -58,19 +58,19 @@ export class ODataEntityResource<T> extends ODataResource<T> {
5858 } ) ;
5959 }
6060
61- navigationProperty < N > ( path : string ) {
61+ navigationProperty < N > ( path : string ) : ODataNavigationPropertyResource < N > {
6262 return ODataNavigationPropertyResource . fromResource < N > ( this , path ) ;
6363 }
6464
65- property < P > ( path : string ) {
65+ property < P > ( path : string ) : ODataPropertyResource < P > {
6666 return ODataPropertyResource . fromResource < P > ( this , path ) ;
6767 }
6868
69- action < P , R > ( path : string ) {
69+ action < P , R > ( path : string ) : ODataActionResource < P , R > {
7070 return ODataActionResource . fromResource < P , R > ( this , path ) ;
7171 }
7272
73- function < P , R > ( path : string ) {
73+ function < P , R > ( path : string ) : ODataFunctionResource < P , R > {
7474 return ODataFunctionResource . fromResource < P , R > ( this , path ) ;
7575 }
7676
Original file line number Diff line number Diff line change @@ -122,11 +122,11 @@ export class ODataNavigationPropertyResource<T> extends ODataResource<T> {
122122 } ) ;
123123 }
124124
125- navigationProperty < N > ( path : string ) {
125+ navigationProperty < N > ( path : string ) : ODataNavigationPropertyResource < N > {
126126 return ODataNavigationPropertyResource . fromResource < N > ( this , path ) ;
127127 }
128128
129- property < P > ( path : string ) {
129+ property < P > ( path : string ) : ODataPropertyResource < P > {
130130 return ODataPropertyResource . fromResource < P > ( this , path ) ;
131131 }
132132
Original file line number Diff line number Diff line change @@ -54,19 +54,19 @@ export class ODataSingletonResource<T> extends ODataResource<T> {
5454 return singleton ;
5555 }
5656
57- navigationProperty < N > ( path : string ) {
57+ navigationProperty < N > ( path : string ) : ODataNavigationPropertyResource < N > {
5858 return ODataNavigationPropertyResource . fromResource < N > ( this , path ) ;
5959 }
6060
61- property < P > ( path : string ) {
61+ property < P > ( path : string ) : ODataPropertyResource < P > {
6262 return ODataPropertyResource . fromResource < P > ( this , path ) ;
6363 }
6464
65- action < P , R > ( path : string ) {
65+ action < P , R > ( path : string ) : ODataActionResource < P , R > {
6666 return ODataActionResource . fromResource < P , R > ( this , path ) ;
6767 }
6868
69- function < P , R > ( path : string ) {
69+ function < P , R > ( path : string ) : ODataFunctionResource < P , R > {
7070 return ODataFunctionResource . fromResource < P , R > ( this , path ) ;
7171 }
7272
Original file line number Diff line number Diff line change @@ -25,10 +25,10 @@ const EdmParser = <T>(
2525} ) ;
2626
2727const Identity = ( v : any ) => v ;
28- const toNumber = ( v : any ) => Number ( v ) ;
29- const toString = ( v : any ) => v . toString ( ) ;
30- const toBoolean = ( v : any ) => Boolean ( v ) ;
31- const toDate = ( v : any ) => new Date ( v ) ;
28+ const toNumber = ( v : any ) => v && Number ( v ) ;
29+ const toString = ( v : any ) => v && v . toString ( ) ;
30+ const toBoolean = ( v : any ) => v && Boolean ( v ) ;
31+ const toDate = ( v : any ) => v && new Date ( v ) ;
3232
3333export const EDM_PARSERS : { [ type : string ] : FieldParser < any > } = {
3434 //Edm.Guid 16-byte (128-bit) unique identifier
You can’t perform that action at this time.
0 commit comments