All Downloads are FREE. Search and download functionalities are using the official Maven repository.

node_modules.apollo-codegen-scala.src.values.ts Maven / Gradle / Ivy

There is a newer version: 3.3.1
Show newest version
import { LegacyCompilerContext } from 'apollo-codegen-core/lib/compiler/legacyIR';
import CodeGenerator from 'apollo-codegen-core/lib/utilities/CodeGenerator';

export function escapedString(string: string) {
  return string.replace(/"/g, '\\"');
}

export function multilineString(generator: CodeGenerator, string: string) {
  const lines = string.split('\n');
  lines.forEach((line, index) => {
    const isLastLine = index != lines.length - 1;
    generator.printOnNewline(`"${escapedString(line)}"` + (isLastLine ? ' +' : ''));
  });
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy