param { String | Number | Null | Boolean } value return { Boolean } export function isWholeNumber ( value ) { if ( value === null || value === undefined ) { return false ; } if ( ! Number ( value ) ) { return false ; } return Number ( value ) % 1 === 0 ; } param { String } string return { Boolean } export function isJsonString ( string ) { try { JSON . parse ( string ) ; } catch ( e ) { console . log ( 'Failed parsing .nsprc file: ' + e ) ; return false ; } return true ; } param { Array } array param { Number } maxLength return { Array } export function trimArray ( array , maxLength ) { const originalLength = array . length ; const removedLength = Math . max ( 0 , originalLength - maxLength ) ; if ( removedLength === 0 ) { return array ; } array . length = maxLength ; return array . concat ( `...and ${ removedLength } more` ) ; } param { String } path return { String } export function shortenNodePath ( path ) { return path . replace ( 'node_modules/' , '' ) . replace ( /\/node_modules\//g , '>' ) ; }