@hey-api/json-schema-ref-parser 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/index.d.ts +1 -1
- package/lib/index.ts +1 -1
- package/lib/parsers/binary.ts +1 -1
- package/package.json +1 -1
package/dist/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import $Refs from "./refs.js";
|
|
|
2
2
|
import type { JSONSchema } from "./types/index.js";
|
|
3
3
|
interface ResolvedInput {
|
|
4
4
|
path: string;
|
|
5
|
-
schema: string | JSONSchema | Buffer
|
|
5
|
+
schema: string | JSONSchema | Buffer | Awaited<JSONSchema> | undefined;
|
|
6
6
|
type: 'file' | 'json' | 'url';
|
|
7
7
|
}
|
|
8
8
|
export declare const getResolvedInput: ({ pathOrUrlOrSchema, }: {
|
package/lib/index.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { fileResolver } from "./resolvers/file.js";
|
|
|
13
13
|
|
|
14
14
|
interface ResolvedInput {
|
|
15
15
|
path: string;
|
|
16
|
-
schema: string | JSONSchema | Buffer
|
|
16
|
+
schema: string | JSONSchema | Buffer | Awaited<JSONSchema> | undefined;
|
|
17
17
|
type: 'file' | 'json' | 'url';
|
|
18
18
|
}
|
|
19
19
|
|
package/lib/parsers/binary.ts
CHANGED
|
@@ -5,7 +5,7 @@ const BINARY_REGEXP = /\.(jpeg|jpg|gif|png|bmp|ico)$/i;
|
|
|
5
5
|
|
|
6
6
|
export const binaryParser: Plugin = {
|
|
7
7
|
canHandle: (file: FileInfo) => Buffer.isBuffer(file.data) && BINARY_REGEXP.test(file.url),
|
|
8
|
-
handler: (file: FileInfo): Buffer
|
|
8
|
+
handler: (file: FileInfo): Buffer => Buffer.isBuffer(file.data)
|
|
9
9
|
? file.data
|
|
10
10
|
// This will reject if data is anything other than a string or typed array
|
|
11
11
|
: Buffer.from(file.data),
|