Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"arrowParens": "always",
"experimentalTernaries": true,
"printWidth": 110,
"singleQuote": true,
"trailingComma": "all"
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"build": "bash ./build",
"prepack": "echo 'to pack, run yarn build && (cd dist; yarn pack)' && exit 1",
"prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1",
"format": "prettier --write --cache --cache-strategy metadata . !dist",
"format": "prettier --write --cache --cache-strategy metadata . !dist",
"prepare": "if [ $(basename $(dirname $PWD)) = 'node_modules' ]; then npm run build; fi",
"tsn": "ts-node -r tsconfig-paths/register",
"lint": "eslint --ext ts,js .",
Expand All @@ -39,10 +39,10 @@
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"eslint": "^8.49.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"jest": "^29.4.0",
"prettier": "rattrayalex/prettier#postfix-ternaries",
"prettier": "^3.0.0",
"ts-jest": "^29.1.0",
"ts-morph": "^19.0.0",
"ts-node": "^10.5.0",
Expand Down
3 changes: 2 additions & 1 deletion src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export class APIError extends OrbError {
private static makeMessage(status: number | undefined, error: any, message: string | undefined) {
const msg =
error?.message ?
typeof error.message === 'string' ? error.message
typeof error.message === 'string' ?
error.message
: JSON.stringify(error.message)
: error ? JSON.stringify(error)
: message;
Expand Down
16 changes: 8 additions & 8 deletions src/resources/customers/customers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export interface Customer {
* | Netherlands | `eu_vat` | European VAT number |
* | New Zealand | `nz_gst` | New Zealand GST number |
* | Norway | `no_vat` | Norwegian VAT number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Poland | `eu_vat` | European VAT number |
* | Portugal | `eu_vat` | European VAT number |
* | Romania | `eu_vat` | European VAT number |
Expand Down Expand Up @@ -424,7 +424,7 @@ export namespace Customer {
* | Netherlands | `eu_vat` | European VAT number |
* | New Zealand | `nz_gst` | New Zealand GST number |
* | Norway | `no_vat` | Norwegian VAT number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Poland | `eu_vat` | European VAT number |
* | Portugal | `eu_vat` | European VAT number |
* | Romania | `eu_vat` | European VAT number |
Expand Down Expand Up @@ -717,7 +717,7 @@ export interface CustomerCreateParams {
* | Netherlands | `eu_vat` | European VAT number |
* | New Zealand | `nz_gst` | New Zealand GST number |
* | Norway | `no_vat` | Norwegian VAT number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Poland | `eu_vat` | European VAT number |
* | Portugal | `eu_vat` | European VAT number |
* | Romania | `eu_vat` | European VAT number |
Expand Down Expand Up @@ -860,7 +860,7 @@ export namespace CustomerCreateParams {
* | Netherlands | `eu_vat` | European VAT number |
* | New Zealand | `nz_gst` | New Zealand GST number |
* | Norway | `no_vat` | Norwegian VAT number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Poland | `eu_vat` | European VAT number |
* | Portugal | `eu_vat` | European VAT number |
* | Romania | `eu_vat` | European VAT number |
Expand Down Expand Up @@ -1130,7 +1130,7 @@ export interface CustomerUpdateParams {
* | Netherlands | `eu_vat` | European VAT number |
* | New Zealand | `nz_gst` | New Zealand GST number |
* | Norway | `no_vat` | Norwegian VAT number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Poland | `eu_vat` | European VAT number |
* | Portugal | `eu_vat` | European VAT number |
* | Romania | `eu_vat` | European VAT number |
Expand Down Expand Up @@ -1266,7 +1266,7 @@ export namespace CustomerUpdateParams {
* | Netherlands | `eu_vat` | European VAT number |
* | New Zealand | `nz_gst` | New Zealand GST number |
* | Norway | `no_vat` | Norwegian VAT number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Poland | `eu_vat` | European VAT number |
* | Portugal | `eu_vat` | European VAT number |
* | Romania | `eu_vat` | European VAT number |
Expand Down Expand Up @@ -1546,7 +1546,7 @@ export interface CustomerUpdateByExternalIDParams {
* | Netherlands | `eu_vat` | European VAT number |
* | New Zealand | `nz_gst` | New Zealand GST number |
* | Norway | `no_vat` | Norwegian VAT number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Poland | `eu_vat` | European VAT number |
* | Portugal | `eu_vat` | European VAT number |
* | Romania | `eu_vat` | European VAT number |
Expand Down Expand Up @@ -1682,7 +1682,7 @@ export namespace CustomerUpdateByExternalIDParams {
* | Netherlands | `eu_vat` | European VAT number |
* | New Zealand | `nz_gst` | New Zealand GST number |
* | Norway | `no_vat` | Norwegian VAT number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Poland | `eu_vat` | European VAT number |
* | Portugal | `eu_vat` | European VAT number |
* | Romania | `eu_vat` | European VAT number |
Expand Down
8 changes: 4 additions & 4 deletions src/resources/invoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export interface Invoice {
* | Netherlands | `eu_vat` | European VAT number |
* | New Zealand | `nz_gst` | New Zealand GST number |
* | Norway | `no_vat` | Norwegian VAT number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Poland | `eu_vat` | European VAT number |
* | Portugal | `eu_vat` | European VAT number |
* | Romania | `eu_vat` | European VAT number |
Expand Down Expand Up @@ -560,7 +560,7 @@ export namespace Invoice {
* | Netherlands | `eu_vat` | European VAT number |
* | New Zealand | `nz_gst` | New Zealand GST number |
* | Norway | `no_vat` | Norwegian VAT number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Poland | `eu_vat` | European VAT number |
* | Portugal | `eu_vat` | European VAT number |
* | Romania | `eu_vat` | European VAT number |
Expand Down Expand Up @@ -1282,7 +1282,7 @@ export interface InvoiceFetchUpcomingResponse {
* | Netherlands | `eu_vat` | European VAT number |
* | New Zealand | `nz_gst` | New Zealand GST number |
* | Norway | `no_vat` | Norwegian VAT number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Poland | `eu_vat` | European VAT number |
* | Portugal | `eu_vat` | European VAT number |
* | Romania | `eu_vat` | European VAT number |
Expand Down Expand Up @@ -1636,7 +1636,7 @@ export namespace InvoiceFetchUpcomingResponse {
* | Netherlands | `eu_vat` | European VAT number |
* | New Zealand | `nz_gst` | New Zealand GST number |
* | Norway | `no_vat` | Norwegian VAT number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Philippines | `ph_tin ` | Philippines Tax Identification Number |
* | Poland | `eu_vat` | European VAT number |
* | Portugal | `eu_vat` | European VAT number |
* | Romania | `eu_vat` | European VAT number |
Expand Down
5 changes: 2 additions & 3 deletions src/uploads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ async function getBytes(value: ToFileInput): Promise<Array<BlobPart>> {
}
} else {
throw new Error(
`Unexpected data type: ${typeof value}; constructor: ${
value?.constructor?.name
}; props: ${propsForError(value)}`,
`Unexpected data type: ${typeof value}; constructor: ${value?.constructor
?.name}; props: ${propsForError(value)}`,
);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ describe('retries', () => {
let count = 0;
const testFetch = async (url: RequestInfo, { signal }: RequestInit = {}): Promise<Response> => {
if (!count++)
return new Promise((resolve, reject) =>
signal?.addEventListener('abort', () => reject(new Error('timed out'))),
return new Promise(
(resolve, reject) => signal?.addEventListener('abort', () => reject(new Error('timed out'))),
);
return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
};
Expand Down
Loading