Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

feat:@discord.js/type-utils package #57

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

suneettipirneni
Copy link
Member

@suneettipirneni suneettipirneni commented Aug 26, 2021

Please describe the changes this PR makes and why it should be merged:

Migration of discordjs/discord.js#6410 to package here.

This package offers typeguards for otherwise tedious manual typeguards. It will also eventually offer compatibility with api types and #equals between various types.

Status and versioning classification:
Please move lines that apply to you out of the comment:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@suneettipirneni suneettipirneni changed the title feat: typeguards package feat:@discord.js/typeguards package Aug 26, 2021
@kyranet kyranet added the feature request New feature request label Aug 29, 2021
@codecov
Copy link

codecov bot commented Aug 29, 2021

Codecov Report

Merging #57 (954d125) into main (ceaab7d) will increase coverage by 0.09%.
The diff coverage is 86.79%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #57      +/-   ##
==========================================
+ Coverage   85.84%   85.93%   +0.09%     
==========================================
  Files           8       11       +3     
  Lines         996     1102     +106     
  Branches       99      113      +14     
==========================================
+ Hits          855      947      +92     
  Misses         42       42              
- Partials       99      113      +14     
Impacted Files Coverage Δ
packages/type-utils/src/lib/util/enum.ts 78.26% <78.26%> (ø)
packages/type-utils/src/lib/button.ts 82.35% <82.35%> (ø)
packages/type-utils/src/lib/command.ts 90.90% <90.90%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ceaab7d...954d125. Read the comment docs.

@suneettipirneni
Copy link
Member Author

So I'm leaning towards renaming this module to type-utils, there are various reason for this:

  1. This module only being for type guards feels a bit limited in scope.
  2. Other utility functions such as #isEqual will offer a lot of utility and also fit under the type-utils category.
  3. I eventually want to add support for all functions to accept discord-api-types variants as well as the d.js variants.

Other than naming, this PR won't change anything, but I wanna keep the door open for later changes.

packages/typeguards/src/lib/button.ts Outdated Show resolved Hide resolved
packages/typeguards/src/lib/button.ts Outdated Show resolved Hide resolved
suneettipirneni and others added 2 commits August 29, 2021 11:06
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
@suneettipirneni suneettipirneni changed the title feat:@discord.js/typeguards package feat:@discord.js/type-utils package Aug 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants