How to use the adaptive-expressions.ReturnType.Array function in adaptive-expressions

To help you get started, we’ve selected a few adaptive-expressions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / BotBuilder-Samples / experimental / adaptive-tool / src / lg / buildinFunctions.ts View on Github external
'Returns the index of the value from the text'
    ),
  ],
  [
    'lastIndexOf',
    new FunctionEntity(
      ['text: string', 'value: string'],
      ReturnType.Number,
      'Returns the last index of the value from the text'
    ),
  ],
  [
    'union',
    new FunctionEntity(
      ['...values: Array[]'],
      ReturnType.Array,
      'Produces the set union of two sequences by using the default equality comparer.'
    ),
  ],
  [
    'intersection',
    new FunctionEntity(
      ['...values: Array[]'],
      ReturnType.Array,
      ' Produces the set intersection of two sequences by using the default equality comparer to compare values.'
    ),
  ],
  [
    'skip',
    new FunctionEntity(
      ['array: Array', 'length: number'],
      ReturnType.Array,
github microsoft / BotBuilder-Samples / experimental / adaptive-tool / src / lg / buildinFunctions.ts View on Github external
'Replace a substring with the specified string, and return the updated string. case sensitive'
    ),
  ],
  [
    'replaceIgnoreCase',
    new FunctionEntity(
      ['text: string', 'oldText: string', 'newText: string'],
      ReturnType.String,
      'Replace a substring with the specified string, and return the updated string. Case in-sensitive'
    ),
  ],
  [
    'split',
    new FunctionEntity(
      ['text: string', 'delimiter: string'],
      ReturnType.Array,
      'Returns an array that contains substrings based on the delimiter specified.'
    ),
  ],
  [
    'substring',
    new FunctionEntity(
      ['text: string', 'startIndex: number', 'length?: number'],
      ReturnType.String,
      'Returns characters from a string. Substring(sourceString, startPos, endPos). startPos cannot be less than 0. endPos greater than source strings length will be taken as the max length of the string'
    ),
  ],
  ['toLower', new FunctionEntity(['text: string'], ReturnType.String, 'Convert a string to all upper case characters')],
  ['toUpper', new FunctionEntity(['text: string'], ReturnType.String, 'Convert a string to all lower case characters')],
  [
    'trim',
    new FunctionEntity(['text: string'], ReturnType.String, 'Remove leading and trailing white spaces from a string'),
github microsoft / BotBuilder-Samples / experimental / adaptive-tool / src / lg / util.ts View on Github external
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;
}