export class Utils { public isOnPrem ( url ) { return url . indexOf ( '.sharepoint.com' ) === - 1 && url . indexOf ( '.sharepoint.cn' ) === - 1 ; } public isUrlHttps ( url ) { return url . split ( '://' ) [ 0 ] . toLowerCase ( ) === 'https' ; } public isUrlAbsolute ( url ) { return url . indexOf ( 'http:' ) === 0 || url . indexOf ( 'https:' ) === 0 ; } public combineUrl ( ... args ) { return args . join ( '/' ) . replace ( /(\/)+/g , '/' ) . replace ( ':/' , '://' ) ; } public trimMultiline = ( multiline ) : string => { return multiline . split ( '\n' ) . map ( ( line ) => line . trim ( ) ) . filter ( ( line ) => line . length > 0 ) . join ( '' ) . trim ( ) ; } ; public escapeURIComponent = ( input ) : string => { return encodeURIComponent ( input . replace ( /'/ig , `''` ) . replace ( /%25/g , '%' ) ) ; } ; }