import { createFlagError } from '@kbn/dev-utils' ; const isNum = ( input ) => { return /^\d+$/ . test ( input ) ; } ; export class Pr { static parseInput ( input ) { if ( ! isNum ( input ) ) { throw createFlagError ( `invalid pr number [${ input }], expected a number` ) ; } return parseInt ( input , 10 ) ; } public readonly remoteRef : string ; constructor ( public readonly number , public readonly targetRef , public readonly owner , public readonly sourceBranch ) { this . remoteRef = `pull/${ this . number }/head` ; } }