Skip to content

Commit 5eab00c

Browse files
jsorefgameromanautofix-ci[bot]
authored
chore: improve text (#2655)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: Roman <dev@rman.dev> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent d7511ce commit 5eab00c

5 files changed

Lines changed: 16 additions & 11 deletions

File tree

app/utils/charts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ export function computeLineChartAnalysis(values: Array<number | null>): LineChar
340340

341341
/**
342342
* Coefficient of variation : relative volatility
343-
* - expressed in %
343+
* - expressed as a decimal from 0 to 1
344344
* - calculation: standard deviation / mean
345345
* |---------------|----------------------------------------------------------|
346346
* | VALUE | INTERPRETATION |

app/utils/run-command.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ export interface ExecutableInfo {
1414
hasExecutable: boolean
1515
}
1616

17+
/**
18+
* Extract basename from package
19+
*/
20+
function getPackageBaseName(packageName: string): string | undefined {
21+
return packageName.startsWith('@') ? packageName.split('/')[1] : packageName
22+
}
23+
1724
/**
1825
* Extract executable command information from a package's bin field.
1926
* Handles both string format ("bin": "./cli.js") and object format ("bin": { "cmd": "./cli.js" }).
@@ -43,7 +50,7 @@ export function getExecutableInfo(
4350
}
4451

4552
// Prefer command matching package name if it exists; otherwise, use first
46-
const baseName = packageName.startsWith('@') ? packageName.split('/')[1] : packageName
53+
const baseName = getPackageBaseName(packageName)
4754
const primaryCommand = baseName && commands.includes(baseName) ? baseName : firstCommand
4855

4956
return {
@@ -87,9 +94,7 @@ export function getRunCommandParts(options: RunCommandOptions): string[] {
8794
// For local execute with specific command name different from package name
8895
// e.g., `pnpm exec tsc` for typescript package
8996
if (options.command && options.command !== options.packageName) {
90-
const baseName = options.packageName.startsWith('@')
91-
? options.packageName.split('/')[1]
92-
: options.packageName
97+
const baseName = getPackageBaseName(options.packageName)
9398
// If command matches base package name, use the package spec
9499
if (options.command === baseName) {
95100
return [...executeParts, spec]

server/api/auth/session.delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default eventHandlerWithOAuthSession(async (event, oAuthSession, serverSession) => {
2-
// Even tho the signOut also clears part of the server cache should be done in order
2+
// Even though the signOut also clears part of the server cache, this should be done in order
33
// to let the OAuth package do any other clean up it may need
44
await oAuthSession?.signOut()
55
await serverSession.clear()

server/api/registry/org/[org]/packages.get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CACHE_MAX_AGE_ONE_HOUR, NPM_REGISTRY } from '#shared/utils/constants'
22
import { FetchError } from 'ofetch'
33

4-
// Validation pattern for npm org names - url-sage symbol and not start with a dot (incl. ~test24214. or -ex~-)
4+
// Validation pattern for npm org names - should be a url-safe symbol and not start with a dot (incl. ~test24214. or -ex~-)
55
const NPM_ORG_NAME_RE = /^[\w~-][\w.~-]*$/
66

77
function validateOrgName(name: string): void {

server/utils/atproto/utils/likes.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class PackageLikesUtils {
5454
this.constellation =
5555
deps?.constellation ??
5656
new Constellation(
57-
// Passes in a fetch wrapped as CachedFetch since are already doing some heavy caching here
57+
// Passes in a fetch wrapped as CachedFetch because we're already doing some heavy caching here
5858
async <T = unknown>(
5959
url: string,
6060
options: Parameters<typeof $fetch>[1] = {},
@@ -107,7 +107,7 @@ export class PackageLikesUtils {
107107
}
108108

109109
/**
110-
* Gets the likes for a npm package on npmx. Tries a local cache first, if not found uses constellation
110+
* Gets the likes for a npm package on npmx. Tries a local cache first; if not found, uses constellation
111111
* @param packageName
112112
* @param usersDid
113113
* @returns
@@ -168,8 +168,8 @@ export class PackageLikesUtils {
168168
}
169169

170170
/**
171-
* It is assumed it has been checked by this point that if a user has liked a package and the new like was made as a record
172-
* to the user's atproto repository
171+
* Assumes the caller has already verified that a user's like for a package was stored as a record in the user's AT Protocol
172+
* repository (atUri refers to that like record).
173173
* @param packageName
174174
* @param usersDid
175175
* @param atUri - The URI of the like record

0 commit comments

Comments
 (0)