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

src.app.shared.pipes.stringify.pipe.ts Maven / Gradle / Ivy

The newest version!
/*
 * SPDX-FileCopyrightText: 2017-2024 Enedis
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 */

import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'stringify'
})
export class StringifyPipe implements PipeTransform {

  transform(value: any, args?: any): any {
    if (value instanceof Object) {
        return JSON.stringify(value, args?.replacer, args?.space);
    } else {
        return value;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy