You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most methods on DataSet are typed incorrectly. For example, int16 declares that it will always return a number:
exportinterfaceDataSet{/** * Finds the element for tag and returns an unsigned int 16 if it exists and has data. Use this function for VR type US. */uint16: (tag: string,index?: number)=>number;// ...}
However, the actual logic can also return undefined:
exportdefaultclassDataSet{int16(tag,index){varelement=this.elements[tag];index=(index!==undefined) ? index : 0;if(element&&element.length!==0){returngetByteArrayParser(element,this.byteArrayParser).readInt16(this.byteArray,element.dataOffset+(index*2));}returnundefined;// <- This part}// ...}
I'd suggest updating the typing to reflect the implementation to avoid breaking changes (ie: returning 0 in this case)
The text was updated successfully, but these errors were encountered:
Most methods on
DataSet
are typed incorrectly. For example,int16
declares that it will always return anumber
:However, the actual logic can also return
undefined
:I'd suggest updating the typing to reflect the implementation to avoid breaking changes (ie: returning
0
in this case)The text was updated successfully, but these errors were encountered: