Skip to content

Commit 83c9673

Browse files
committed
Upgrade js-yaml dependency
Don't need safe* functions anymore according to https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md#400---2021-01-03
1 parent 08d86f4 commit 83c9673

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@
431431
"devDependencies": {
432432
"@types/cheerio": "^0.22.30",
433433
"@types/glob": "^7.1.4",
434-
"@types/js-yaml": "^3.12.3",
434+
"@types/js-yaml": "^4.0.5",
435435
"@types/lodash-es": "^4.17.3",
436436
"@types/lru-cache": "^4.1.2",
437437
"@types/mocha": "^9.0.0",
@@ -463,7 +463,7 @@
463463
"dependencies": {
464464
"cheerio": "^1.0.0-rc.10",
465465
"extend": ">=3.0.2",
466-
"js-yaml": "^3.13.1",
466+
"js-yaml": "^4.1.0",
467467
"lodash-es": "^4.17.21",
468468
"lru-cache": "^4.1.5",
469469
"request": "^2.88.2",

src/commands/importIdentifier.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ const doImport = async (arg: { mod: string; package: string }): Promise<void> =>
5858
try {
5959
const hpackDoc = await vscode.workspace.openTextDocument(vscode.workspace.rootPath + '/package.yaml');
6060

61-
const hpack: any = yaml.safeLoad(hpackDoc.getText());
61+
const hpack: any = yaml.load(hpackDoc.getText());
6262
hpack.dependencies = hpack.dependencies || [];
6363
if (!hpack.dependencies.some((dep: string) => new RegExp(escapeRegExp(arg.package)).test(dep))) {
6464
hpack.dependencies.push(arg.package);
6565
edit.replace(
6666
hpackDoc.uri,
6767
new vscode.Range(new vscode.Position(0, 0), hpackDoc.lineAt(hpackDoc.lineCount - 1).range.end),
68-
yaml.safeDump(hpack)
68+
yaml.dump(hpack)
6969
);
7070
}
7171
} catch (e) {

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@
124124
"@types/minimatch" "*"
125125
"@types/node" "*"
126126

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

132132
"@types/json-schema@*", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9":
133133
version "7.0.11"

0 commit comments

Comments
 (0)