Skip to content

Commit f588fed

Browse files
committed
fix(api-client): basic types regex checks word boundaries
fixes #44 Signed-off-by: Vojtech Masek <[email protected]>
1 parent 639ac07 commit f588fed

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Spec as Swagger } from 'swagger-schema-official';
22

3-
const BASIC_TS_TYPE_REGEX = /^string|number|integer|boolean|null|undefined|any|Object|Date|File|Blob$/;
3+
const BASIC_TS_TYPE_REGEX = /\b(string|number|integer|boolean|null|undefined|any|Object|Date|File|Blob)\b/;
44

55
export function camelCase(text: string = '', lowerFirst: boolean = true): string {
66
text = removeDuplicateWords(text);

tests/github/api/api-client.service.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,10 +2877,10 @@ export class APIClient {
28772877
xRateLimitRemaining?: number,
28782878
xRateLimitReset?: number,
28792879
xGitHubRequestId?: number,
2880-
body: deleteFileBody,
2880+
body: models.DeleteFileBody,
28812881
},
28822882
options?: HttpOptions
2883-
): Observable<deleteFile> {
2883+
): Observable<models.DeleteFile> {
28842884
const path = `/repos/${args.owner}/${args.repo}/contents/${args.path}`;
28852885
options = {...this.options, ...options};
28862886

@@ -2902,7 +2902,7 @@ export class APIClient {
29022902
if ('xGitHubRequestId' in args) {
29032903
options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId));
29042904
}
2905-
return this.sendRequest<deleteFile>('DELETE', path, options, JSON.stringify(args.body));
2905+
return this.sendRequest<models.DeleteFile>('DELETE', path, options, JSON.stringify(args.body));
29062906
}
29072907

29082908
getReposOwnerRepoContentsPath(
@@ -2962,10 +2962,10 @@ export class APIClient {
29622962
xRateLimitRemaining?: number,
29632963
xRateLimitReset?: number,
29642964
xGitHubRequestId?: number,
2965-
body: createFileBody,
2965+
body: models.CreateFileBody,
29662966
},
29672967
options?: HttpOptions
2968-
): Observable<createFile> {
2968+
): Observable<models.CreateFile> {
29692969
const path = `/repos/${args.owner}/${args.repo}/contents/${args.path}`;
29702970
options = {...this.options, ...options};
29712971

@@ -2987,7 +2987,7 @@ export class APIClient {
29872987
if ('xGitHubRequestId' in args) {
29882988
options.headers = options.headers.set('X-GitHub-Request-Id', String(args.xGitHubRequestId));
29892989
}
2990-
return this.sendRequest<createFile>('PUT', path, options, JSON.stringify(args.body));
2990+
return this.sendRequest<models.CreateFile>('PUT', path, options, JSON.stringify(args.body));
29912991
}
29922992

29932993
getReposOwnerRepoContributors(

0 commit comments

Comments
 (0)