Skip to content

2.0.0-beta.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@octet-stream octet-stream released this 30 May 23:50

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 with node-fetch. Starting from this version dinky.js will try globalThis.fetch first, so you can use polyfills or just rely on the environment. If fetch is not defined on globalThis object and on the linkOptions.fetch option, dinky.js will use node-fetch as default fallback;
  • Replace fetch-mock with nock for tests, because fetch-mock does not support ESM. Note that nock 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 by nock.

All changes: v2.0.0-beta.1...v2.0.0-beta.2