Skip to content

Commit

Permalink
copy missing stringify module from main
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-tavares committed Feb 8, 2024
1 parent df1d7e2 commit fc668b6
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { inspect } from 'util';

/**
* Safely traverse some content (object, array, etc) and stringify it
* @param content
* @param depth
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const stringify = (content: any, depth = 8): string => {
return inspect(content, { depth });
};

0 comments on commit fc668b6

Please sign in to comment.