♻️ Change loose equality to strict equality

This commit is contained in:
Malted 2023-03-01 23:57:35 +00:00
parent fe3c9bdef7
commit ffb1d8cdc2
No known key found for this signature in database
GPG key ID: EF970CF7A39D477D
16 changed files with 68 additions and 68 deletions

View file

@ -184,8 +184,8 @@ function Percentage({ fee }) {
alignItems: 'center', alignItems: 'center',
bg: 'slate', bg: 'slate',
color: 'green', color: 'green',
width: [fee.length == 1 ? 70 : 80, fee.length == 1 ? 128 : 138], width: [fee.length === 1 ? 70 : 80, fee.length === 1 ? 128 : 138],
height: [fee.length == 1 ? 70 : 80, fee.length == 1 ? 128 : 138], height: [fee.length === 1 ? 70 : 80, fee.length === 1 ? 128 : 138],
borderRadius: 'circle', borderRadius: 'circle',
fontWeight: 'bold', fontWeight: 'bold',
justifyContent: 'center', justifyContent: 'center',
@ -195,8 +195,8 @@ function Percentage({ fee }) {
content: '"%"', content: '"%"',
fontSize: [24, 40], fontSize: [24, 40],
fontWeight: 'normal', fontWeight: 'normal',
marginRight: fee.length == 1 ? -2 : 0, marginRight: fee.length === 1 ? -2 : 0,
marginLeft: [null, fee.length == 1 ? 2 : 0], marginLeft: [null, fee.length === 1 ? 2 : 0],
color: 'muted' color: 'muted'
} }
}} }}

View file

@ -97,12 +97,12 @@ export default function Bio({ popup = true, spanTwo = false, ...props }) {
)} )}
</Text> </Text>
</Flex> </Flex>
{popup == false && ( {!popup && (
<Text mt={2} mb={0} color="black"> <Text mt={2} mb={0} color="black">
{text} {text}
</Text> </Text>
)} )}
{popup == false && href && ( {!popup && href && (
<Flex sx={{ alignItems: 'center' }}> <Flex sx={{ alignItems: 'center' }}>
<Text <Text
sx={{ sx={{
@ -127,7 +127,7 @@ export default function Bio({ popup = true, spanTwo = false, ...props }) {
)} )}
</Box> </Box>
</Card> </Card>
{popup == true && expand && ( {popup && expand && (
<> <>
<Flex <Flex
sx={{ sx={{

View file

@ -69,7 +69,7 @@ const CardModel = ({
)} )}
{github_link != null ? ( {github_link != null ? (
<Box> <Box>
{position == 'bottom' ? ( {position === 'bottom' ? (
<Flex <Flex
sx={{ sx={{
position: 'absolute', position: 'absolute',

View file

@ -43,13 +43,13 @@ export default function Epoch() {
Object.keys(timeLeft).forEach(e => { Object.keys(timeLeft).forEach(e => {
if (!timeLeft[e]) { if (!timeLeft[e]) {
if (e == 'days') { if (e === 'days') {
return return
} else if (e == 'hours') { } else if (e === 'hours') {
if (!timeLeft['days']) { if (!timeLeft['days']) {
return return
} }
} else if (e == 'min') { } else if (e === 'min') {
if (!timeLeft['days'] && !timeLeft['hours']) { if (!timeLeft['days'] && !timeLeft['hours']) {
return return
} }
@ -62,19 +62,19 @@ export default function Epoch() {
var name = '' var name = ''
if (e == 'days') { if (e === 'days') {
if (timeLeft[e] == 1 || timeLeft[e] == 0) { if (timeLeft[e] === 1 || timeLeft[e] === 0) {
name = 'day' name = 'day'
} else { } else {
name = 'days' name = 'days'
} }
} else if (e == 'hours') { } else if (e === 'hours') {
if (timeLeft[e] == 1 || timeLeft[e] == 0) { if (timeLeft[e] === 1 || timeLeft[e] === 0) {
name = 'hour' name = 'hour'
} else { } else {
name = 'hours' name = 'hours'
} }
} else if (e == 'min') { } else if (e === 'min') {
name = 'min' name = 'min'
} else { } else {
name = 'sec' name = 'sec'

View file

@ -50,8 +50,8 @@ export default function GitHub({
rel="noopener" rel="noopener"
> >
{user != null ? ( {user != null ? (
user != 'dependabot[bot]' ? ( user !== 'dependabot[bot]' ? (
user != 'github-actions[bot]' ? ( user !== 'github-actions[bot]' ? (
<img <img
src={img} src={img}
sx={{ borderRadius: '100%', height: '90%', mr: 2 }} sx={{ borderRadius: '100%', height: '90%', mr: 2 }}
@ -66,8 +66,8 @@ export default function GitHub({
<></> <></>
)} )}
{user != null ? ( {user != null ? (
user != 'dependabot[bot]' ? ( user !== 'dependabot[bot]' ? (
user != 'github-actions[bot]' ? ( user !== 'github-actions[bot]' ? (
<Text <Text
sx={{ sx={{
mr: 2, mr: 2,
@ -91,8 +91,8 @@ export default function GitHub({
<></> <></>
)} )}
{user != null ? ( {user != null ? (
user != 'dependabot[bot]' ? ( user !== 'dependabot[bot]' ? (
user != 'github-actions[bot]' ? ( user !== 'github-actions[bot]' ? (
<Text <Text
sx={{ sx={{
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
@ -114,8 +114,8 @@ export default function GitHub({
<></> <></>
)} )}
{user != null ? ( {user != null ? (
user != 'dependabot[bot]' ? ( user !== 'dependabot[bot]' ? (
user != 'github-actions[bot]' ? ( user !== 'github-actions[bot]' ? (
<Text <Text
as="span" as="span"
sx={{ sx={{

View file

@ -13,8 +13,8 @@ const JoinForm = ({ sx = {} }) => {
: { reason: router.query.reason } : { reason: router.query.reason }
}) })
const isAdult = useField('educationLevel').value == 'tertiary' const isAdult = useField('educationLevel').value === 'tertiary'
const useWaitlist = process.env.NEXT_PUBLIC_OPEN != 'true' const useWaitlist = process.env.NEXT_PUBLIC_OPEN !== 'true'
return ( return (
<Card sx={{ maxWidth: 'narrow', mx: 'auto', label: { mb: 3 }, ...sx }}> <Card sx={{ maxWidth: 'narrow', mx: 'auto', label: { mb: 3 }, ...sx }}>
@ -41,7 +41,7 @@ const JoinForm = ({ sx = {} }) => {
<Select <Select
{...useField('continent')} {...useField('continent')}
required required
sx={{ color: useField('continent').value == '' ? 'muted' : '' }} sx={{ color: useField('continent').value === '' ? 'muted' : '' }}
> >
<option value="" selected disabled hidden> <option value="" selected disabled hidden>
Select a continent... Select a continent...
@ -60,7 +60,7 @@ const JoinForm = ({ sx = {} }) => {
{...useField('educationLevel')} {...useField('educationLevel')}
required required
sx={{ sx={{
color: useField('educationLevel').value == '' ? 'muted' : '' color: useField('educationLevel').value === '' ? 'muted' : ''
}} }}
> >
<option value="" selected disabled hidden> <option value="" selected disabled hidden>

View file

@ -124,7 +124,7 @@ const Cards = ({ avatar, username, description, image }) => {
<Flex <Flex
as="a" as="a"
href={ href={
username != 'cjmika110' username !== 'cjmika110'
? `https://scrapbook.hackclub.com/${username}` ? `https://scrapbook.hackclub.com/${username}`
: 'https://scrapbook.hackclub.com' : 'https://scrapbook.hackclub.com'
} }
@ -188,7 +188,7 @@ export default function Projects() {
'3D printer' '3D printer'
] ]
if (count == list.length - 1) { if (count === list.length - 1) {
setCount(0) setCount(0)
} }

View file

@ -7,7 +7,7 @@ export function middleware(request) {
let url = request.nextUrl let url = request.nextUrl
if (!url.searchParams.get('continent')) { if (!url.searchParams.get('continent')) {
let continent = country.findByIso2(request.geo.country || 'AU').continent let continent = country.findByIso2(request.geo.country || 'AU').continent
if (continent == 'Oceania') { if (continent === 'Oceania') {
continent = 'Australia' continent = 'Australia'
} }
url.searchParams.set('continent', continent) url.searchParams.set('continent', continent)

View file

@ -47,13 +47,13 @@ export default function Geohot() {
Object.keys(timeLeft).forEach(e => { Object.keys(timeLeft).forEach(e => {
if (!timeLeft[e]) { if (!timeLeft[e]) {
if (e == 'days') { if (e === 'days') {
return return
} else if (e == 'hours') { } else if (e === 'hours') {
if (!timeLeft['days']) { if (!timeLeft['days']) {
return return
} }
} else if (e == 'min') { } else if (e === 'min') {
if (!timeLeft['days'] && !timeLeft['hours']) { if (!timeLeft['days'] && !timeLeft['hours']) {
return return
} }
@ -66,19 +66,19 @@ export default function Geohot() {
var name = '' var name = ''
if (e == 'days') { if (e === 'days') {
if (timeLeft[e] == 1 || timeLeft[e] == 0) { if (timeLeft[e] === 1 || timeLeft[e] === 0) {
name = 'day' name = 'day'
} else { } else {
name = 'days' name = 'days'
} }
} else if (e == 'hours') { } else if (e === 'hours') {
if (timeLeft[e] == 1 || timeLeft[e] == 0) { if (timeLeft[e] === 1 || timeLeft[e] === 0) {
name = 'hour' name = 'hour'
} else { } else {
name = 'hours' name = 'hours'
} }
} else if (e == 'min') { } else if (e === 'min') {
name = 'min' name = 'min'
} else { } else {
name = 'sec' name = 'sec'

View file

@ -47,13 +47,13 @@ export default function Sal() {
Object.keys(timeLeft).forEach(e => { Object.keys(timeLeft).forEach(e => {
if (!timeLeft[e]) { if (!timeLeft[e]) {
if (e == 'days') { if (e === 'days') {
return return
} else if (e == 'hours') { } else if (e === 'hours') {
if (!timeLeft['days']) { if (!timeLeft['days']) {
return return
} }
} else if (e == 'min') { } else if (e === 'min') {
if (!timeLeft['days'] && !timeLeft['hours']) { if (!timeLeft['days'] && !timeLeft['hours']) {
return return
} }
@ -66,19 +66,19 @@ export default function Sal() {
var name = '' var name = ''
if (e == 'days') { if (e === 'days') {
if (timeLeft[e] == 1 || timeLeft[e] == 0) { if (timeLeft[e] === 1 || timeLeft[e] === 0) {
name = 'day' name = 'day'
} else { } else {
name = 'days' name = 'days'
} }
} else if (e == 'hours') { } else if (e === 'hours') {
if (timeLeft[e] == 1 || timeLeft[e] == 0) { if (timeLeft[e] === 1 || timeLeft[e] === 0) {
name = 'hour' name = 'hour'
} else { } else {
name = 'hours' name = 'hours'
} }
} else if (e == 'min') { } else if (e === 'min') {
name = 'min' name = 'min'
} else { } else {
name = 'sec' name = 'sec'

View file

@ -38,13 +38,13 @@ export default function Vitalik() {
Object.keys(timeLeft).forEach(e => { Object.keys(timeLeft).forEach(e => {
if (!timeLeft[e]) { if (!timeLeft[e]) {
if (e == 'days') { if (e === 'days') {
return return
} else if (e == 'hours') { } else if (e === 'hours') {
if (!timeLeft['days']) { if (!timeLeft['days']) {
return return
} }
} else if (e == 'min') { } else if (e === 'min') {
if (!timeLeft['days'] && !timeLeft['hours']) { if (!timeLeft['days'] && !timeLeft['hours']) {
return return
} }
@ -57,19 +57,19 @@ export default function Vitalik() {
var name = '' var name = ''
if (e == 'days') { if (e === 'days') {
if (timeLeft[e] == 1 || timeLeft[e] == 0) { if (timeLeft[e] === 1 || timeLeft[e] === 0) {
name = 'day' name = 'day'
} else { } else {
name = 'days' name = 'days'
} }
} else if (e == 'hours') { } else if (e === 'hours') {
if (timeLeft[e] == 1 || timeLeft[e] == 0) { if (timeLeft[e] === 1 || timeLeft[e] === 0) {
name = 'hour' name = 'hour'
} else { } else {
name = 'hours' name = 'hours'
} }
} else if (e == 'min') { } else if (e === 'min') {
name = 'min' name = 'min'
} else { } else {
name = 'sec' name = 'sec'

View file

@ -43,9 +43,9 @@ export default async function handler(req, res) {
} }
const data = req.body || {} const data = req.body || {}
const open = process.env.NEXT_PUBLIC_OPEN == 'true' const open = process.env.NEXT_PUBLIC_OPEN === 'true'
const waitlist = !open const waitlist = !open
const isAdult = data.educationLevel == 'tertiary' const isAdult = data.educationLevel === 'tertiary'
const secrets = (process.env.NAUGHTY || '').split(',') const secrets = (process.env.NAUGHTY || '').split(',')

View file

@ -17,7 +17,7 @@ export async function Slack() {
} }
).then(r => r.json()) ).then(r => r.json())
if (slackData == null || slackData.stats == null) { if (!slackData || !slackData.stats) {
console.warn("No slack data"); console.warn("No slack data");
return {} return {}
} else { } else {

View file

@ -4,7 +4,7 @@ export async function getConsoles() {
).then(r => r.json()) ).then(r => r.json())
function check(val) { function check(val) {
return val == 'Pending' || val == 'Approved' return val === 'Pending' || val === 'Approved'
} }
const consoleCount = data const consoleCount = data

View file

@ -1,7 +1,7 @@
import { graphql } from '@octokit/graphql' import { graphql } from '@octokit/graphql'
export async function fetchStars() { export async function fetchStars() {
if (process.env.GITHUB_TOKEN == null) { if (!process.env.GITHUB_TOKEN) {
console.warn("Note - GITHUB_TOKEN not defined, stars will not be fetched from github") console.warn("Note - GITHUB_TOKEN not defined, stars will not be fetched from github")
return { sprig:"?", sinerider:"?", sprigHardware:"?", hackclub:"?", hackathons:"?"}; return { sprig:"?", sinerider:"?", sprigHardware:"?", hackclub:"?", hackathons:"?"};
} }

View file

@ -101,7 +101,7 @@ function Page({
`White sheets of paper\nWaiting to be printed on\nA blank console waits` `White sheets of paper\nWaiting to be printed on\nA blank console waits`
) )
useEffect(() => { useEffect(() => {
if (count == images.length - 1) { if (count === images.length - 1) {
setCount(0) setCount(0)
} }
}, [count]) }, [count])
@ -349,7 +349,7 @@ function Page({
figure: { figure: {
position: 'absolute', position: 'absolute',
transform: transform:
count % 2 == 0 ? 'rotate(3deg)' : 'rotate(-3deg)', count % 2 === 0 ? 'rotate(3deg)' : 'rotate(-3deg)',
height: '85%', height: '85%',
width: ['80%', '80%', '70%', '100%'], width: ['80%', '80%', '70%', '100%'],
marginLeft: ['10%', '10%', '15%', '0'] marginLeft: ['10%', '10%', '15%', '0']
@ -362,14 +362,14 @@ function Page({
> >
<Photo <Photo
src={ src={
count == images.length - 2 count === images.length - 2
? images[0].src ? images[0].src
: images.length - 1 : images.length - 1
? images[1].src ? images[1].src
: images[count + 2].src : images[count + 2].src
} }
alt={ alt={
count == images.length - 2 count === images.length - 2
? images[0].alt ? images[0].alt
: images.length - 1 : images.length - 1
? images[1].alt ? images[1].alt
@ -391,7 +391,7 @@ function Page({
figure: { figure: {
position: 'absolute', position: 'absolute',
transform: transform:
count % 2 == 0 ? 'rotate(-3deg)' : 'rotate(3deg)', count % 2 === 0 ? 'rotate(-3deg)' : 'rotate(3deg)',
height: '85%', height: '85%',
width: ['80%', '80%', '70%', '100%'], width: ['80%', '80%', '70%', '100%'],
marginLeft: ['10%', '10%', '15%', '0'] marginLeft: ['10%', '10%', '15%', '0']
@ -404,12 +404,12 @@ function Page({
> >
<Photo <Photo
src={ src={
count == images.length - 1 count === images.length - 1
? images[0].src ? images[0].src
: images[count + 1].src : images[count + 1].src
} }
alt={ alt={
count == images.length - 1 count === images.length - 1
? images[0].alt ? images[0].alt
: images[count + 1].alt : images[count + 1].alt
} }
@ -429,7 +429,7 @@ function Page({
figure: { figure: {
position: 'absolute', position: 'absolute',
transform: transform:
count % 2 == 0 ? 'rotate(3deg)' : 'rotate(-3deg)', count % 2 === 0 ? 'rotate(3deg)' : 'rotate(-3deg)',
height: '85%', height: '85%',
width: ['80%', '80%', '70%', '100%'], width: ['80%', '80%', '70%', '100%'],
marginLeft: ['10%', '10%', '15%', '0'] marginLeft: ['10%', '10%', '15%', '0']