Skip to content

Commit

Permalink
fix checks
Browse files Browse the repository at this point in the history
  • Loading branch information
bhapas committed Oct 10, 2024
1 parent 1fb9e86 commit b2f0f99
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ describe('renderPackageManifestYAML', () => {
};
const manifestContent = renderPackageManifestYAML(integration);
// The manifest content must be parseable as YAML.
const manifest = yaml.load(manifestContent) as Record<string, unknown>;
const manifest = yaml.safeLoad(manifestContent) as Record<string, unknown>;
expect(manifest).toBeDefined();
expect(manifest.title).toBe(integration.title);
expect(manifest.name).toBe(integration.name);
expect(manifest.type).toBe('integration');
expect(manifest.description).toBe(integration.description);
expect(manifest.icons).toBeTruthy();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import nunjucks from 'nunjucks';
import { join as joinPath } from 'path';
import { load } from 'js-yaml';
import { safeLoad } from 'js-yaml';
import type { DataStream } from '../../common';
import { copySync, createSync, ensureDirSync, listDirSync, readSync } from '../util';
import { Field } from '../util/samples';
Expand Down Expand Up @@ -79,7 +79,7 @@ function loadFieldsFromFiles(sourcePath: string, files: string[]): Field[] {
return files.flatMap((file) => {
const filePath = joinPath(sourcePath, file);
const content = readSync(filePath);
return load(content) as Field[];
return safeLoad(content) as Field[];
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import nunjucks from 'nunjucks';
import { load } from 'js-yaml';
import { safeLoad } from 'js-yaml';
import { Field } from '../util/samples';
import { createSync, generateFields, mergeSamples } from '../util';

Expand Down Expand Up @@ -35,13 +35,13 @@ function createBaseFields(
});
createSync(`${dataStreamFieldsDir}/base-fields.yml`, baseFields);

return load(baseFields) as Field[];
return safeLoad(baseFields) as Field[];
}

function createCustomFields(dataStreamFieldsDir: string, pipelineResults: object[]): Field[] {
const mergedResults = mergeSamples(pipelineResults);
const fieldKeys = generateFields(mergedResults);
createSync(`${dataStreamFieldsDir}/fields.yml`, fieldKeys);

return load(fieldKeys) as Field[];
return safeLoad(fieldKeys) as Field[];
}

0 comments on commit b2f0f99

Please sign in to comment.