Skip to content

Commit 5be8ce7

Browse files
authored
fix: update js-yaml imports for v5 compatibility
1 parent b8c5de0 commit 5be8ce7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from 'node:fs';
22
import https from 'node:https';
33
import http from 'node:http';
44
import tls from 'node:tls';
5-
import yaml from 'js-yaml';
5+
import * as yaml from 'js-yaml';
66
import net from 'node:net';
77
import path from 'node:path';
88

‎src/yaml.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import yaml from 'js-yaml';
1+
import * as yaml from 'js-yaml';
22
import { getSerializationType } from './util.js';
33
import { KubernetesObject } from './types.js';
44
import { ObjectSerializer } from './serializer.js';
@@ -26,7 +26,7 @@ export function loadYaml<T>(data: string, opts?: yaml.LoadOptions): T {
2626
* @returns An array of deserialized Kubernetes objects.
2727
*/
2828
export function loadAllYaml(data: string, opts?: yaml.LoadOptions): any[] {
29-
const ymls = yaml.loadAll(data, undefined, opts);
29+
const ymls = yaml.loadAll(data, null, opts) as any[];
3030
return ymls.map((yml) => {
3131
const obj = yml as KubernetesObject;
3232
const type = getSerializationType(obj.apiVersion, obj.kind);

0 commit comments

Comments
 (0)