@@ -41,7 +41,7 @@ class PackageJSON extends JSONObject {
4141
4242 /** Gets information for a contributor to this package. */
4343 ContributorInfo getAContributor ( ) {
44- result = getPropValue ( "contributors" ) .( JSONArray ) . getElementValue ( _)
44+ result = getPropValue ( "contributors" ) .getElementValue ( _)
4545 }
4646
4747 /** Gets the array of files for this package. */
@@ -57,13 +57,13 @@ class PackageJSON extends JSONObject {
5757 string getBin ( string cmd ) {
5858 cmd = getPackageName ( ) and result = getPropStringValue ( "bin" )
5959 or
60- result = getPropValue ( "bin" ) .( JSONObject ) . getPropStringValue ( cmd )
60+ result = getPropValue ( "bin" ) .getPropValue ( cmd ) . getStringValue ( )
6161 }
6262
6363 /** Gets a manual page for this package. */
6464 string getAManFile ( ) {
6565 result = getPropStringValue ( "man" ) or
66- result = getPropValue ( "man" ) .( JSONArray ) . getElementStringValue ( _ )
66+ result = getPropValue ( "man" ) .getElementValue ( _ ) . getStringValue ( )
6767 }
6868
6969 /** Gets information about the directories of this package. */
@@ -191,12 +191,12 @@ class BugTrackerInfo extends JSONValue {
191191
192192 /** Gets the bug tracker URL. */
193193 string getUrl ( ) {
194- result = this .( JSONObject ) . getPropStringValue ( "url" ) or
195- result = this .( JSONString ) . getValue ( )
194+ result = this .getPropValue ( "url" ) . getStringValue ( ) or
195+ result = this .getStringValue ( )
196196 }
197197
198198 /** Gets the bug reporting email address. */
199- string getEmail ( ) { result = this .( JSONObject ) . getPropStringValue ( "email" ) }
199+ string getEmail ( ) { result = this .getPropValue ( "email" ) . getStringValue ( ) }
200200}
201201
202202/**
@@ -206,7 +206,7 @@ class ContributorInfo extends JSONValue {
206206 ContributorInfo ( ) {
207207 exists ( PackageJSON pkg |
208208 this = pkg .getPropValue ( "author" ) or
209- this = pkg .getPropValue ( "contributors" ) .( JSONArray ) . getElementValue ( _)
209+ this = pkg .getPropValue ( "contributors" ) .getElementValue ( _)
210210 ) and
211211 ( this instanceof JSONObject or this instanceof JSONString )
212212 }
@@ -217,24 +217,24 @@ class ContributorInfo extends JSONValue {
217217 * homepage URL.
218218 */
219219 private string parseInfo ( int group ) {
220- result = this .( JSONString ) . getValue ( ) .regexpCapture ( "(.*?)(?: <(.*?)>)?(?: \\((.*)?\\))" , group )
220+ result = this .getStringValue ( ) .regexpCapture ( "(.*?)(?: <(.*?)>)?(?: \\((.*)?\\))" , group )
221221 }
222222
223223 /** Gets the contributor's name. */
224224 string getName ( ) {
225- result = this .( JSONObject ) . getPropStringValue ( "name" ) or
225+ result = this .getPropValue ( "name" ) . getStringValue ( ) or
226226 result = parseInfo ( 1 )
227227 }
228228
229229 /** Gets the contributor's email address. */
230230 string getEmail ( ) {
231- result = this .( JSONObject ) . getPropStringValue ( "email" ) or
231+ result = this .getPropValue ( "email" ) . getStringValue ( ) or
232232 result = parseInfo ( 2 )
233233 }
234234
235235 /** Gets the contributor's homepage URL. */
236236 string getUrl ( ) {
237- result = this .( JSONObject ) . getPropStringValue ( "url" ) or
237+ result = this .getPropValue ( "url" ) . getStringValue ( ) or
238238 result = parseInfo ( 3 )
239239 }
240240}
0 commit comments