refactor: remove safe-touch

This commit is contained in:
EnixCoda 2020-03-11 00:39:55 +08:00
parent 63e94bda6e
commit 68dc0f77b5
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD
3 changed files with 2 additions and 9 deletions

View file

@ -33,7 +33,6 @@
"react-dom": "^16.8.6",
"react-use": "^13.8.0",
"react-window": "^1.8.5",
"safe-touch": "^0.2.2",
"webextension-polyfill": "^0.5.0"
},
"devDependencies": {

View file

@ -1,5 +1,4 @@
import * as React from 'react'
import { safeTouch } from 'safe-touch'
import { MetaData } from 'utils/GitHubHelper'
type Props = {
@ -7,8 +6,8 @@ type Props = {
}
export function MetaBar({ metaData }: Props) {
const userUrl = safeTouch(metaData).api.owner.html_url()
const repoUrl = safeTouch(metaData).api.html_url()
const userUrl = metaData?.api?.owner.html_url
const repoUrl = metaData?.api?.html_url
return (
<div className={'meta-bar'}>
<a className={'username'} href={userUrl}>

View file

@ -6955,11 +6955,6 @@ safe-regex@^1.1.0:
dependencies:
ret "~0.1.10"
safe-touch@^0.2.2:
version "0.2.5"
resolved "https://registry.yarnpkg.com/safe-touch/-/safe-touch-0.2.5.tgz#3b6c5f724622daf2a71f918aaa303e13e729ced9"
integrity sha512-IIMmIaHoaTLqSuDKk3HBJRXo1CkZfCa7sCPiuzF85o3X/5QAT+LaTSM23n3BfLtl8ry9caAaTZWPpWZ2gDjriQ==
"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"