Skip to content

v1.2.0: Barely SemVer

Latest
Compare
Choose a tag to compare
@Pwuts Pwuts released this 06 Apr 17:13
· 3 commits to main since this release

🚀 Additions

  • Verbose RX/TX debugging
    • Can be turned on via $BadgeAPI.badge.debug.rx = true / $BadgeAPI.badge.debug.tx = true

✨ Improvements

  • RX data is now handled completely asynchronously
  • Code readability
  • Return type of BadgeFileSystemApi.list() is now a discriminated union FSListing of FileListing and DirListing to allow type narrowing

⚠️ Breaking change ⚠️

The type export FileListing of api/filesystem has been renamed to FSListing. The new export FileListing only represents actual files instead of both files and folders, and is complemented by DirListing. FSListing is a union of FileListing and DirListing. This allows type narrowing when consuming an FSListing, e.g. from BadgeAPI.fileSystem.list():

const items = await $BadgeAPI.fileSystem.list('/internal');
items.forEach(item => {
  if (item.type == 'file') {
    /* type of `item` is narrowed to FileListing */
  }
  else {
    /* type of `item` narrowed to DirListing */
  }
})