Skip to content

v2.0.0

Compare
Choose a tag to compare
@L-Mario564 L-Mario564 released this 03 Feb 01:51
· 43 commits to master since this release

Breaking Changes

  • Use native fetch API instead of Axios.
  • Remove input validations.
  • Client.beatmaps.lookupBeatmap and Client.changelog.lookupChangelogBuild methods now return null if nothing is found on lookup. Prior to this, these methods would return undefined when there were no results.
  • Remove unused interface GetBeatmapOptions. (Not to be confused with GetBeatmapsOptions, note the plural form of beatmap).
  • The following properties in ModsEnum have been renamed:
    • K4 -> 4K
    • K5 -> 5K
    • K6 -> 6K
    • K7 -> 7K
    • K8 -> 8K
    • RN -> RD
    • TR -> TP
    • K1 -> 1K
    • K3 -> 3K
    • K2 -> 2K

Additions

  • Provide the option to pass a polyfill for the fetch API for development environments that have a Node.js version below 18.
  • Introduce error handling via the OsuJSGeneralError and OsuJSUnexpectedResponseError classes and OsuJSError type.
  • Token can now be revoked using Client.revokeToken. Has same functionality as Auth.revokeToken.
  • Add links to documentation in JSDoc comments.
  • Add osu! Lazer mods to Mod type.
  • New utility functions:
    • getModsEnum: Converts an array of mods into its numerical representation.
    • getEnumMods: Converts a numerical representation of a mod or mod combination into an array of mods represented as strings.
    • isOsuJSError: Determines if a value is an error thrown by osu.js.

Patches

  • Converted many types inferred from schemas into interfaces.