Skip to content

Commit

Permalink
Update js-yaml to 4.0.5 (opensearch-project#3659)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergey Myssak <sergey.myssak@gmail.com>
Signed-off-by: Andrey Myssak <andreymyssak@gmail.com>
  • Loading branch information
andreymyssak and SergeyMyssak committed Apr 3, 2023
1 parent 2db2c43 commit ba60c89
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"inline-style": "^2.0.0",
"ip-cidr": "^2.1.0",
"joi": "^13.5.2",
"js-yaml": "^3.14.0",
"js-yaml": "^4.1.0",
"json-stable-stringify": "^1.0.1",
"json-stringify-safe": "5.0.1",
"lodash": "^4.17.21",
Expand Down Expand Up @@ -287,7 +287,7 @@
"@types/jest": "^27.4.0",
"@types/joi": "^13.4.2",
"@types/jquery": "^3.3.31",
"@types/js-yaml": "^3.11.1",
"@types/js-yaml": "^4.0.5",
"@types/json-stable-stringify": "^1.0.32",
"@types/json5": "^0.0.30",
"@types/license-checker": "15.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-apm-config-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@elastic/safer-lodash-set": "0.0.0",
"@osd/utils": "1.0.0",
"js-yaml": "^3.14.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/osd-apm-config-loader/src/utils/read_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
*/

import { readFileSync } from 'fs';
import { safeLoad } from 'js-yaml';
import { load } from 'js-yaml';

import { set } from '@elastic/safer-lodash-set';
import { isPlainObject } from 'lodash';
import { ensureDeepObject } from './ensure_deep_object';

const readYaml = (path: string) => safeLoad(readFileSync(path, 'utf8'));
const readYaml = (path: string) => load(readFileSync(path, 'utf8'));

function replaceEnvVarRefs(val: string) {
return val.replace(/\$\{(\w+)\}/g, (match, envVarName) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@osd/config-schema": "1.0.0",
"@osd/logging": "1.0.0",
"@osd/std": "1.0.0",
"js-yaml": "^3.14.0",
"js-yaml": "^4.1.0",
"load-json-file": "^6.2.0",
"lodash": "^4.17.21",
"moment": "^2.24.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/osd-config/src/raw/read_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
*/

import { readFileSync } from 'fs';
import { safeLoad } from 'js-yaml';
import { load } from 'js-yaml';

import { set } from '@elastic/safer-lodash-set';
import { isPlainObject } from 'lodash';
import { ensureDeepObject } from './ensure_deep_object';

const readYaml = (path: string) => safeLoad(readFileSync(path, 'utf8'));
const readYaml = (path: string) => load(readFileSync(path, 'utf8'));

function replaceEnvVarRefs(val: string) {
return val.replace(/\$\{(\w+)\}/g, (match, envVarName) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-optimizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"execa": "^4.0.2",
"fibers": "^5.0.3",
"jest-diff": "^27.5.1",
"js-yaml": "^3.14.0",
"js-yaml": "^4.1.0",
"json-stable-stringify": "^1.0.1",
"lmdb-store": "^1.6.11",
"normalize-path": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/osd-optimizer/src/limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function readLimits(): Limits {
}
}

return yaml ? (Yaml.safeLoad(yaml) as any) : {};
return yaml ? (Yaml.load(yaml) as any) : {};
}

export function validateLimitsForAllBundles(log: ToolingLog, config: OptimizerConfig) {
Expand Down Expand Up @@ -109,6 +109,6 @@ export function updateBundleLimits(log: ToolingLog, config: OptimizerConfig) {
pageLoadAssetSize,
};

Fs.writeFileSync(LIMITS_PATH, Yaml.safeDump(newLimits));
Fs.writeFileSync(LIMITS_PATH, Yaml.dump(newLimits));
log.success(`wrote updated limits to ${LIMITS_PATH}`);
}
4 changes: 2 additions & 2 deletions src/cli/serve/integration_tests/reload_logging_config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import Del from 'del';

import * as Rx from 'rxjs';
import { map, filter, take } from 'rxjs/operators';
import { safeDump } from 'js-yaml';
import { dump } from 'js-yaml';
import { getConfigFromFiles } from '@osd/config';

const legacyConfig = follow('__fixtures__/reload_logging_config/opensearch_dashboards.test.yml');
Expand Down Expand Up @@ -89,7 +89,7 @@ function createConfigManager(configPath: string) {
return {
modify(fn: (input: Record<string, any>) => Record<string, any>) {
const oldContent = getConfigFromFiles([configPath]);
const yaml = safeDump(fn(oldContent));
const yaml = dump(fn(oldContent));
Fs.writeFileSync(configPath, yaml);
},
};
Expand Down
4 changes: 2 additions & 2 deletions src/dev/stylelint/lint_files.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@

import stylelint from 'stylelint';
import path from 'path';
import { safeLoad } from 'js-yaml';
import { load } from 'js-yaml';
import fs from 'fs';
import { createFailError } from '@osd/dev-utils';

// load the include globs from .stylelintrc.yml and convert them to regular expressions for filtering files
const stylelintPath = path.resolve(__dirname, '..', '..', '..', '.stylelintrc.yml');
const styleLintConfig = safeLoad(fs.readFileSync(stylelintPath));
const styleLintConfig = load(fs.readFileSync(stylelintPath));

/**
* Lints a list of files with eslint. eslint reports are written to the log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/

import { accessSync, constants, readFileSync, statSync } from 'fs';
import { safeLoad } from 'js-yaml';
import { load } from 'js-yaml';
import { dirname, join } from 'path';
import { Observable } from 'rxjs';

Expand Down Expand Up @@ -78,7 +78,7 @@ export async function readTelemetryFile<T extends object>(
try {
if (isFileReadable(configPath)) {
const yaml = readFileSync(configPath);
const data = safeLoad(yaml.toString());
const data = load(yaml.toString());

// don't bother returning empty objects
if (Object.keys(data).length) {
Expand Down
4 changes: 2 additions & 2 deletions tasks/function_test_groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ import { resolve } from 'path';

import execa from 'execa';
import grunt from 'grunt';
import { safeLoad } from 'js-yaml';
import { load } from 'js-yaml';

const JOBS_YAML = readFileSync(resolve(__dirname, '../.ci/jobs.yml'), 'utf8');
const TEST_TAGS = safeLoad(JOBS_YAML)
const TEST_TAGS = load(JOBS_YAML)
.JOB.filter((id) => id.startsWith('opensearch-dashboards-ciGroup'))
.map((id) => id.replace(/^opensearch-dashboards-/, ''));

Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3126,10 +3126,10 @@
resolved "https://registry.yarnpkg.com/@types/js-cookie/-/js-cookie-2.2.5.tgz#38dfaacae8623b37cc0b0d27398e574e3fc28b1e"
integrity sha512-cpmwBRcHJmmZx0OGU7aPVwGWGbs4iKwVYchk9iuMtxNCA2zorwdaTz4GkLgs2WGxiRZRFKnV1k6tRUHX7tBMxg==

"@types/js-yaml@^3.11.1":
version "3.12.7"
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.12.7.tgz#330c5d97a3500e9c903210d6e49f02964af04a0e"
integrity sha512-S6+8JAYTE1qdsc9HMVsfY7+SgSuUU/Tp6TYTmITW0PZxiyIMvol3Gy//y69Wkhs0ti4py5qgR3uZH6uz/DNzJQ==
"@types/js-yaml@^4.0.5":
version "4.0.5"
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.5.tgz#738dd390a6ecc5442f35e7f03fa1431353f7e138"
integrity sha512-FhpRzf927MNQdRZP0J5DLIdTXhjLYzeUTmLAu69mnVksLH9CJY3IuSeEgbKUki7GQZm0WqDkGzyxju2EZGD2wA==

"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9":
version "7.0.11"
Expand Down Expand Up @@ -11234,14 +11234,14 @@ js-yaml-js-types@1.0.0:
dependencies:
esprima "^4.0.1"

js-yaml@4.1.0:
js-yaml@4.1.0, js-yaml@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
dependencies:
argparse "^2.0.1"

js-yaml@^3.13.1, js-yaml@^3.14.0, js-yaml@~3.14.0:
js-yaml@^3.13.1, js-yaml@~3.14.0:
version "3.14.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
Expand Down

0 comments on commit ba60c89

Please sign in to comment.