Skip to content

Commit

Permalink
npm run format
Browse files Browse the repository at this point in the history
  • Loading branch information
jshawl committed Nov 27, 2023
1 parent 1591cb3 commit c4a2007
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/types/payPalHostedFieldTypes.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { CSSProperties, ReactNode } from "react";
import type { HostedFieldsHandler, Installments } from "@paypal/paypal-js";

Check warning on line 2 in src/types/payPalHostedFieldTypes.ts

View workflow job for this annotation

GitHub Actions / main

There should be at least one empty line between import groups
import {SDK_SETTINGS} from "../constants";
import { SDK_SETTINGS } from "../constants";

Check warning on line 3 in src/types/payPalHostedFieldTypes.ts

View workflow job for this annotation

GitHub Actions / main

`../constants` import should occur before import of `react`

Check warning on line 3 in src/types/payPalHostedFieldTypes.ts

View workflow job for this annotation

GitHub Actions / main

'SDK_SETTINGS' is defined but never used

export type PayPalHostedFieldsNamespace = {
components: string | string[] | undefined;
} & { [DATA_NAMESPACE: string]: string | undefined }
} & { [DATA_NAMESPACE: string]: string | undefined };

export type PayPalHostedFieldsRegistered = {
[key: string]: PayPalHostedFieldOptions;
Expand Down
5 changes: 4 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ export function generateErrorMessage({

// The JS SDK only loads the buttons component by default.
// All other components like messages and marks must be requested using the "components" query parameter
const requestedComponents = typeof sdkRequestedComponents === 'string' ? sdkRequestedComponents : sdkRequestedComponents.join(',')
const requestedComponents =
typeof sdkRequestedComponents === "string"
? sdkRequestedComponents
: sdkRequestedComponents.join(",");
if (!requestedComponents.includes(sdkComponentKey)) {
const expectedComponents = [requestedComponents, sdkComponentKey]
.filter(Boolean)
Expand Down

0 comments on commit c4a2007

Please sign in to comment.