utils: { argv: { [key: string ]: string ; } ; arrayStartingMatch: ( ( a: any [] , b: any [] ) => boolean ) ; arrayUnique: ( ( arr: any [] ) => any [] ) ; collapseObjectToArray: ( ( obj: Record < string , any > ) => any [] | boolean ) ; deepCopy: ( < T > ( obj: T ) => T ) ; ensureNoTsHeaderOrSpecFiles: ( ( files: string [] ) => string [] ) ; eventLoopDelay: ( ( iterations?: number ) => Promise < number > ) ; fileUtils: { createDirSafely: ( ( dir: string ) => string ) ; createFileSafely: ( ( file: string , data: string | ArrayBufferView , overwrite?: boolean ) => string ) ; createLinkfileSafely: ( ( filePath: string , type: string ) => string ) ; createSymlinkSafely: ( ( destination: string , source: string ) => string ) ; dirExists: ( ( dir: string ) => boolean ) ; fileExists: ( ( file: string ) => boolean ) ; removeLinkfileSafely: ( ( filePath: string ) => string ) ; } ; filterObjectForLogging: ( ( params: Record < string , any > ) => Record < string , any > ) ; filterResponseForLogging: ( ( response: Record < string , any > ) => { [key: string ]: any ; } ) ; getExternalIPAddress: ( ( ) => string ) ; hashMerge: ( ( a: Record < string , any > , b: Record < string , any > , arg?: Record < string , any > ) => { [key: string ]: any ; } ) ; isPlainObject: ( ( o: any ) => boolean ) ; isRunning: ( ( pid: number ) => boolean ) ; parseCookies: ( ( req: { headers: { [key: string ]: string | string [] ; } ; } ) => object ) ; parseHeadersForClientAddress: ( ( headers: Record < string , string | string [] > ) => { ip: string ; port: string | number ; } ) ; parseIPv6URI: ( ( addr: string ) => { host: string ; port: number ; } ) ; replaceDistWithSrc: ( ( f: string ) => string ) ; safeGlobSync: ( ( match: string , args?: IOptions ) => string [] ) ; sleep: ( ( time: number ) => Promise < void > ) ; sortGlobalMiddleware: ( ( globalMiddlewareList: any [] , middleware: { [key: string ]: any ; } ) => void ) ; sourceRelativeLinkPath: ( ( linkFile: string , pluginPaths: string [] ) => string | boolean ) ; } = ...
Type declaration
argv: { [key: string ]: string ; }
array Starting Match: ( ( a: any [] , b: any [] ) => boolean )
( a: any [] , b: any [] ) : boolean
Returns boolean
array Unique: ( ( arr: any [] ) => any [] )
( arr: any [] ) : any []
Returns any []
collapse Object To Array: ( ( obj: Record < string , any > ) => any [] | boolean )
( obj: Record < string , any > ) : any [] | boolean
Returns any [] | boolean
deep Copy: ( < T > ( obj: T ) => T )
ensure No Ts Header Or Spec Files: ( ( files: string [] ) => string [] )
event Loop Delay: ( ( iterations?: number ) => Promise < number > )
( iterations?: number ) : Promise < number >
Parameters
iterations: number = 10000
Returns Promise < number >
file Utils: { createDirSafely: ( ( dir: string ) => string ) ; createFileSafely: ( ( file: string , data: string | ArrayBufferView , overwrite?: boolean ) => string ) ; createLinkfileSafely: ( ( filePath: string , type: string ) => string ) ; createSymlinkSafely: ( ( destination: string , source: string ) => string ) ; dirExists: ( ( dir: string ) => boolean ) ; fileExists: ( ( file: string ) => boolean ) ; removeLinkfileSafely: ( ( filePath: string ) => string ) ; }
create Dir Safely: ( ( dir: string ) => string )
( dir: string ) : string
Returns string
create File Safely: ( ( file: string , data: string | ArrayBufferView , overwrite?: boolean ) => string )
( file: string , data: string | ArrayBufferView , overwrite?: boolean ) : string
Parameters
file: string
data: string | ArrayBufferView
overwrite: boolean = false
Returns string
create Linkfile Safely: ( ( filePath: string , type: string ) => string )
( filePath: string , type: string ) : string
Parameters
filePath: string
type: string
Returns string
create Symlink Safely: ( ( destination: string , source: string ) => string )
( destination: string , source: string ) : string
Parameters
destination: string
source: string
Returns string
dir Exists: ( ( dir: string ) => boolean )
( dir: string ) : boolean
Returns boolean
file Exists: ( ( file: string ) => boolean )
( file: string ) : boolean
Returns boolean
remove Linkfile Safely: ( ( filePath: string ) => string )
( filePath: string ) : string
Returns string
filter Object For Logging: ( ( params: Record < string , any > ) => Record < string , any > )
( params: Record < string , any > ) : Record < string , any >
Parameters
params: Record < string , any >
Returns Record < string , any >
filter Response For Logging: ( ( response: Record < string , any > ) => { [key: string ]: any ; } )
( response: Record < string , any > ) : { [key: string ]: any ; }
Parameters
response: Record < string , any >
Returns { [key: string ]: any ; }
get ExternalIPAddress: ( ( ) => string )
( ) : string
Returns string
hash Merge: ( ( a: Record < string , any > , b: Record < string , any > , arg?: Record < string , any > ) => { [key: string ]: any ; } )
( a: Record < string , any > , b: Record < string , any > , arg?: Record < string , any > ) : { [key: string ]: any ; }
Parameters
a: Record < string , any >
b: Record < string , any >
Optional
arg: Record < string , any >
Returns { [key: string ]: any ; }
is Plain Object: ( ( o: any ) => boolean )
( o: any ) : boolean
Returns boolean
is Running: ( ( pid: number ) => boolean )
( pid: number ) : boolean
Returns boolean
parse Cookies: ( ( req: { headers: { [key: string ]: string | string [] ; } ; } ) => object )
( req: { headers: { [key: string ]: string | string [] ; } ; } ) : object
Parameters
req: { headers: { [key: string ]: string | string [] ; } ; }
headers: { [key: string ]: string | string [] ; }
[ key: string ]: string | string []
Returns object
parse Headers For Client Address: ( ( headers: Record < string , string | string [] > ) => { ip: string ; port: string | number ; } )
Parameters
headers: Record < string , string | string [] >
Returns { ip: string ; port: string | number ; }
ip: string
port: string | number
parseIPv6URI: ( ( addr: string ) => { host: string ; port: number ; } )
( addr: string ) : { host: string ; port: number ; }
Returns { host: string ; port: number ; }
host: string
port: number
replace Dist With Src: ( ( f: string ) => string )
( f: string ) : string
Returns string
safe Glob Sync: ( ( match: string , args?: IOptions ) => string [] )
( match: string , args?: IOptions ) : string []
Parameters
match: string
args: IOptions = {}
Returns string []
sleep: ( ( time: number ) => Promise < void > )
( time: number ) : Promise < void >
Returns Promise < void >
sort Global Middleware: ( ( globalMiddlewareList: any [] , middleware: { [key: string ]: any ; } ) => void )
( globalMiddlewareList: any [] , middleware: { [key: string ]: any ; } ) : void
Parameters
globalMiddlewareList: any []
middleware: { [key: string ]: any ; }
Returns void
source Relative Link Path: ( ( linkFile: string , pluginPaths: string [] ) => string | boolean )
( linkFile: string , pluginPaths: string [] ) : string | boolean
Parameters
linkFile: string
pluginPaths: string []
Returns string | boolean
Defined in src/modules/utils.ts:35
Utility functions for Actionhero