Skip to content

Commit

Permalink
Reduce the prod typing dependencies
Browse files Browse the repository at this point in the history
Connects-to: #1220
Change-type: patch
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
  • Loading branch information
thgreasi committed Apr 27, 2022
1 parent ebe0c10 commit 47bd9a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions lib/models/os.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ const getOsModel = function (
url: `/device-types/v1/${deviceType}/images/${version}/download-size`,
baseUrl: apiUrl,
});
return body.size;
return body.size as number;
},
);

Expand Down Expand Up @@ -937,8 +937,14 @@ const getOsModel = function (
};

return {
_getNormalizedDeviceTypeSlug,
_getDownloadSize,
// Cast the exported types for internal methods so `@types/memoizee` can be a dev depenency.
_getNormalizedDeviceTypeSlug: _getNormalizedDeviceTypeSlug as (
deviceTypeSlug: string,
) => Promise<string>,
_getDownloadSize: _getDownloadSize as (
deviceType: string,
version: string,
) => Promise<number>,
_clearDeviceTypesAndOsVersionCaches,
_getMaxSatisfyingVersion,
OsTypes,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"@balena/lint": "^6.1.1",
"@types/chai": "^4.3.0",
"@types/chai-as-promised": "^7.1.4",
"@types/lodash": "^4.14.182",
"@types/memoizee": "^0.4.7",
"@types/mocha": "^5.2.7",
"@types/ndjson": "^2.0.0",
"@types/sinon": "^10.0.6",
Expand Down Expand Up @@ -102,8 +104,6 @@
"dependencies": {
"@balena/es-version": "^1.0.0",
"@types/json-schema": "^7.0.9",
"@types/lodash": "^4.14.168",
"@types/memoizee": "^0.4.5",
"@types/node": "^10.17.55",
"abortcontroller-polyfill": "^1.7.1",
"balena-auth": "^4.1.0",
Expand Down

0 comments on commit 47bd9a2

Please sign in to comment.