Skip to content

Commit

Permalink
fix: linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
viet nguyen committed Jul 26, 2023
1 parent b74b5ed commit fec0bb7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
17 changes: 0 additions & 17 deletions src/js/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,6 @@ export const computeClimbingPercentsAndColors = (climbs: ClimbType[]): PercentAn
export const sanitizeName = (s: string): string =>
s.replace(/^(\(.{1,3}\) *)|((\d?[1-9]|[1-9]0)[:])|[a-zA-Z]{1,2}\./, '')

/**
* Simplify climb 'type' dictionary to contain only 'true' key-value pair.
* @example {sport: true, boulder: false, trad: false} => {sport: true}
* @param type Climb type key-value dictionary
*/
export const simplifyClimbTypeJson = (type?: ClimbDisciplineRecord): {[key: string]: boolean} => {
if (type === undefined) return {}
for (const key in type) {
// @ts-expect-error
if (type[key] === false) {
// @ts-expect-error
delete type[key]
}
}
return type
}

export const getSlug = (areaID: string, isLeaf: boolean, childAreasCount: number = -1): string => {
const type = isLeaf || childAreasCount === 0 ? 'crag' : 'areas'
return `/${type}/${areaID}`
Expand Down
2 changes: 1 addition & 1 deletion src/pages/pulse.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ReactElement, ReactNode } from 'react'
import React, { ReactNode } from 'react'
import { NextPage, GetStaticProps } from 'next'
import Link from 'next/link'
import Layout from '../components/layout'
Expand Down

0 comments on commit fec0bb7

Please sign in to comment.