Skip to content

Commit 08c65c5

Browse files
committed
fix: uses of json-schema-ref-parser
1 parent d0f4fcb commit 08c65c5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app-config-cli/src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as yargs from 'yargs';
44
import execa from 'execa';
55
import clipboardy from 'clipboardy';
66
import { outputFile, readFile } from 'fs-extra';
7-
import { resolve } from 'json-schema-ref-parser';
7+
import RefParser, { resolve } from 'json-schema-ref-parser';
88
import { stripIndents } from 'common-tags';
99
import { Json, JsonObject } from '@app-config/utils';
1010
import {
@@ -257,7 +257,8 @@ async function loadConfigWithOptions({
257257
}
258258

259259
if (select) {
260-
jsonConfig = (await resolve(jsonConfig)).get(select) as JsonObject;
260+
// @ts-ignore
261+
jsonConfig = (await resolve.apply(RefParser, [jsonConfig])).get(select) as JsonObject;
261262

262263
if (jsonConfig === undefined) {
263264
throw new FailedToSelectSubObject(`Failed to select property ${select}`);
@@ -474,7 +475,8 @@ export const cli = yargs
474475
let toPrint: Json;
475476

476477
if (opts.select) {
477-
const refs = await resolve(schema);
478+
// @ts-ignore
479+
const refs = await resolve.apply(RefParser, [schema]);
478480

479481
toPrint = refs.get(opts.select);
480482

0 commit comments

Comments
 (0)