2.0.0-beta.2
Pre-release
Pre-release
Breaking
- Set minimal required Node.js version to v14.17;
Add
- Expose callable version for every entity class and for Search. You can now create request similarly to
v1.x
:
import {tags} from "dinky.js"
await tags.getById("artist-colon-rainbow")
dinky.js exposes functions for these types of requests: search
, tags
, comments
, images
, profiles
and filters
. More will be added in next releases!
Update
- Improve url normalization. It will also enforce
https
protocol for custom URLs:
import {images} from "dinky.js"
images({url: "furbooru.org"}) // will add https protocol -> https://furbooru.org/api/v1/json/images
images({url: "http://furbooru.org"}) // will replace http protocol with https -> https://furbooru.org/api/v1/json/images
- Replace
cross-fetch
withnode-fetch
. Starting from this version dinky.js will tryglobalThis.fetch
first, so you can use polyfills or just rely on the environment. Iffetch
is not defined onglobalThis
object and on thelinkOptions.fetch
option, dinky.js will usenode-fetch
as default fallback; - Replace
fetch-mock
withnock
for tests, becausefetch-mock
does not support ESM. Note thatnock
relies on Node.js' http module to operate, so requests from alternative http clients (like native Node.js' fetch implementation, which is based on undici) will not be handled bynock
.
All changes: v2.0.0-beta.1...v2.0.0-beta.2