export const enum Comparison { LessThan = - 1 , EqualTo = 0 , GreaterThan = 1 } /**
 * Safer version of `Function` which should not be called.
 * Every function should be assignable to this, but this should not be assignable to every function.
 */ export type AnyFunction = ( ... args : never [ ] ) => void ; /** Do nothing and return false */ export function returnFalse ( ) { return false ; } /** Do nothing and return true */ export function returnTrue ( ) { return true ; } /** Do nothing and return undefined */ export function returnUndefined ( ) { return undefined ; } /** Returns its argument. */ export function identity < T > ( x ) { return x ; } /** Returns lower case string */ export function toLowerCase ( x ) { return x . toLowerCase ( ) ; } export function equateValues < T > ( a , b ) { return a === b ; } export type GetCanonicalFileName = ( fileName : string ) => string ; export function compareComparableValues ( a , b ) ; export function compareComparableValues ( a , b ) ; export function compareComparableValues ( a , b ) { return a === b ? Comparison . EqualTo : a === undefined ? Comparison . LessThan : b === undefined ? Comparison . GreaterThan : a < b ? Comparison . LessThan : Comparison . GreaterThan ; } /**
 * Compare two numeric values for their order relative to each other.
 * To compare strings, use any of the `compareStrings` functions.
 */ export function compareValues ( a , b ) { return compareComparableValues ( a , b ) ; } /**
 * Tests whether a value is an array.
 */ export function isArray ( value ) { return Array . isArray ? Array . isArray ( value ) : value instanceof Array ; } /**
 * Tests whether a value is string
 */ export function isString ( text ) { return typeof text === 'string' ; } export function isNumber ( x ) { return typeof x === 'number' ; } export function isBoolean ( x ) { return typeof x === 'boolean' ; } const hasOwnProperty = Object . prototype . hasOwnProperty ; /**
 * Type of objects whose values are all of the same type.
 * The `in` and `for-in` operators can *not* be safely used,
 * since `Object.prototype` may be modified by outside code.
 */ export interface MapLike < T > { [ index ] : T ; } param map param key export function hasProperty ( map , key ) { return hasOwnProperty . call ( map , key ) ; } param trueOrFalse export function toBoolean ( trueOrFalse ) { const normalized = trueOrFalse ?. trim ( ) . toUpperCase ( ) ; if ( normalized === 'TRUE' ) { return true ; } return false ; } export function isDebugMode ( ) { const argv = process . execArgv . join ( ) ; return argv . includes ( 'inspect' ) || argv . includes ( 'debug' ) ; } interface Thenable < T > { then < TResult > ( onfulfilled ? , onrejected ? ) : Thenable < TResult > ; then < TResult > ( onfulfilled ? , onrejected ? ) : Thenable < TResult > ; } export function isThenable < T > ( v ) { return typeof v ?. then === 'function' ; } export function isDefined < T > ( element ) { return element !== undefined ; }