Skip to content

Commit

Permalink
chore: updates to TS v5 to remove linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixelik committed Nov 10, 2023
1 parent 662c3b3 commit ca7af90
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
6 changes: 3 additions & 3 deletions addon/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ export type Nullable<T> = T | null | undefined;

export type PlainObject<T = string | number | boolean> = {
[key: string]: T | PlainObject<T> | PlainObject<T>[] | undefined | null;
}
};

export type PlainHeaders = {
[key: string]: string;
}
};

export type Method =
| 'HEAD'
Expand All @@ -30,7 +30,7 @@ export type Credentials = 'omit' | 'same-origin' | 'include';

export type FetchOptions = Mix<
AjaxOptions,
{ body?: BodyInit | null; method?: Method, credentials: Credentials }
{ body?: BodyInit | null; method?: Method; credentials: Credentials }
>;

export function isPlainObject(obj: any): obj is PlainObject {
Expand Down
2 changes: 1 addition & 1 deletion addon/utils/determine-body-promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function determineBodyPromise(
response: Response,
requestData: JQueryAjaxSettings
): Promise<object | string | undefined> {
return response.text().then(function(payload) {
return response.text().then(function (payload) {
let ret: string | object | undefined = payload;
try {
ret = JSON.parse(payload);
Expand Down
7 changes: 4 additions & 3 deletions addon/utils/mung-options-for-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Method,
FetchOptions,
AjaxOptions,
isPlainObject
isPlainObject,
} from 'ember-fetch/types';

/**
Expand All @@ -12,9 +12,10 @@ import {
export default function mungOptionsForFetch(
options: AjaxOptions
): FetchOptions {
const hash = Object.assign({},
const hash = Object.assign(
{},
{
credentials: 'same-origin'
credentials: 'same-origin',
},
options
) as FetchOptions;
Expand Down
4 changes: 1 addition & 3 deletions addon/utils/serialize-query-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ export function serializeQueryParams(
return s;
}

return buildParams('', queryParamsObject)
.join('&')
.replace(/%20/g, '+');
return buildParams('', queryParamsObject).join('&').replace(/%20/g, '+');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"stylelint": "^15.4.0",
"stylelint-config-standard": "^32.0.0",
"stylelint-prettier": "^3.0.0",
"typescript": "^4.1.3",
"typescript": "^5.0.0",
"webpack": "^5.78.0"
},
"peerDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13918,10 +13918,10 @@ typescript-memoize@^1.0.1:
resolved "https://registry.yarnpkg.com/typescript-memoize/-/typescript-memoize-1.1.1.tgz#02737495d5df6ebf72c07ba0d002e8f4cf5ccfa0"
integrity sha512-GQ90TcKpIH4XxYTI2F98yEQYZgjNMOGPpOgdjIBhaLaWji5HPWlRnZ4AeA1hfBxtY7bCGDJsqDDHk/KaHOl5bA==

typescript@^4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.3.tgz#519d582bd94cba0cf8934c7d8e8467e473f53bb7"
integrity sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==
typescript@^5.0.0:
version "5.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==

uc.micro@^1.0.1, uc.micro@^1.0.5:
version "1.0.6"
Expand Down

0 comments on commit ca7af90

Please sign in to comment.