From 118ec3b9e362e972869591f82a8959df4eac5175 Mon Sep 17 00:00:00 2001 From: "Alex Rattray (Stripe)" Date: Tue, 24 Dec 2019 14:33:03 -0800 Subject: [PATCH] Small typo fixes (#743) * Correct "eg;" to "e.g.," * Fix typo --- README.md | 6 +++--- lib/StripeResource.js | 4 ++-- lib/autoPagination.js | 2 +- lib/stripe.js | 2 +- test/autoPagination.spec.js | 2 +- types/Webhooks.d.ts | 4 ++-- types/lib.d.ts | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c41c213bc1..a543092f32 100644 --- a/README.md +++ b/README.md @@ -85,13 +85,13 @@ createCustomer(); #### Using old API versions with TypeScript -Types can change between API versions (eg; Stripe may have changed a field from a string to a hash), +Types can change between API versions (e.g., Stripe may have changed a field from a string to a hash), so our types only reflect the latest API version. We therefore encourage [upgrading your API version][api-version-upgrading] if you would like to take advantage of Stripe's TypeScript definitions. -If you are on an older API version (eg; `2019-10-17`) and not able to upgrade, +If you are on an older API version (e.g., `2019-10-17`) and not able to upgrade, you may pass another version or `apiVersion: null` to use your account's default API version, and use a comment like `// @ts-ignore stripe-version-2019-10-17` to silence type errors here and anywhere the types differ between your API version and the latest. @@ -100,7 +100,7 @@ When you upgrade, you should remove these comments. #### Using `expand` with TypeScript [Expandable][expanding_objects] fields are typed as `string | Foo`, -so you must cast them appropriately, eg; +so you must cast them appropriately, e.g., ```ts const charge: Stripe.Charge = await stripe.charges.retrieve('ch_123', { diff --git a/lib/StripeResource.js b/lib/StripeResource.js index d0fdd7ab1f..358b694863 100644 --- a/lib/StripeResource.js +++ b/lib/StripeResource.js @@ -230,8 +230,8 @@ StripeResource.prototype = { return true; } - // The API may ask us not to retry (eg; if doing so would be a no-op) - // or advise us to retry (eg; in cases of lock timeouts); we defer to that. + // The API may ask us not to retry (e.g., if doing so would be a no-op) + // or advise us to retry (e.g., in cases of lock timeouts); we defer to that. if (res.headers && res.headers['stripe-should-retry'] === 'false') { return false; } diff --git a/lib/autoPagination.js b/lib/autoPagination.js index c3f052169b..854ef7e7a9 100644 --- a/lib/autoPagination.js +++ b/lib/autoPagination.js @@ -188,7 +188,7 @@ function makeAutoPagingToArray(autoPagingEach) { const limit = opts && opts.limit; if (!limit) { throw Error( - 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.' + 'You must pass a `limit` option to autoPagingToArray, e.g., `autoPagingToArray({limit: 1000});`.' ); } if (limit > 10000) { diff --git a/lib/stripe.js b/lib/stripe.js index bedae7ecc3..6016c85e9c 100644 --- a/lib/stripe.js +++ b/lib/stripe.js @@ -86,7 +86,7 @@ function Stripe(key, config = {}) { const typescript = props.typescript || false; if (typescript !== Stripe.USER_AGENT.typescript) { // The mutation here is uncomfortable, but likely fastest; - // seralizing the user agent involves shelling out to the system, + // serializing the user agent involves shelling out to the system, // and given some users may instantiate the library many times without switching between TS and non-TS, // we only want to incur the performance hit when that actually happens. Stripe.USER_AGENT_SERIALIZED = null; diff --git a/test/autoPagination.spec.js b/test/autoPagination.spec.js index 3cc3d9e35c..7f51c1698f 100644 --- a/test/autoPagination.spec.js +++ b/test/autoPagination.spec.js @@ -428,7 +428,7 @@ describe('auto pagination', function() { } }) ).to.eventually.equal( - 'You must pass a `limit` option to autoPagingToArray, eg; `autoPagingToArray({limit: 1000});`.' + 'You must pass a `limit` option to autoPagingToArray, e.g., `autoPagingToArray({limit: 1000});`.' )); it('caps the `limit` arg to a reasonable ceiling', () => diff --git a/types/Webhooks.d.ts b/types/Webhooks.d.ts index ad6a42b125..623146a684 100644 --- a/types/Webhooks.d.ts +++ b/types/Webhooks.d.ts @@ -20,7 +20,7 @@ declare module 'stripe' { header: string, /** - * Your Webhook Signing Secret for this endpoint (eg; 'whsec_...'). + * Your Webhook Signing Secret for this endpoint (e.g., 'whsec_...'). * You can get this [in your dashboard](https://dashboard.stripe.com/webhooks). */ secret: string, @@ -46,7 +46,7 @@ declare module 'stripe' { timestamp?: number; /** - * Stripe webhook secret, eg; 'whsec_...'. + * Stripe webhook secret, e.g., 'whsec_...'. */ secret: string; diff --git a/types/lib.d.ts b/types/lib.d.ts index 9e9ee27b88..c33cb817b0 100644 --- a/types/lib.d.ts +++ b/types/lib.d.ts @@ -84,7 +84,7 @@ declare module 'stripe' { stripe_account?: string; /** - * The [API Version](https://stripe.com/docs/upgrades) to use for a given request (eg; '2019-12-03'). + * The [API Version](https://stripe.com/docs/upgrades) to use for a given request (e.g., '2019-12-03'). */ stripeVersion?: string; /** @deprecated Please use stripeVersion instead. */