xml-beautify.pipe.ts 351 B

1234567891011121314
  1. import { Pipe, PipeTransform } from '@angular/core';
  2. import * as vkbeautify from 'vkbeautify';
  3. import { replaceMultispaces } from '../utils/xml-utils';
  4. @Pipe({
  5. name: 'xmlBeautify',
  6. })
  7. export class XmlBeautifyPipe implements PipeTransform {
  8. transform(value: string) {
  9. return vkbeautify.xml(replaceMultispaces('\n' + value));
  10. }
  11. }