sample-proxies/graphql-sample/graphql-proxy/apiproxy/resources/jsc/graphql.jsc.js
/**
     * Produces the value of a block string from its parsed raw value, similar to
     * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.
     *
     * This implements the GraphQL spec's BlockStringValue() static algorithm.
     */
Produces the value of a block string from its parsed raw value, similar to
CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.

This implements the GraphQL spec's BlockStringValue() static algorithm.
Produces the value of a block string from its parsed raw value similar to CoffeeScript ' s block string Python ' s docstring trim or Ruby ' s strip_heredoc . This implements the GraphQL spec ' s BlockStringValue () static algorithm .
function blockStringValue(rawString) {
      var lines = rawString.split(/\r\n|[\n\r]/g); 
      var commonIndent = null;
      for (var i = 1; i < lines.length; i++) {
        var line = lines[i];
        var indent = leadingWhitespace(line);
        if (indent < line.length && (commonIndent === null || indent < commonIndent)) {
          commonIndent = indent;
          if (commonIndent === 0) {
            break;
          }
        }
      }
      if (commonIndent) {
        for (var _i = 1; _i < lines.length; _i++) {
          lines[_i] = lines[_i].slice(commonIndent);
        }
      } 
      while (lines.length > 0 && isBlank(lines[0])) {
        lines.shift();
      }
      while (lines.length > 0 && isBlank(lines[lines.length - 1])) {
        lines.pop();
      } 
      return lines.join('\n');
    }
function blockStringValue ( rawString ) { var lines = rawString . split ( / \r\n|[\n\r] / g ) ; var commonIndent = null ; for ( var i = 1 ; i < lines . length ; i ++ ) { var line = lines [ i ] ; var indent = leadingWhitespace ( line ) ; if ( indent < line . length && ( commonIndent === null || indent < commonIndent ) ) { commonIndent = indent ; if ( commonIndent === 0 ) { break ; } } } if ( commonIndent ) { for ( var _i = 1 ; _i < lines . length ; _i ++ ) { lines [ _i ] = lines [ _i ] . slice ( commonIndent ) ; } } while ( lines . length > 0 && isBlank ( lines [ 0 ] ) ) { lines . shift ( ) ; } while ( lines . length > 0 && isBlank ( lines [ lines . length - 1 ] ) ) { lines . pop ( ) ; } return lines . join ( '\n' ) ; }
Produces the value of a block string from its parsed raw value, similar to
 CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.
Produces the value of a block string from its parsed raw value similar to CoffeeScript ' s block string Python ' s docstring trim or Ruby ' s strip_heredoc .
// Expand a block string's raw value into independent lines. // Remove common indentation from all lines but first. // Remove leading and trailing blank lines. // Return a string of the lines joined with U+000A.