mappersmith
Advanced tools
Changelog
2.44.0
3a3c092: # Add support for abort signals
The AbortSignal interface represents a signal object that allows you to communicate with an asynchronous operation (such as a fetch request) and abort it if required via an AbortController object. All gateway APIs (Fetch, HTTP and XHR) support this interface via the signal
parameter:
const abortController = new AbortController()
// Start a long running task...
client.Bitcoin.mine({ signal: abortController.signal })
// This takes too long, abort!
abortController.abort()
The return value of some functions on Request
have been updated to highlight that they might return undefined:
Request#body()
Request#auth()
Request#timeout()
The reasoning behind this change is that if you didn't pass them (and no middleware set them) they might simply be undefined. So the types were simply wrong before. If you experience a "breaking change" due to this change, then it means you have a potential bug that you didn't properly handle before.
Changelog
2.43.0
6e94f97: Bundle with ESM exports.
import { forge } from 'mappersmith'
rather than the old import forge from 'mappersmith'
. The reason is because test runners like jest and vitest might get confused when mixing named/default exports together with ESM, even though tsc and node has no problems with it.import { EncodeJsonMiddleware } from 'mappersmith/middleware'
(note the mappersmith/middleware
folder) rather than deep import import EncodeJsonMiddleware from 'mappersmith/middleware/encode-json'
. We still support the old import, but it will be deprecated in the future.import { FetchGateway } from 'mappersmith/gateway'
(note the mappersmith/gateway
folder) rather than deep import import FetchGateway from 'mappersmith/gateway/fetch'
. We still support the old import, but it will be deprecated in the future.9da82f6: Fixes memory leak when using http(s) agent with keep-alive
unusedMocks
Changelog
2.42.0
mappersmith
: EncodeJSON
middleware now properly serializes +json
family of content-types #362