Skip to content

Commit e32a6e5

Browse files
authored
chore(various): Wordsmith comments and docstrings (#4390)
A whole bunch of proofreading edits I stashed away while working on other things. No code changes.
1 parent d53ed78 commit e32a6e5

File tree

17 files changed

+31
-29
lines changed

17 files changed

+31
-29
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ jobs:
120120
if: github.ref == 'refs/heads/master' || github.event_name == 'pull_request'
121121
with:
122122
github_token: ${{ secrets.GITHUB_TOKEN }}
123+
# see https://github.com/getsentry/size-limit-action#usage
123124
skip_step: build
124125
workflow_name: 'build'
125126

.vscode/launch.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"program": "${workspaceFolder}/node_modules/.bin/jest",
3030
"args": [
3131
"--watch",
32-
// this makes the output less noisy (and at some point in the past seemed necessary to fix... something)
32+
// this runs one test at a time, rather than running them in parallel (necessary for debugging so that you know
33+
// you're hitting a single test's breakpoints, in order)
3334
"--runInBand",
3435
// TODO: when we unify jest config, we may need to change this
3536
"--config",

packages/browser/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const terserInstance = terser({
2121
// captureExceptions and captureMessage are public API methods and they don't need to be listed here
2222
// as mangler doesn't touch user-facing thing, however sentryWrapped is not, and it would be mangled into a minified version.
2323
// We need those full names to correctly detect our internal frames for stripping.
24-
// I listed all of them here just for the clarity sake, as they are all used in the frames manipulation process.
24+
// I listed all of them here just for the clarity's sake, as they are all used in the frame-manipulation process.
2525
reserved: ['captureException', 'captureMessage', 'sentryWrapped'],
2626
properties: {
2727
regex: /^_[^_]/,

packages/browser/src/eventbuilder.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { eventFromPlainObject, eventFromStacktrace, prepareFramesForEvent } from
1515
import { computeStackTrace } from './tracekit';
1616

1717
/**
18-
* Builds and Event from a Exception
18+
* Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.
1919
* @hidden
2020
*/
2121
export function eventFromException(options: Options, exception: unknown, hint?: EventHint): PromiseLike<Event> {
@@ -104,9 +104,9 @@ export function eventFromUnknownInput(
104104
return event;
105105
}
106106
if (isPlainObject(exception) || isEvent(exception)) {
107-
// If it is plain Object or Event, serialize it manually and extract options
108-
// This will allow us to group events based on top-level keys
109-
// which is much better than creating new group when any key/value change
107+
// If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize
108+
// it manually. This will allow us to group events based on top-level keys which is much better than creating a new
109+
// group on any key/value change.
110110
const objectException = exception as Record<string, unknown>;
111111
event = eventFromPlainObject(objectException, syntheticException, options.rejection);
112112
addExceptionMechanism(event, {

packages/browser/src/transports/fetch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ export class FetchTransport extends BaseTransport {
3737
const options: RequestInit = {
3838
body: sentryRequest.body,
3939
method: 'POST',
40-
// Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default
41-
// https://caniuse.com/#feat=referrer-policy
42-
// It doesn't. And it throw exception instead of ignoring this parameter...
40+
// Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'
41+
// (see https://caniuse.com/#feat=referrer-policy),
42+
// it doesn't. And it throws an exception instead of ignoring this parameter...
4343
// REF: https://github.com/getsentry/raven-js/issues/1233
4444
referrerPolicy: (supportsReferrerPolicy() ? 'origin' : '') as ReferrerPolicy,
4545
};

packages/core/src/basebackend.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import { NoopTransport } from './transports/noop';
2424
* @hidden
2525
*/
2626
export interface Backend {
27-
/** Creates a {@link Event} from an exception. */
27+
/** Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`. */
2828
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2929
eventFromException(exception: any, hint?: EventHint): PromiseLike<Event>;
3030

31-
/** Creates a {@link Event} from a plain message. */
31+
/** Creates an {@link Event} from primitive inputs to `captureMessage`. */
3232
eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event>;
3333

3434
/** Submits the event to Sentry */

packages/eslint-config-sdk/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ module.exports = {
179179
},
180180
},
181181
{
182-
// Configuration for config files like webpack/rollback
182+
// Configuration for config files like webpack/rollup
183183
files: ['*.config.js'],
184184
parserOptions: {
185185
sourceType: 'module',

packages/nextjs/test/run-integration-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ for NEXTJS_VERSION in 10 11 12; do
5858
fi
5959
yarn --no-lockfile --silent >/dev/null 2>&1
6060
# if applicable, use local versions of `@sentry/cli` and/or `@sentry/webpack-plugin` (these commands no-op unless
61-
# LINKED_CLI_REPO and/or LINKED_PLUGIN_REPO is set)
61+
# LINKED_CLI_REPO and/or LINKED_PLUGIN_REPO are set)
6262
linkcli && linkplugin
6363
mv -f package.json.bak package.json 2>/dev/null || true
6464

packages/serverless/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as domain from 'domain';
55
/**
66
* Event processor that will override SDK details to point to the serverless SDK instead of Node,
77
* as well as set correct mechanism type, which should be set to `handled: false`.
8-
* We do it like this, so that we don't introduce any side-effects in this module, which makes it tree-shakeable.
8+
* We do it like this so that we don't introduce any side-effects in this module, which makes it tree-shakeable.
99
* @param event Event
1010
* @param integration Name of the serverless integration ('AWSLambda', 'GCPFunction', etc)
1111
*/

packages/tracing/src/hubextensions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ function traceHeaders(this: Hub): { [key: string]: string } {
3434
* Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be
3535
* sent to Sentry.
3636
*
37-
* @param hub: The hub off of which to read config options
3837
* @param transaction: The transaction needing a sampling decision
38+
* @param options: The current client's options, so we can access `tracesSampleRate` and/or `tracesSampler`
3939
* @param samplingContext: Default and user-provided data which may be used to help make the decision
4040
*
4141
* @returns The given transaction with its `sampled` value set

packages/tracing/src/idletransaction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class IdleTransaction extends Transaction {
8181
* @default 1000
8282
*/
8383
private readonly _idleTimeout: number = DEFAULT_IDLE_TIMEOUT,
84-
// If an idle transaction should be put itself on and off the scope automatically.
84+
// Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends
8585
private readonly _onScope: boolean = false,
8686
) {
8787
super(transactionContext, _idleHub);
@@ -143,7 +143,7 @@ export class IdleTransaction extends Transaction {
143143
logger.log('[Tracing] No active IdleTransaction');
144144
}
145145

146-
// this._onScope is true if the transaction was previously on the scope.
146+
// if `this._onScope` is `true`, the transaction put itself on the scope when it started
147147
if (this._onScope) {
148148
clearActiveTransaction(this._idleHub);
149149
}
@@ -272,7 +272,7 @@ export class IdleTransaction extends Transaction {
272272
}
273273

274274
/**
275-
* Reset active transaction on scope
275+
* Reset transaction on scope to `undefined`
276276
*/
277277
function clearActiveTransaction(hub?: Hub): void {
278278
if (hub) {

packages/types/src/debugMeta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Holds meta information to customize the behavior of sentry's event processing.
2+
* Holds meta information to customize the behavior of Sentry's server-side event processing.
33
**/
44
export interface DebugMeta {
55
images?: Array<DebugImage>;

packages/types/src/scope.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ export interface ScopeContext {
2424
}
2525

2626
/**
27-
* Holds additional event information. {@link Scope.applyToEvent} will be
28-
* called by the client before an event will be sent.
27+
* Holds additional event information. {@link Scope.applyToEvent} will be called by the client before an event is sent.
2928
*/
3029
export interface Scope {
3130
/** Add new event processor that will be called after {@link applyToEvent}. */

packages/utils/src/is.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export function isString(wat: unknown): boolean {
7373
}
7474

7575
/**
76-
* Checks whether given value's is a primitive (undefined, null, number, boolean, string, bigint, symbol)
76+
* Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)
7777
* {@link isPrimitive}.
7878
*
7979
* @param wat A value to be checked.

packages/utils/src/object.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ function normalizeValue<T>(value: T, key?: any): T | string {
310310
*/
311311
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
312312
export function walk(key: string, value: any, depth: number = +Infinity, memo: MemoFunc = memoBuilder()): any {
313-
// If we reach the maximum depth, serialize whatever has left
313+
// If we reach the maximum depth, serialize whatever is left
314314
if (depth === 0) {
315315
return serializeValue(value);
316316
}
@@ -322,13 +322,14 @@ export function walk(key: string, value: any, depth: number = +Infinity, memo: M
322322
}
323323
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
324324

325-
// If normalized value is a primitive, there are no branches left to walk, so we can just bail out, as theres no point in going down that branch any further
325+
// If normalized value is a primitive, there are no branches left to walk, so bail out
326326
const normalized = normalizeValue(value, key);
327327
if (isPrimitive(normalized)) {
328328
return normalized;
329329
}
330330

331-
// Create source that we will use for next itterations, either objectified error object (Error type with extracted keys:value pairs) or the input itself
331+
// Create source that we will use for the next iteration. It will either be an objectified error object (`Error` type
332+
// with extracted key:value pairs) or the input itself.
332333
const source = getWalkSource(value);
333334

334335
// Create an accumulator that will act as a parent for all future itterations of that branch

packages/utils/src/supports.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ export function supportsReportingObserver(): boolean {
139139
* @returns Answer to the given question.
140140
*/
141141
export function supportsReferrerPolicy(): boolean {
142-
// Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default
143-
// https://caniuse.com/#feat=referrer-policy
144-
// It doesn't. And it throw exception instead of ignoring this parameter...
142+
// Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'
143+
// (see https://caniuse.com/#feat=referrer-policy),
144+
// it doesn't. And it throws an exception instead of ignoring this parameter...
145145
// REF: https://github.com/getsentry/raven-js/issues/1233
146146

147147
if (!supportsFetch()) {

packages/utils/src/time.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const dateTimestampSource: TimestampSource = {
2121

2222
/**
2323
* A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}
24-
* for accessing a high resolution monotonic clock.
24+
* for accessing a high-resolution monotonic clock.
2525
*/
2626
interface Performance {
2727
/**

0 commit comments

Comments
 (0)