External module "src/util/index"
Functions
asArray
- asArray<T>(v?: T | T[]): T[]
-
Type parameters
Parameters
Returns T[]
collectInstancesOf
- collectInstancesOf<T>(xs: any[], C: Constructor<T>): T[]
-
Type parameters
Parameters
Returns T[]
collectInstancesOfInMap
- collectInstancesOfInMap<T>(map: any, C: Constructor<T>): Array<[string, T]>
-
Type parameters
Parameters
Returns Array<[string, T]>
defined
-
Parameters
Returns boolean
find
- find<T>(xs: T[], f: function): Opt<T>
-
Type parameters
Parameters
-
xs: T[]
-
f: function
-
-
Parameters
Returns boolean
Returns Opt<T>
firstToUpper
- firstToUpper(q: string): string
-
Parameters
Returns string
flatMap
- flatMap<T, U>(xs: T[], f: function): U[]
-
Type parameters
Parameters
Returns U[]
flatten
- flatten<T>(xss: T[]): T[]
-
Type parameters
Parameters
Returns T[]
flattenArrayOfObjects
- flattenArrayOfObjects<T>(x: object[]): object
-
Type parameters
Parameters
Returns object
fromTuples
- fromTuples<U>(tuples: Array<[string, U]>): object
-
Type parameters
Parameters
-
tuples: Array<[string, U]>
Returns object
getAllRequiredExternalModulesFromCode
- getAllRequiredExternalModulesFromCode(code: string): string[]
-
Parameters
Returns string[]
ifInstanceOf
- ifInstanceOf<T>(v: any, C: Constructor<T>, f: function): void
-
Type parameters
Parameters
Returns void
iff
- iff<T>(v: T, f: function): void
-
Type parameters
Parameters
Returns void
indexed
- indexed(objects: Array<Dict<any>>, key: string, delKey?: boolean): Dict<Dict<any>>
-
Parameters
-
objects: Array<Dict<any>>
-
key: string
-
Default value delKey: boolean = false
isEssential
- isEssential(arg: any): boolean
-
Parameters
Returns boolean
isInstance
-
Type parameters
Parameters
Returns T[]
isRAMLUrl
- isRAMLUrl(str: string): boolean
-
Parameters
Returns boolean
kv
- kv<T>(obj: Dict<T>, iter: function): void
-
Type parameters
Parameters
-
-
iter: function
-
- (string: any, T: any): void
Returns void
lazyprop
- lazyprop(obj: Object, key: string, func: Function): void
-
Parameters
-
obj: Object
-
key: string
-
func: Function
Returns void
lazypropkeyfilter
- lazypropkeyfilter(k: string): boolean
-
Parameters
Returns boolean
replace
- replace(str: string, x: string, r: string): string
-
Parameters
-
str: string
-
x: string
-
r: string
Returns string
replaceMap
- replaceMap(str: string, map: object): string
-
Parameters
Returns string
shallowCopy
-
Type parameters
Parameters
Returns Dict<T>
stringEndsWith
- stringEndsWith(str: string, search: string): boolean
-
Parameters
-
str: string
-
search: string
Returns boolean
stringStartsWith
- stringStartsWith(str: string, search: string, ind?: number): boolean
-
Parameters
-
str: string
-
search: string
-
Default value ind: number = 0
Returns boolean
takeWhile
- takeWhile<T>(xs: T[], f: function): T[]
-
Type parameters
Parameters
-
xs: T[]
-
f: function
-
-
Parameters
Returns boolean
Returns T[]
tap
- tap<T>(v: T, f: function): T
-
Type parameters
Parameters
Returns T
toTuples
- toTuples<U>(map: object): Array<[string, U]>
-
Type parameters
Parameters
Returns Array<[string, U]>
updateObject
- updateObject(source: any, target: any, addNewFields?: boolean): void
-
Parameters
-
source: any
-
target: any
-
Default value addNewFields: boolean = false
Returns void
Arrays of Objects are common in RAML08.