@atproto/common-web
Advanced tools
Comparing version 0.2.1 to 0.2.2
# @atproto/common-web | ||
## 0.2.2 | ||
### Patch Changes | ||
- [`35d108ce`](https://github.com/bluesky-social/atproto/commit/35d108ce94866ce1b3d147cd0620a0ba1c4ebcd7) Thanks [@devinivy](https://github.com/devinivy)! - Allow pds to serve did doc with credentials, API client to respect PDS listed in the did doc. | ||
## 0.2.1 | ||
@@ -4,0 +10,0 @@ |
@@ -25,1 +25,2 @@ export declare const readFromGenerator: <T>(gen: AsyncGenerator<T, any, unknown>, isDone: (last?: T | undefined) => Promise<boolean> | boolean, waitFor?: Promise<unknown>, maxLength?: number) => Promise<T[]>; | ||
} | ||
export declare const handleAllSettledErrors: (results: PromiseSettledResult<unknown>[]) => void; |
@@ -11,1 +11,2 @@ export * as check from './check'; | ||
export * from './strings'; | ||
export * from './did-doc'; |
{ | ||
"name": "@atproto/common-web", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Shared web-platform-friendly code for atproto libraries", |
@@ -127,1 +127,23 @@ import { bailableWait } from './util' | ||
} | ||
export const handleAllSettledErrors = ( | ||
results: PromiseSettledResult<unknown>[], | ||
) => { | ||
const errors = results.filter(isRejected).map((res) => res.reason) | ||
if (errors.length === 0) { | ||
return | ||
} | ||
if (errors.length === 1) { | ||
throw errors[0] | ||
} | ||
throw new AggregateError( | ||
errors, | ||
'Multiple errors: ' + errors.map((err) => err?.message).join('\n'), | ||
) | ||
} | ||
const isRejected = ( | ||
result: PromiseSettledResult<unknown>, | ||
): result is PromiseRejectedResult => { | ||
return result.status === 'rejected' | ||
} |
@@ -12,1 +12,2 @@ export * as check from './check' | ||
export * from './strings' | ||
export * from './did-doc' |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1882458
37
15501