Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
['collection: string|Array'],
ReturnType.Number,
'Returns the number of items in the collection'
),
],
[
'contains',
new FunctionEntity(
['collection: stirng|Array|Map', 'value: stirng|Array|Map'],
ReturnType.Boolean,
'Works to find an item in a string or to find an item in an array or to find a parameter in a complex object. E.g. contains(‘hello world, ‘hello); contains([‘1’, ‘2’], ‘1’); contains({“foo”:”bar”}, “foo”)'
),
],
[
'first',
new FunctionEntity(['collection: string|Array'], ReturnType.Object, 'Returns the first item from the collection'),
],
[
'last',
new FunctionEntity(['collection: string|Array'], ReturnType.Object, 'Returns the last item from the collection'),
],
[
'foreach',
new FunctionEntity(
['collection: Array | Object', 'iteratorName: string', 'function: any'],
ReturnType.Array,
'Operate on each element and return the new collection'
),
],
[
'addDays',
new FunctionEntity(
export function getreturnTypeStrFromReturnType(returnType: ReturnType): string {
let result = '';
switch(returnType) {
case ReturnType.Boolean: result = "boolean";break;
case ReturnType.Number: result = "number";break;
case ReturnType.Object: result = "any";break;
case ReturnType.String: result = "string";break;
case ReturnType.Array: result = "array";break;
}
return result;
}
],
['string', new FunctionEntity(['value: any'], ReturnType.String, 'Return string version of the specified value')],
[
'bool',
new FunctionEntity(
['value: any'],
ReturnType.Boolean,
'Return Boolean representation of the specified string. Bool(‘true’), bool(1)'
),
],
['createArray', new FunctionEntity(['...objects: any[]'], ReturnType.Array, 'Create an array from multiple inputs')],
[
'if',
new FunctionEntity(
['expression: boolean', 'valueIfTrue: any', 'valueIfFalse: any'],
ReturnType.Object,
'if(exp, valueIfTrue, valueIfFalse)'
),
],
[
'rand',
new FunctionEntity(
['minValue: number', 'maxValue: number'],
ReturnType.Number,
'Returns a random number between specified min and max value – rand(, )'
),
],
[
'json',
new FunctionEntity(
['value: string|XML'],
ReturnType.Object,