Skip to content

Commit

Permalink
fix typeos with grammarly
Browse files Browse the repository at this point in the history
  • Loading branch information
f0nar committed Jan 29, 2024
1 parent fafcea8 commit a01cf60
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions src/downloadGD.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const libGdAssets = {
* useReleaseAssets: true
* }
* } GdFetchDataProvider
* Fetch configuration that provides methods or url to load libGD assets.
* Fetch configuration that provides methods or URL to load libGD assets.
*/

/**
Expand Down Expand Up @@ -67,7 +67,7 @@ const getFetchConfiguration = async (options) => {
};

/**
* Downloads a GDevelop Runtime sources and compile them.
* Downloads GDevelop Runtime sources and compiles them.
*
* @param {{ versionTag: string, user: string, fetchProvider: GdFetchDataProvider, authToken?: string }} fetchConfiguration Fetch configuration.
* @param {string} gdPath Path to save Runtime sources folder to.
Expand Down Expand Up @@ -103,7 +103,7 @@ const downloadLibGdAssets = async function ({ versionTag, user, fetchProvider, a

assert(
libGdAssets.required.every((libGdAsset) => assetsIdsMap[libGdAsset]),
`❌ Your release do not provide all required libGd assets: ${libGdAssets.required}. Provided: ${Object.values(assetsIdsMap)}.`
`❌ Your release does not provide all required libGd assets: ${libGdAssets.required}. Provided: ${Object.values(assetsIdsMap)}.`
);

return Promise.all(
Expand Down
16 changes: 8 additions & 8 deletions src/fsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ const StreamZip = require("node-stream-zip");
const { findLatestRelease } = require("./gitUtils");

/**
* @param {string} user User to get path to versions of.
* @param {string} user User to get the path to versions of.
* @returns {string} Path to specific user Gdevelop versions folder.
*/
const getUserPath = (user) => path.join(__dirname, "Versions", user);

/**
* @param {string} version Version to get path to.
* @param {string} user User to get path to version of.
* @param {string} user User to get the path to the version of.
* @returns {string} Path to specific Gdevelop version folder.
*/
const getRuntimePath = (version, user) => path.join(getUserPath(user), version);

/**
* @param {string} user User to get latest Gdevelop version of.
* @param {string} [authToken] Github private token for autorization.
* @returns {Promise<string>} Promisified latest available version for specified user.
* @param {string} user User to get the latest Gdevelop version of.
* @param {string} [authToken] Github private token for authorization.
* @returns {Promise<string>} Promisified latest available version for the specified user.
*/
const findLatestVersion = async (user, authToken) => {
console.info(`🕗 Getting latest release tag...`);
Expand All @@ -40,7 +40,7 @@ const findLatestVersion = async (user, authToken) => {

/**
* @param {string} file File url to download.
* @param {string} savePath Path to save downloaded file.
* @param {string} savePath Path to save the downloaded file.
* @param {boolean} required Defines if need to throw if loading error occurs. Throw if true is passed.
*/
const downloadFile = (file, savePath, required = true) =>
Expand All @@ -60,10 +60,10 @@ const downloadFile = (file, savePath, required = true) =>
const getDir = (pathToFile) => path.extname(pathToFile) ? path.dirname(pathToFile) : pathToFile;

/**
* Extracts Runtime sources from GDevelop github release archive.
* Extracts Runtime sources from GDevelop GitHub release archive.
* @param {string} zipPath Path to Gdevelop zip archive.
* @param {string} savePath Path to save extracted Runtime sources folder to.
* @param {string} prefixUser Github user of GDevelop github release archive.
* @param {string} prefixUser Github user of GDevelop GitHub release archive.
*/
const extractGdRuntimes = async (zipPath, savePath, prefixUser) => {
const zip = new StreamZip.async({
Expand Down
20 changes: 10 additions & 10 deletions src/gitUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ const { request } = require("@octokit/request");
const fs = require("fs-extra-promise");

/**
* Returns octokit request authorization object if token is provided.
* @param {string} [authToken] Github private token for autorization.
* Returns octokit request authorization object if the token is provided.
* @param {string} [authToken] Github private token for authorization.
* @returns {{ authorization: string } | { }} Octokit request authorization object.
*/
const getAuthHeader = (authToken) => authToken ? { authorization: authToken } : {};

/**
* Returns map object of release asset names as keys and assets ids as values.
* Returns map object of release asset names as keys and asset ids as values.
* @param {string} user Github user of release.
* @param {string} versionTag Release tag to get assets of.
* @param {string} [authToken] Github private token for autorization.
* @param {string} [authToken] Github private token for authorization.
* @returns {Promise<{ [assetName: string]: string }>} Map object of asset names to ids.
*/
const getAssetsIdsMap = async (user, versionTag, authToken) => {
Expand All @@ -28,11 +28,11 @@ const getAssetsIdsMap = async (user, versionTag, authToken) => {
};

/**
* Downloads github release asset.
* Downloads GitHub release asset.
* @param {string} filePath Path to save asset by.
* @param {string} user Github user of release asset.
* @param {string} id Specific release asset id.
* @param {string} [authToken] Github private token for autorization.
* @param {string} [authToken] Github private token for authorization.
* @returns {Promise<void>}
*/
const downloadGitBinaryAsset = (filePath, user, id, authToken) =>
Expand All @@ -47,9 +47,9 @@ const downloadGitBinaryAsset = (filePath, user, id, authToken) =>
.then(({ data }) => fs.writeFile(filePath, Buffer.from(data)));

/**
* Returns latest commit for which libGD.js was built for official GDevelop repo.
* Returns the latest commit for which libGD.js was built for the official GDevelop repo.
* @param {string} versionTag Release tag to get assets of.
* @param {string} [authToken] Github private token for autorization.
* @param {string} [authToken] Github private token for authorization.
* @returns {Object} Octokit commit object.
*/
const getLatestCiCommit = async (versionTag, authToken) => {
Expand Down Expand Up @@ -78,9 +78,9 @@ const getLatestCiCommit = async (versionTag, authToken) => {
}

/**
* Returns latest GDevelop repo release for specified user.
* Returns the latest GDevelop repo release for the specified user.
* @param {string} user Github user of release.
* @param {string} [authToken] Github private token for autorization.
* @param {string} [authToken] Github private token for authorization.
* @returns {Promise<string>} Latest GDevelop repo release for specified user
*/
const findLatestRelease = (user, authToken) =>
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const WrappedGD = require("./WrappedGD");

/**
* @param {{ versionTag?: string, user?: string, fetchProvider?: import("./downloadGD").GdFetchDataProvider, authToken?: string } | string} [options]
* Optional fetch configuration or github release tag.
* Optional fetch configuration or GitHub release tag.
*/
const loadGD = async (loadOptions) => {
fetchOptions = await getFetchConfiguration(loadOptions || {});
Expand Down

0 comments on commit a01cf60

Please sign in to comment.