Merge pull request #14 from Hexiro/return-boolean-expression

HUGE PR: return boolean expression instead of using if statement
This commit is contained in:
Conrad Crawford authored and GitHub committed 2021-06-24 12:27:59 -04:00
commit 716a84ac6f
1 file changed
+1 -4
+1 -4
View File
@@ -11,10 +11,7 @@ const EPOCH = 1420070400000; // Discord's EPOCH
export function isSnowflake(snowflake: string): boolean {
const { timestamp } = deconstruct(snowflake);
if (timestamp > EPOCH && timestamp <= 3619093655551) {
return true;
}
return false;
return (timestamp > EPOCH && timestamp <= 3619093655551);
}
function deconstruct(snowflake: string): DeconstructedSnowflake {