Commit a3d1801 1 parent 71ba6cc commit a3d1801 Copy full SHA for a3d1801
File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ export default class $Refs<S extends JSONSchema = JSONSchema> {
31
31
*
32
32
* @param types (optional) Optionally only return certain types of paths ("file", "http", etc.)
33
33
*/
34
- paths ( ...types : string [ ] ) : string [ ] {
35
- const paths = getPaths ( this . _$refs , types ) ;
34
+ paths ( ...types : ( string | string [ ] ) [ ] ) : string [ ] {
35
+ const paths = getPaths ( this . _$refs , types . flat ( ) ) ;
36
36
return paths . map ( ( path ) => {
37
37
return convertPathToPosix ( path . decoded ) ;
38
38
} ) ;
@@ -45,9 +45,9 @@ export default class $Refs<S extends JSONSchema = JSONSchema> {
45
45
*
46
46
* @param types (optional) Optionally only return values from certain locations ("file", "http", etc.)
47
47
*/
48
- values ( ...types : string [ ] ) : S {
48
+ values ( ...types : ( string | string [ ] ) [ ] ) : S {
49
49
const $refs = this . _$refs ;
50
- const paths = getPaths ( $refs , types ) ;
50
+ const paths = getPaths ( $refs , types . flat ( ) ) ;
51
51
return paths . reduce < Record < string , any > > ( ( obj , path ) => {
52
52
obj [ convertPathToPosix ( path . decoded ) ] = $refs [ path . encoded ] . value ;
53
53
return obj ;
You can’t perform that action at this time.
0 commit comments