Updated js-yaml to v4 (#190678)

## Summary
Updated `js-yaml` to `4.1.0`.

This PR also introduces a type override for the `js-yaml` load function
to maintain compatibility across the codebase. Specifically, updated
type definition of the load function looks as follows:

```typescript
function load<T = any>(str: string, opts?: jsyaml.LoadOptions): T;
```

The original type definition of the load function in `js-yaml` changed
from `any` to `unknown`. This change would require extensive type
updates throughout the entire repository to accommodate the `unknown`
type. To avoid widespread type changes and potential issues in the
codebase, the type is overriden back to `any` for now.
This is a temporary measure, we plan to address the necessary type
changes in subsequent PRs, where teams will gradually update the
codebase to work with the `unknown` type.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

## Release note
Updated `js-yaml` to `4.1.0`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
This commit is contained in:
Elena Shostak 2024-09-19 12:25:03 +02:00 committed by GitHub
parent eabb102281
commit 28aa274f66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
130 changed files with 514 additions and 490 deletions

View file

@ -20,7 +20,7 @@ var allManifestPaths = Object.values(manifestsSource).flat();
try {
for (var manifestRelPath of allManifestPaths) {
var manifest = yaml.safeLoad(fs.readFileSync(manifestRelPath, 'utf8'));
var manifest = yaml.load(fs.readFileSync(manifestRelPath, 'utf8'));
if (manifest.enabled) {
manifest.enabled.forEach(function (x) {
console.log(x);