Skip to content

Commit

Permalink
🎨 Export WretchError from the root index
Browse files Browse the repository at this point in the history
Related to #79
  • Loading branch information
elbywan committed Aug 16, 2022
1 parent e55fa04 commit 76f9096
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.all.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { setOptions, setErrorType, setPolyfills } from "./config.js"
import { core } from "./core.js"
import * as Addons from "./addons/index.js"
import { WretchError } from "./resolver.js"

function factory(_url = "", _options = {}) {
return { ...core, _url, _options }
Expand All @@ -15,4 +16,6 @@ factory["default"] = factory
factory.options = setOptions
factory.errorType = setErrorType
factory.polyfills = setPolyfills
export default factory
factory.WretchError = WretchError

export default factory
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { setOptions, setErrorType, setPolyfills } from "./config.js"
import { core } from "./core.js"
import { WretchError } from "./resolver.js"
import type { Wretch } from "./types.js"

export type {
Expand Down Expand Up @@ -43,4 +44,7 @@ factory.options = setOptions
factory.errorType = setErrorType
/** {@inheritDoc setPolyfills} */
factory.polyfills = setPolyfills
/** {@inheritDoc WretchError } */
factory.WretchError = WretchError

export default factory

0 comments on commit 76f9096

Please sign in to comment.