Skip to content

Commit b4605bd

Browse files
Add NOT_EQUAL comparison to tags (#11)
Add NOT_EQUAL comparison to tags (!=), same logic as js
1 parent 26f839e commit b4605bd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/utils/tags.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export const AllowedDiscordProperties = Object.freeze({
9595

9696
export enum TagIfComparisons {
9797
EQUAL = '=',
98+
NOT_EQUAL = "!=",
9899
GREATER_THAN = '>',
99100
GREATER_THAN_OR_EQUAL = '>=',
100101
LESS_THAN = '<',
@@ -105,6 +106,7 @@ export enum TagIfComparisons {
105106

106107
export const TAG_IF_COMPARISONS = [
107108
TagIfComparisons.EQUAL,
109+
TagIfComparisons.NOT_EQUAL,
108110
TagIfComparisons.GREATER_THAN,
109111
TagIfComparisons.GREATER_THAN_OR_EQUAL,
110112
TagIfComparisons.LESS_THAN,
@@ -911,6 +913,9 @@ const ScriptTags = Object.freeze({
911913
case TagIfComparisons.EQUAL: {
912914
compared = values[0] === values[1];
913915
}; break;
916+
case TagIfComparisons.NOT_EQUAL: {
917+
compared = values[0] !== values[1];
918+
}; break;
914919
case TagIfComparisons.GREATER_THAN:
915920
case TagIfComparisons.GREATER_THAN_OR_EQUAL:
916921
case TagIfComparisons.LESS_THAN:

0 commit comments

Comments
 (0)