Skip to content

Commit 0428941

Browse files
authored
Merge pull request #688 from brendandburns/rev
Upgrade js-yaml to 4.1.0
2 parents 6bd7e94 + b1770d7 commit 0428941

File tree

4 files changed

+115
-28
lines changed

4 files changed

+115
-28
lines changed

package-lock.json

Lines changed: 108 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"author": "Kubernetes Authors",
5555
"license": "Apache-2.0",
5656
"dependencies": {
57-
"@types/js-yaml": "^3.12.1",
57+
"@types/js-yaml": "^4.0.1",
5858
"@types/node": "^10.12.0",
5959
"@types/request": "^2.47.1",
6060
"@types/stream-buffers": "^3.0.3",
@@ -64,7 +64,7 @@
6464
"byline": "^5.0.0",
6565
"execa": "5.0.0",
6666
"isomorphic-ws": "^4.0.1",
67-
"js-yaml": "^3.13.1",
67+
"js-yaml": "^4.1.0",
6868
"jsonpath-plus": "^0.19.0",
6969
"openid-client": "^4.1.1",
7070
"request": "^2.88.0",

src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import execa = require('execa');
22
import fs = require('fs');
33
import https = require('https');
4+
import yaml = require('js-yaml');
45
import net = require('net');
56
import path = require('path');
67

7-
import yaml = require('js-yaml');
88
import request = require('request');
99
import shelljs = require('shelljs');
1010

@@ -157,7 +157,7 @@ export class KubeConfig {
157157
}
158158

159159
public loadFromString(config: string, opts?: Partial<ConfigOptions>): void {
160-
const obj = yaml.safeLoad(config);
160+
const obj = yaml.load(config) as any;
161161
this.clusters = newClusters(obj.clusters, opts);
162162
this.contexts = newContexts(obj.contexts, opts);
163163
this.users = newUsers(obj.users, opts);

src/yaml.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import * as yaml from 'js-yaml';
22

33
export function loadYaml<T>(data: string, opts?: yaml.LoadOptions): T {
4-
return yaml.safeLoad(data, opts) as T;
4+
return (yaml.load(data, opts) as any) as T;
55
}
66

77
export function loadAllYaml(data: string, opts?: yaml.LoadOptions): any[] {
8-
return yaml.safeLoadAll(data, undefined, opts);
8+
return yaml.loadAll(data, undefined, opts);
99
}
1010

1111
export function dumpYaml(object: any, opts?: yaml.DumpOptions): string {
12-
return yaml.safeDump(object, opts);
12+
return yaml.dump(object, opts);
1313
}

0 commit comments

Comments
 (0)