Skip to content

Commit

Permalink
fix(deps): update dependencies (#489)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency @sapphire/utilities to ^3.8.0

* chore: 640k ought to be enough for anybody

permalink: http://whatthecommit.com/51723ea7d0bd657fb7ebb29194430719

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jeroen Claassens <support@favware.tech>
  • Loading branch information
renovate[bot] and favna committed Jul 30, 2022
1 parent 747be01 commit 28633d3
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 258 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
"postpack": "pinst --enable"
},
"dependencies": {
"@discordjs/builders": "^0.15.0",
"@discordjs/builders": "^0.16.0",
"@sapphire/discord-utilities": "^2.11.5",
"@sapphire/discord.js-utilities": "^4.11.3",
"@sapphire/pieces": "^3.3.5",
"@sapphire/ratelimits": "^2.4.4",
"@sapphire/result": "^1.1.1",
"@sapphire/stopwatch": "^1.4.1",
"@sapphire/utilities": "^3.7.0",
"@sapphire/utilities": "^3.8.0",
"@types/object-hash": "^2.2.1",
"lexure": "^0.17.0",
"object-hash": "^3.0.0",
Expand All @@ -44,19 +44,19 @@
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@favware/cliff-jumper": "^1.8.5",
"@favware/npm-deprecate": "^1.0.4",
"@favware/rollup-type-bundler": "^1.0.9",
"@favware/cliff-jumper": "^1.8.6",
"@favware/npm-deprecate": "^1.0.5",
"@favware/rollup-type-bundler": "^1.0.10",
"@sapphire/eslint-config": "^4.3.7",
"@sapphire/prettier-config": "^1.4.3",
"@sapphire/ts-config": "^3.3.4",
"@types/jest": "^28.1.6",
"@types/node": "^18.6.1",
"@types/node": "^18.6.3",
"@types/ws": "^8.5.3",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.31.0",
"cz-conventional-changelog": "^3.3.0",
"discord.js": "^13.9.1",
"discord.js": "^13.9.2",
"eslint": "^8.20.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
Expand All @@ -67,7 +67,7 @@
"pinst": "^3.0.0",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"rollup": "^2.77.1",
"rollup": "^2.77.2",
"rollup-plugin-version-injector": "^1.3.3",
"ts-jest": "^28.0.7",
"typedoc": "^0.23.9",
Expand Down
22 changes: 9 additions & 13 deletions src/lib/utils/application-commands/computeDifferences.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { cast } from '@sapphire/utilities';
import {
APIApplicationCommandIntegerOption,
APIApplicationCommandNumberOption,
Expand Down Expand Up @@ -648,58 +647,55 @@ function* reportOptionDifferences({

if (hasMinMaxLengthSupport(option)) {
// Check min and max_value
const existingCasted = cast<APIApplicationCommandStringOption & { min_length?: number; max_length?: number }>(existingOption);

// TODO (Framework#485): With discord-api-types 0.36.x this cast will no longer be necessary
const optionCasted = cast<APIApplicationCommandStringOption & { min_length?: number; max_length?: number }>(option);
const existingCasted = existingOption as APIApplicationCommandStringOption;

// 0. No min_length and now we have min_length
if (existingCasted.min_length === undefined && optionCasted.min_length !== undefined) {
if (existingCasted.min_length === undefined && option.min_length !== undefined) {
yield {
key: `${keyPath(currentIndex)}.min_length`,
expected: 'min_length present',
original: 'no min_length present'
};
}
// 1. Have min_length and now we don't
else if (existingCasted.min_length !== undefined && optionCasted.min_length === undefined) {
else if (existingCasted.min_length !== undefined && option.min_length === undefined) {
yield {
key: `${keyPath(currentIndex)}.min_length`,
expected: 'no min_length present',
original: 'min_length present'
};
}
// 2. Equality check
else if (existingCasted.min_length !== optionCasted.min_length) {
else if (existingCasted.min_length !== option.min_length) {
yield {
key: `${keyPath(currentIndex)}.min_length`,
original: String(existingCasted.min_length),
expected: String(optionCasted.min_length)
expected: String(option.min_length)
};
}

// 0. No max_length and now we have max_length
if (existingCasted.max_length === undefined && optionCasted.max_length !== undefined) {
if (existingCasted.max_length === undefined && option.max_length !== undefined) {
yield {
key: `${keyPath(currentIndex)}.max_length`,
expected: 'max_length present',
original: 'no max_length present'
};
}
// 1. Have max_length and now we don't
else if (existingCasted.max_length !== undefined && optionCasted.max_length === undefined) {
else if (existingCasted.max_length !== undefined && option.max_length === undefined) {
yield {
key: `${keyPath(currentIndex)}.max_length`,
expected: 'no max_length present',
original: 'max_length present'
};
}
// 2. Equality check
else if (existingCasted.max_length !== optionCasted.max_length) {
else if (existingCasted.max_length !== option.max_length) {
yield {
key: `${keyPath(currentIndex)}.max_length`,
original: String(existingCasted.max_length),
expected: String(optionCasted.max_length)
expected: String(option.max_length)
};
}
}
Expand Down
Loading

0 comments on commit 28633d3

Please sign in to comment.