How to use the yaml/types.strOptions function in yaml

To help you get started, we’ve selected a few yaml 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 aws / aws-cdk / packages / aws-cdk / lib / serialize.ts View on Github external
export function toYAML(obj: any): string {
  const oldFold = yamlTypes.strOptions.fold.lineWidth;
  try {
    yamlTypes.strOptions.fold.lineWidth = 0;
    return YAML.stringify(obj, { schema: 'yaml-1.1' });
  } finally {
    yamlTypes.strOptions.fold.lineWidth = oldFold;
  }
}
github aws / aws-cdk / packages / aws-cdk / lib / serialize.ts View on Github external
export function toYAML(obj: any): string {
  const oldFold = yamlTypes.strOptions.fold.lineWidth;
  try {
    yamlTypes.strOptions.fold.lineWidth = 0;
    return YAML.stringify(obj, { schema: 'yaml-1.1' });
  } finally {
    yamlTypes.strOptions.fold.lineWidth = oldFold;
  }
}