stoplightio/yaml

View on GitHub
src/safeStringify.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { DumpOptions, safeDump } from '@stoplight/yaml-ast-parser';

export const safeStringify = (value: unknown, options?: DumpOptions): string =>
  typeof value === 'string' ? value : safeDump(value, options);