'use strict' ; import fs = require ( 'fs' ) ; export function semVer ( a , b ) { a = a . split ( ' ' ) [ 1 ] ; b = b . split ( ' ' ) [ 1 ] ; var pa = a . split ( '.' ) ; var pb = b . split ( '.' ) ; for ( var i = 0 ; i < 3 ; i ++ ) { var na = Number ( pa [ i ] ) ; var nb = Number ( pb [ i ] ) ; if ( na > nb ) { return 1 ; } if ( nb > na ) { return - 1 ; } if ( ! isNaN ( na ) && isNaN ( nb ) ) { return 1 ; } if ( isNaN ( na ) && ! isNaN ( nb ) ) { return - 1 ; } } return 0 ; } export function fileExists ( filePath ) { try { return fs . statSync ( filePath ) . isFile ( ) ; } catch ( e ) { return false ; } }