-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
copy missing
stringify
module from main
- Loading branch information
1 parent
df1d7e2
commit fc668b6
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
x-pack/plugins/security_solution/server/endpoint/utils/stringify.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }); | ||
}; |